Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 301848 - dev-lang/python: platform._parse_release_file(""): UnboundLocalError: local variable 'version' referenced before assignment
Summary: dev-lang/python: platform._parse_release_file(""): UnboundLocalError: local v...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Python Gentoo Team
URL: http://bugs.python.org/issue7773
Whiteboard: 2.6.5, 3.1.2
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-22 14:52 UTC by YbbY
Modified: 2010-03-22 18:13 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description YbbY 2010-01-22 14:52:52 UTC
i've trought lots of udates latelly, emerge globally works but i do not since when, emerge --info gives backtrace :

# emerge -pv portage ; emerge --info

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-apps/portage-2.1.6.13  USE="-build -doc -epydoc (-selinux)" LINGUAS="-pl" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB
Portage 2.1.6.13 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.31-gentoo-r6 x86_64)
=================================================================
Traceback (most recent call last):
  File "/usr/bin/emerge", line 40, in <module>
    retval = _emerge.emerge_main()
  File "/usr/lib64/portage/pym/_emerge/__init__.py", line 15787, in emerge_main
    return action_info(settings, trees, myopts, valid_atoms)
  File "/usr/lib64/portage/pym/_emerge/__init__.py", line 13575, in action_info
    print "System uname: "+platform.platform(aliased=1)
  File "/usr/lib64/python2.6/platform.py", line 1520, in platform
    distname,distversion,distid = dist('')
  File "/usr/lib64/python2.6/platform.py", line 361, in dist
    full_distribution_name=0)
  File "/usr/lib64/python2.6/platform.py", line 333, in linux_distribution
    _distname, _version, _id = _parse_release_file(firstline)
  File "/usr/lib64/python2.6/platform.py", line 269, in _parse_release_file
    return '', version, id
UnboundLocalError: local variable 'version' referenced before assignment


Reproducible: Always

Steps to Reproduce:
1. emerge --info


Actual Results:  
Traceback with UnboundLocalError: local variable 'version' referenced before assignment


something may be wrong with the uname -a ?

# uname -a
Linux xpc 2.6.31-gentoo-r6 #3 SMP Fri Jan 22 15:21:17 CET 2010 x86_64 Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GenuineIntel GNU/Linux
Comment 1 YbbY 2010-01-24 17:05:24 UTC
probably was a bug python, after digging in /usr/lib64/python2.6/platform.py, i have done that :
"cp /etc/gentoo-release /etc/debian_version"
then emerge --info was working

after "rm /etc/debian_version", emerge --info is still working... complete mystery for me.
sorry for disturbing bugs.gentoo.org

Regards.
Comment 2 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-01-24 19:58:32 UTC
It's a valid bug still present in dev-lang/python-2.7_pre20100124.

# python2.7 -c 'import platform; platform._parse_release_file("")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.7/platform.py", line 285, in _parse_release_file
    return '', version, id
UnboundLocalError: local variable 'version' referenced before assignment
Comment 3 Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-03-22 18:13:23 UTC
Fixed in 2.6.5 and 3.1.2.