Message108049
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. |
|
Date |
User |
Action |
Args |
2010-06-17 19:19:25 | ezio.melotti | set | recipients:
+ ezio.melotti, giampaolo.rodola, r.david.murray |
2010-06-17 19:19:24 | ezio.melotti | set | messageid: <1276802364.96.0.224029167526.issue9018@psf.upfronthosting.co.za> |
2010-06-17 19:19:23 | ezio.melotti | link | issue9018 messages |
2010-06-17 19:19:22 | ezio.melotti | create | |
|