New submission from Ben Gamari <bgam...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue13055>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to