Summary: | sys-apps/portage: emerge UnicodeDecodeError raised from locale.format() via portage.localization.localized_size | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Zac Medico <zmedico> |
Component: | Core - Interface (emerge) | Assignee: | Portage team <dev-portage> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | info |
Priority: | Normal | Keywords: | InVCS |
Version: | 2.2 | ||
Hardware: | All | ||
OS: | All | ||
URL: | https://forums.gentoo.org/viewtopic-t-1040978.html | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 573774 |
Description
Zac Medico
2016-03-20 19:53:55 UTC
It must be a python bug or something wrong with the locale. We'll just have to handle the UnicodeDecodeError inside that portage.localization.localized_size function, and just fallback to some kind of dumb formatting. Looking at Modules/_localemodule.c in the python source tree, it must be failing to decode the locale data in the PyLocale_localeconv function where it calls this code: #define RESULT_STRING(s)\ do { \ x = PyUnicode_DecodeLocale(l->s, NULL); \ RESULT(#s, x); \ } while (0) The PyUnicode_DecodeLocale function is defined in Objects/unicodeobject.c, and it is capable of raising UnicodeDecodeError. So, I think our best course of action is to handle the UnicodeDecodeError as suggested in comment #1. There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_577862 It can be applied as follows: mkdir -p /etc/portage/patches/sys-apps/portage wget -O /etc/portage/patches/sys-apps/portage/bug_577862.patch \ https://github.com/zmedico/portage/commit/327834be018781c7e6da9734140f74e6d4e23c6a.patch emerge -1 portage I've posted the patch for review here: https://archives.gentoo.org/gentoo-portage-dev/message/ec52ee334e5336f747720df007046a0f This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=33c8d30cc10cb11cb098d4dfe92f7187b20eefaf Fixed in 2.3.0. |