Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 561846 - =sys-apps/portage-2.2.22 - ascii codec traceback on dohtml on paths containig uncode charcters
Summary: =sys-apps/portage-2.2.22 - ascii codec traceback on dohtml on paths containig...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2015-09-29 18:27 UTC by Vadim A. Misbakh-Soloviov (mva)
Modified: 2016-03-14 04:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_561846.txt,31.28 KB, text/plain)
2015-09-29 18:28 UTC, Vadim A. Misbakh-Soloviov (mva)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2015-09-29 18:27:48 UTC
Hi there!
I'm working on ebuild for package, which has unicode characters in it's html documentation. And when I installing docs (let's forget about banning base eclass and dohtml), I get following traceback:

====

Traceback (most recent call last):
  File "/usr/lib/portage/python2.7/dohtml.py", line 235, in <module>
    main()
  File "/usr/lib/portage/python2.7/dohtml.py", line 220, in main
    success |= install(basename, dirname, options)
  File "/usr/lib/portage/python2.7/dohtml.py", line 99, in install
    install(i, dirname, options, pfx)
  File "/usr/lib/portage/python2.7/dohtml.py", line 72, in install
    fullpath = os.path.join(dirname, fullpath)
  File "/usr/lib64/python2.7/posixpath.py", line 80, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7: ordinal not in range(128)

====


Reproducible: Always
Comment 1 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2015-09-29 18:28:28 UTC
Created attachment 413282 [details]
emerge --info
Comment 2 Zac Medico gentoo-dev 2015-09-29 18:50:59 UTC
We can use portage.os to transparently handle encoding and decoding in most places. With python3, we should use surrogateescape to encode command arguments (like install.py does). We should die if any arguments or listdir results do not decode as valid UTF-8.
Comment 3 Zac Medico gentoo-dev 2015-10-03 22:48:46 UTC
There's a patch in the following branch:

https://github.com/zmedico/portage/tree/bug_561846

You can test it like this:

echo '=sys-apps/portage-9999 **' >> /etc/portage/package.accept_keywords
portage_LIVE_BRANCH=bug_561846 \
portage_LIVE_REPO=https://github.com/zmedico/portage.git \
emerge -1 =sys-apps/portage-9999

I've posted it for review here:

https://archives.gentoo.org/gentoo-portage-dev/message/f6a3f74300789f3eeb8371352b5da48d
Comment 5 Zac Medico gentoo-dev 2016-03-14 04:05:10 UTC
Fixed in 2.2.23.