Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 583412

Summary: dev-lang/python:2.7: ConfigParser partially incompatible with Turkish locale
Product: Gentoo Linux Reporter: Anthony Basile <blueness>
Component: [OLD] DevelopmentAssignee: Python Gentoo Team <python>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: arfrever.fta, dev-portage
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 571444    
Attachments: python-2.7-ConfigParser_turkish_locale.patch

Description Anthony Basile gentoo-dev 2016-05-18 15:11:28 UTC
Here are the steps to hit the problem

1. Edit /etc/locale.gen and enable at least 'tr_TR ISO-8859-9'
2. Run locale-gen
3. Use `eselect locale` to choose tr_TR or tr_TR.iso88599 or turkish
4. Use `eselect python` to choose python2.7
5. emerge anything, eg `emerge gradm`

You get the following backtrace.  Looks to me like ConfigParser is confused by the strange locale.


Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python2.7/site-packages/_emerge/main.py", line 1146, in emerge_main
    action=myaction, args=myfiles, opts=myopts)
  File "/usr/lib64/python2.7/site-packages/portage/proxy/objectproxy.py", line 31, in __call__
    return result(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 2383, in load_emerge_config
    root_trees["root_config"] = RootConfig(settings, root_trees, setconfig)
  File "/usr/lib64/python2.7/site-packages/_emerge/RootConfig.py", line 27, in __init__
    self.sets = self.setconfig.getSets()
  File "/usr/lib64/python2.7/site-packages/portage/_sets/__init__.py", line 272, in getSets
    self._parse()
  File "/usr/lib64/python2.7/site-packages/portage/_sets/__init__.py", line 224, in _parse
    optdict[oname] = parser.get(sname, oname)
  File "/usr/lib64/python2.7/ConfigParser.py", line 623, in get
    return self._interpolate(section, option, value, d)
  File "/usr/lib64/python2.7/ConfigParser.py", line 691, in _interpolate
    self._interpolate_some(option, L, rawval, section, vars, 1)
  File "/usr/lib64/python2.7/ConfigParser.py", line 723, in _interpolate_some
    option, section, rest, var)
InterpolationMissingOptionError: Bad value substitution:
	section: [usersets]
	option : directory
	key    : portage_configroot
	rawval : etc/portage/sets



Reproducible: Always
Comment 1 Arfrever Frehtes Taifersar Arahesis 2016-05-18 22:00:43 UTC
Created attachment 434648 [details, diff]
python-2.7-ConfigParser_turkish_locale.patch

I will add something like this patch to 22_all_turkish_locale.patch.
(Release of CPython 2.7.12 is scheduled on next month.)
Comment 2 Anthony Basile gentoo-dev 2016-05-19 01:56:25 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> Created attachment 434648 [details, diff] [details, diff]
> python-2.7-ConfigParser_turkish_locale.patch
> 
> I will add something like this patch to 22_all_turkish_locale.patch.
> (Release of CPython 2.7.12 is scheduled on next month.)

Shouldn't this also go to dev-lang/python-2.7.* ?
Comment 3 Anthony Basile gentoo-dev 2016-05-19 11:17:00 UTC
(In reply to Anthony Basile from comment #2)
> (In reply to Arfrever Frehtes Taifersar Arahesis from comment #1)
> > Created attachment 434648 [details, diff] [details, diff] [details, diff]
> > python-2.7-ConfigParser_turkish_locale.patch
> > 
> > I will add something like this patch to 22_all_turkish_locale.patch.
> > (Release of CPython 2.7.12 is scheduled on next month.)
> 
> Shouldn't this also go to dev-lang/python-2.7.* ?

I tested this with dev-lang/python-2.7.10-r1 and it works.  I'd like to see it added as a patch to the next python 2.7 release as well as going upstream.