Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load plugin in f22 with Chinese locale #32

Closed
hizukiayaka opened this issue Nov 4, 2015 · 5 comments
Closed

Can't load plugin in f22 with Chinese locale #32

hizukiayaka opened this issue Nov 4, 2015 · 5 comments

Comments

@hizukiayaka
Copy link

Hi, my language environment is zh_CN.utf8, with using the latest version 0.7.0-1 in dnf
I will got
Traceback (most recent call last):
File "/bin/dnf", line 36, in
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 198, in user_main
errcode = main(args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
return _main(base, args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 117, in _main
cli.configure(map(ucd, args))
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1006, in configure
self.base.plugins.run_init(self.base, self)
File "/usr/lib/python2.7/site-packages/dnf/plugin.py", line 104, in run_init
plugin = p_cls(base, cli)
File "/usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py", line 359, in init
super(SystemUpgradePlugin, self).init(base, cli)
TypeError: must be type, not None

But if I use the LANG=C, it would work

@kparal
Copy link
Contributor

kparal commented Nov 4, 2015

Reported here in Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=1278031

@kparal
Copy link
Contributor

kparal commented Nov 5, 2015

Another traceback related to Chinese locale:

Nov 04 21:04:21 ERROR 加载插件失败:system_upgrade
Nov 04 21:04:21 SUBDEBUG
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/dnf/plugin.py”, line 124, in import_modules
module = importlib.import_module(name)
File “/usr/lib64/python2.7/importlib/init.py”, line 37, in import_module
import(name)
File “/usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py”, line 363, in
class SystemUpgradeCommand(dnf.cli.Command):
File “/usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py”, line 369, in SystemUpgradeCommand
_(“OPTIONS”), _(“VERSION”))
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe9 in position 0: ordinal not in range(128)

The user says:

I comment off the line 368 and 368 in /usr/lib/python2.7/site-packages/dnf-plugins/system_upgrade.py
,then the problem is solved and my os updates to fedora 23 successfully

https://fedoramagazine.org/upgrading-from-fedora-22-to-fedora-23/#comment-449918

@yol
Copy link

yol commented Nov 5, 2015

Also affects ja_JP.utf8 and de_DE.utf8, so possibly all languages which use more than 7-bit ASCII characters.

@yol yol mentioned this issue Nov 5, 2015
jsilhan pushed a commit to jsilhan/dnf-plugin-system-upgrade that referenced this issue Nov 6, 2015
@wgwoods
Copy link
Contributor

wgwoods commented Nov 6, 2015

It looks like (at least part of) this is a problem in upstream DNF - see rpm-software-management/dnf#375 for more info.

PR #34 technically fixes the problem but since dnf.i18n.ucd* are being deprecated I'm inclined to try to find a solution that doesn't rely on that.

@xasx
Copy link

xasx commented Nov 9, 2015

@wgwoods wgwoods closed this as completed in 8430636 Nov 9, 2015
wgwoods added a commit that referenced this issue Nov 17, 2015
PR #38 fixed both manifestations of our py2 unicode problems, if you
have dnf-1.1.4. Unfortunately, Fedora 21 and Fedora 22 don't have that,
so we need to backport its `dnf.i18n.translate()` function so we can do
translations without crashing all over the place.

This re-fixes rhbz#1278031, #32, and #34 (We reverted the original fix
in commit 3fbcb9b so we could do this correctly here.)

Closes #38, closes #32 (again), closes #34 (again).
Resolves: rhbz#1277895
Resolves: rhbz#1278031
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants