[New-bugs-announce] [issue7773] platform._parse_release_file() can cause UnboundLocalError

Arfrever Frehtes Taifersar Arahesis report at bugs.python.org
Sun Jan 24 21:10:07 CET 2010

New submission from Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA at GMail.Com>:

When the release file doesn't contain some data, then platform._parse_release_file() causes UnboundLocalError. I'm attaching the patch to fix it.

$ 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

components: Library (Lib)
files: python-fix_platform._parse_release_file.patch
keywords: patch
messages: 98250
nosy: Arfrever
severity: normal
status: open
title: platform._parse_release_file() can cause UnboundLocalError
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file15993/python-fix_platform._parse_release_file.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list