New submission from tejas <teja...@gmail.com>: I am calling platform.linux_distribution() and platform.platform() on a modified Debian distribution with Python 2.6. FWIW the file /etc/debian_version exists on this machine, but is empty.
On calling platform.platform(), it seems to try to read the linux version from /etc/debian_version, but crashes with the following exception: Python 2.6 (r26:66714, Mar 4 2010, 13:02:59) [GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import platform >>> platform.platform() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.6/platform.py", line 1524, in platform distname,distversion,distid = dist('') File "/usr/local/lib/python2.6/platform.py", line 361, in dist full_distribution_name=0) File "/usr/local/lib/python2.6/platform.py", line 333, in linux_distribution _distname, _version, _id = _parse_release_file(firstline) File "/usr/local/lib/python2.6/platform.py", line 269, in _parse_release_file return '', version, id UnboundLocalError: local variable 'version' referenced before assignment ---------- components: Library (Lib) messages: 101198 nosy: tejas81 severity: normal status: open title: platform.platform() throws exception on modified debian distribution type: crash versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8160> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com