[issue23747] platform module exposes win32_ver function on posix systems

2015-03-24 Thread R. David Murray
Changes by R. David Murray : -- Removed message: http://bugs.python.org/msg239124 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-24 Thread R. David Murray
R. David Murray added the comment: It is a deliberate choice because the functions accept default values to be returned if the actual values cannot be determined, and because it is easier therefore to write cross-platform scripts if the functions do *not* raise an error when called on the "wro

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-24 Thread R. David Murray
R. David Murray added the comment: It is a deliberate choice because (I'm guessing) the designer thought it would make it easier to write cross platform scripts. In any case, as Haypo said, it is what it is (and it *is* consistent with itself). -- nosy: +r.david.murray __

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: > Maybe it is okay if these functions are present, but can't they raise an > exception or return None instead of returning these funny tuples when empty > strings ? It would break the backward compatibility. Again, it's a delibarate choice. -- __

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread Anand B Pillai
Anand B Pillai added the comment: Similarly for mac_ver, java_ver etc. >>> platform.mac_ver() ('', ('', '', ''), '') >>> platform.java_ver() ('', '', ('', '', ''), ('', '', '')) Maybe it is okay if these functions are present, but can't they raise an exception or return None instead of returni

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread STINNER Victor
STINNER Victor added the comment: > Why is this function even exposed on Linux? It is a deliberate design choice of the platform module. mac_ver(), win32_ver() and linux_distribution() are available on all platforms. mac_ver() says "entries which cannot be determined are set to ''. All tuple

[issue23747] platform module exposes win32_ver function on posix systems

2015-03-23 Thread Anand B Pillai
New submission from Anand B Pillai: >>> import platform >>> platform.system() 'Linux' >>> platform.win32_ver() ('', '', '', '') Why is this function even exposed on Linux ? It should be conditionally exposed only on win32 platforms. Funny that this is coming from the module named "platform" i