This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ezio.melotti
Recipients ezio.melotti, giampaolo.rodola, r.david.murray
Date 2010-06-17.19:19:22
SpamBayes Score 0.09384538
Marked as misclassified No
Message-id <1276802364.96.0.224029167526.issue9018@psf.upfronthosting.co.za>
In-reply-to
Content
Right now posixpath returns the argument unchanged, ntpath performs a .replace(), and macpath a .lower(), so when non-string (or non-bytes) are passed to normcase the results are:
posixpath: arg returned as-is;
ntpath: AttributeError (object has no attribute 'replace');
macpath: AttributeError (object has no attribute 'lower');

In posixpath we could reject all the non-string (and non-bytes) args, raising a TypeError. For consistency, the other functions should raise a TypeError too, but I'm not sure it's worth changing it.

Attached a simple testcase that checks that normcase raises a TypeError for invalid values with all the three implementations.
History
Date User Action Args
2010-06-17 19:19:25ezio.melottisetrecipients: + ezio.melotti, giampaolo.rodola, r.david.murray
2010-06-17 19:19:24ezio.melottisetmessageid: <1276802364.96.0.224029167526.issue9018@psf.upfronthosting.co.za>
2010-06-17 19:19:23ezio.melottilinkissue9018 messages
2010-06-17 19:19:22ezio.melotticreate