[New-bugs-announce] [issue13055] Distutils tries to handle null versions but fails

Ben Gamari report at bugs.python.org
Wed Sep 28 21:32:02 CEST 2011


New submission from Ben Gamari <bgamari at gmail.com>:

The distutils.LooseVersion constructor currently only calls parse if vstring has a value. Unfortunately, this means that a user passing in vstring="" or vstring=None gets a version object with self.vstring and self.version unset. This wreaks havoc later when the user tries to do anything with their object. I've attached two possible solutions.

The first attempts to fix the issue by raising an exception when an invalid vstring is given. This seems like the most reasonable treatment of this case as there is no reasonable way to fully initialize the object. The second works around the issue, initializing the uninitialized fields with "" in the event of an invalid vstring.

----------
files: distutils-fix.patch
keywords: patch
messages: 144575
nosy: bgamari
priority: normal
severity: normal
status: open
title: Distutils tries to handle null versions but fails
Added file: http://bugs.python.org/file23252/distutils-fix.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13055>
_______________________________________


More information about the New-bugs-announce mailing list