Bug 1368340 - crash with unicode directory name
Summary: crash with unicode directory name
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 26
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: ---
Assignee: Michael Mráka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1308994
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-19 06:23 UTC by Igor Gnatenko
Modified: 2017-05-02 16:50 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1308994
Environment:
Last Closed: 2017-05-02 16:50:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Igor Gnatenko 2016-08-19 06:23:58 UTC
[brain@x1carbon ~]$ LANG=C sudo dnf install ./Stažené/valgrind-3.11.0-26.fc25.x86_64.rpm
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib64/python3.5/logging/__init__.py", line 982, in emit
    stream.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 49-50: ordinal not in range(128)
Call stack:
  File "/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 174, in user_main
    errcode = main(args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.5/site-packages/dnf/cli/main.py", line 93, in _main
    cli.configure(list(map(ucd, args)))
  File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 1035, in configure
    self._log_essentials()
  File "/usr/lib/python3.5/site-packages/dnf/cli/cli.py", line 792, in _log_essentials
    'Command: %s', self.cmdstring)
Message: 'Command: %s'
Arguments: ('dnf install ./Sta\udcc5\udcbeen\udcc3\udca9/valgrind-3.11.0-26.fc25.x86_64.rpm ',)
Last metadata expiration check: 0:03:52 ago on Fri Aug 19 08:18:03 2016.
Segmentation fault




We should open logging file using codecs.open().

Comment 1 Jaroslav Mracek 2016-08-19 08:04:36 UTC
Igor, please can you provide standard information for bug reports, like version, what's the problem, what behavior you expect, how to reproduce it. Just keep in mind, that the bug can be solved by someone else and not by you. All this information are essential even if you provide a solution. Also keep in mind that your report can other reporters take as a standard format, how to report a bug on DNF. Thank you very much.

Comment 2 Igor Gnatenko 2016-08-19 08:41:20 UTC
(In reply to Jaroslav Mracek from comment #1)
> Igor, please can you provide standard information for bug reports, like
> version, what's the problem, what behavior you expect, how to reproduce it.
> Just keep in mind, that the bug can be solved by someone else and not by
> you. All this information are essential even if you provide a solution. Also
> keep in mind that your report can other reporters take as a standard format,
> how to report a bug on DNF. Thank you very much.

It's updated rawhide which means 1.1.10 and it contains info how to reproduce bug.

Comment 3 Jaroslav Mracek 2016-09-16 08:03:38 UTC
This problem will be pretty difficult to solve according to additional fails with dnf with python2. Se bellow with dnf-2.0.0-1.git.400.da4630f.fc24.noarch. 


[jmracek@dhcp-0-213 ~]$ LANG=C sudo dnf-2 install ./Stažené/*.rpm
Last metadata expiration check: 1:29:56 ago on Fri Sep 16 08:31:13 2016 CEST.
Traceback (most recent call last):
  File "/bin/dnf-2", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 170, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 111, in _main
    cli.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 947, in run
    return self.command.run()
  File "/usr/lib/python2.7/site-packages/dnf/cli/commands/install.py", line 76, in run
    for pkg in self.base.add_remote_rpms(self.opts.filenames, strict=strict):
  File "/usr/lib/python2.7/site-packages/dnf/base.py", line 982, in add_remote_rpms
    if not os.path.exists(path) and '://' in path:
  File "/usr/lib64/python2.7/genericpath.py", line 26, in exists
    os.stat(path)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017e' in position 5: ordinal not in range(128)

Comment 4 Igor Gnatenko 2016-09-16 10:30:12 UTC
(In reply to Jaroslav Mracek from comment #3)
> u'\u017e'

This is completely broken.

Comment 5 Michael Mráka 2016-11-22 12:20:03 UTC
Tested with dnf-2.0.0-0.rc1.1.git.0.e6df665.fc24.noarch. Works as expected.

[root@swm-lab01-vm02 ~]# LANG=C sudo dnf-2 install  ./Stažené/*.rpm 
Last metadata expiration check: 2:12:15 ago on Tue Nov 22 11:05:28 2016 CET.
Dependencies resolved.
================================================================================
 Package                  Arch       Version             Repository        Size
================================================================================
Installing:
 openssh-askpass          x86_64     7.2p2-10.fc24       @commandline      82 k
...
Total size: 2.5 M
Is this ok [y/N]: n
Operation aborted.

[root@swm-lab01-vm02 ~]# LANG=C sudo dnf-3 install  ./Stažené/*.rpm 
enabling fedora-debuginfo repository
enabling updates-debuginfo repository
Last metadata expiration check: 2:13:07 ago on Tue Nov 22 11:05:29 2016 CET.
Dependencies resolved.
================================================================================
 Package                  Arch       Version             Repository        Size
================================================================================
Installing:
 openssh-askpass          x86_64     7.2p2-10.fc24       @commandline      82 k
...
Total size: 2.5 M
Is this ok [y/N]: n
Operation aborted.

Comment 6 Fedora End Of Life 2017-02-28 10:07:43 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.


Note You need to log in before you can comment on or make changes to this bug.