Message108049
| 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: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 |
|