My locale is ru_RU.UTF-8 I emerge sys-libs/db-4.7.25_p4 and it creates file /usr/include/db.h with the following string (month name is encoded as UTF-8): #define DB_VERSION_STRING "Berkeley DB 4.7.25: (Август 6, 2009)" After this, i try to emerge dev-lang/python-3.1 which fails: ... File "/var/tmp/portage/dev-lang/python-3.1/work/Python-3.1/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 926: ordinal not in range(128) Analysis shown that ascii.py is trying to open /usr/include/db.h and character at position 926 is first byte (0xD0) of two-byte cyrillic letter "А" of the mentioned string. I re-emerged sys-libs/db: # LC_ALL=C emerge db As result, file /usr/include/db.h now contains #define DB_VERSION_STRING "Berkeley DB 4.7.25: (August 6, 2009)" After that, python-3.1 emerges without errors.
*** This bug has been marked as a duplicate of bug 280001 ***