Bug 1123886
Summary: | [abrt] dnf: i18n.py:138:_exact_width_char:TypeError: must be unicode, not str | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Marcela Mašláňová <mmaslano> | ||||||
Component: | dnf-plugins-core | Assignee: | Miroslav Suchý <msuchy> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 20 | CC: | akozumpl, asamalik, bblaskov, hhorak, ignatenko, jsilhan, lnie, mizdebsk, msuchy, packaging-team-maint, pnemade, rbean, rholy, sirdeiu, tim.lauridsen, ttomecek | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | x86_64 | ||||||||
OS: | Unspecified | ||||||||
URL: | https://retrace.fedoraproject.org/faf/reports/bthash/56cc0d0643be8386989df18098452afa0e5c2136 | ||||||||
Whiteboard: | abrt_hash:3f34490b19c15f2d9cbd2d3dbbfb0bf73dc29eb5 | ||||||||
Fixed In Version: | dnf-plugins-core-0.1.1-4.fc20 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2014-09-23 04:29:23 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | 1128135 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Marcela Mašláňová
2014-07-28 14:37:51 UTC
Created attachment 921773 [details]
File: backtrace
Created attachment 921774 [details]
File: environ
Moving to the COPR guys. Miroslav, plugins are not supposed to use output.fmtKeyValFill(), it is not in the API. Also CCing jsilhan, FYI. *** Bug 1128096 has been marked as a duplicate of this bug. *** (In reply to Ales Kozumplik from comment #3) > Moving to the COPR guys. Miroslav, plugins are not supposed to use > output.fmtKeyValFill(), it is not in the API. I did this earlier, because couldn't find API func to do this. What now we have to fill this ? (In reply to Igor Gnatenko from comment #5) > (In reply to Ales Kozumplik from comment #3) > > Moving to the COPR guys. Miroslav, plugins are not supposed to use > > output.fmtKeyValFill(), it is not in the API. > I did this earlier, because couldn't find API func to do this. > The correct approach is to open a bug against DNF describing the use case that you want the API to cover. Filled. *** Bug 1130391 has been marked as a duplicate of this bug. *** I probably hit this too with dnf-plugins-core-0.1.1-3.fc20.noarch: $ sudo dnf copr search nitrate [sudo] password for bblaskov: ================================================== Matched: nitrate =================================================== Traceback (most recent call last): File "/bin/dnf", line 36, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 200, in user_main errcode = main(args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 83, in main return _main(base, args) File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 133, in _main cli.run() File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1171, in run return self.command.run(self.base.extcmds) File "/usr/lib/python2.7/site-packages/dnf-plugins/copr.py", line 153, in run msg = self.base.output.fmtKeyValFill(msg, desc) File "/usr/lib/python2.7/site-packages/dnf/cli/output.py", line 704, in fmtKeyValFill keylen = exact_width(key) File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 164, in exact_width return sum(_exact_width_char(c) for c in msg) File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 164, in <genexpr> return sum(_exact_width_char(c) for c in msg) File "/usr/lib/python2.7/site-packages/dnf/i18n.py", line 138, in _exact_width_char return 2 if unicodedata.east_asian_width(uchar) in ('W', 'F', 'A') else 1 TypeError: must be unicode, not str I have made an easy workaround which fixes that: https://asamalik.fedorapeople.org/dnf_copr_search_workaround.patch Adam, thanks for taking action but this patch could not work in Python 3. I made more complex patch that cover that but I need to test it. Adam I took your patch, but instead used dnf.i18n.ucd() (which is documented in API) and the value is not needed to encode. So I minimalized it. Commited as b3be04f. Another user experienced a similar problem: sudo dnf copr search python reporter: libreport-2.2.3 cmdline: /usr/bin/python -OO /bin/dnf copr search python3 dso_list: dnf-plugins-core-0.1.1-3.fc20.noarch executable: /bin/dnf kernel: 3.15.8-200.mst.fc20.x86_64 package: dnf-0.5.4-2.fc20 reason: i18n.py:138:_exact_width_char:TypeError: must be unicode, not str runlevel: N 5 type: Python uid: 0 *** Bug 1132109 has been marked as a duplicate of this bug. *** dnf-plugins-core-0.1.3-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.3-1.fc21 Package dnf-plugins-core-0.1.3-1.fc21: * should fix your issue, * was pushed to the Fedora 21 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.1.3-1.fc21' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2014-10134/dnf-plugins-core-0.1.3-1.fc21 then log in and leave karma (feedback). Why is this build for fc21 when this bug has target version set to fc20? Will it be backported to fc20? The version field have semantics (you get this help, when you click on the label): This field is used to denote the version of the product that the problem is found in. So it was found in F20. But maintainers decided to fix it in F21. This is quite common to non-fatal bugs. Of course, you can always ask maintainers (akozumpl or jsilhan) to backport it to F20. You are right. I will contact maintainers to submit patch to fc20 as well. Thank you. dnf-plugins-core-0.1.3-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. *** Bug 1154801 has been marked as a duplicate of this bug. *** Could this be fixed in F20, please? dnf-plugins-core-0.1.1-4.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.1-4.fc20 dnf-plugins-core-0.1.1-4.fc20 works dnf-plugins-core-0.1.1-4.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. |