Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 439800 - sys-apps/pkgcore-0.8.5-r1: fails tests with Python 3 (encoding-related issues)
Summary: sys-apps/pkgcore-0.8.5-r1: fails tests with Python 3 (encoding-related issues)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Brian Harring (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-26 21:14 UTC by Michał Górny
Modified: 2012-10-29 08:41 UTC (History)
2 users (show)

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


Attachments
The build log (20121026-210955.log,177.31 KB, text/plain)
2012-10-26 21:14 UTC, Michał Górny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-10-26 21:14:57 UTC
Created attachment 327496 [details]
The build log

sys-apps/pkgcore-0.8.5-r1 fails its own tests when Python 3 is used as the default Python implementation. I guess that's because portage sets some random locale (C?) for tests and it fails to handle UTF-8 files properly then.
Comment 1 Mike Gilbert gentoo-dev 2012-10-26 21:37:41 UTC
Traceback (most recent call last):
  File "/usr/lib64/python3.2/site-packages/snakeoil/test/__init__.py", line 236, in run
    self.forced_extra_frame(testMethod)
  File "/usr/lib64/python3.2/site-packages/snakeoil/test/__init__.py", line 201, in forced_extra_frame
    test()
  File "/tmp/portage/sys-apps/pkgcore-0.8.5-r1/work/pkgcore-0.8.5/build/lib/pkgcore/test/fs/test_fs.py", line 109, in test_init
    raw_data = open("/etc/passwd").read()
  File "/usr/lib64/python3.2/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 795: ordinal not in range(128)

I wonder how it is supposed to know what encoding your password file (/etc/passwd) has. Is that standardized anywhere?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-10-26 21:44:02 UTC
(In reply to comment #1)
> Traceback (most recent call last):
>   File "/usr/lib64/python3.2/site-packages/snakeoil/test/__init__.py", line
> 236, in run
>     self.forced_extra_frame(testMethod)
>   File "/usr/lib64/python3.2/site-packages/snakeoil/test/__init__.py", line
> 201, in forced_extra_frame
>     test()
>   File
> "/tmp/portage/sys-apps/pkgcore-0.8.5-r1/work/pkgcore-0.8.5/build/lib/pkgcore/
> test/fs/test_fs.py", line 109, in test_init
>     raw_data = open("/etc/passwd").read()
>   File "/usr/lib64/python3.2/encodings/ascii.py", line 26, in decode
>     return codecs.ascii_decode(input, self.errors)[0]
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 795:
> ordinal not in range(128)
> 
> I wonder how it is supposed to know what encoding your password file
> (/etc/passwd) has. Is that standardized anywhere?

No. I think only the GECOS field is allowed to have non-ASCII characters but that field can basically hold anything and pkgcore need to make use of its contents.
Comment 3 Brian Harring (RETIRED) gentoo-dev 2012-10-29 08:41:54 UTC
0.8.6 will resolve it.