Message223654
| Author |
serhiy.storchaka |
| Recipients |
hynek, ncoghlan, serhiy.storchaka |
| Date |
2014年07月22日.09:33:29 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1406021609.78.0.443791365349.issue22034@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
posixpath.join() raises misleading exception in case when all arguments are bytearrays:
>>> import posixpath
>>> posixpath.join(bytearray(b'foo'), bytearray(b'bar'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/posixpath.py", line 91, in join
"components.") from None
TypeError: Can't mix strings and bytes in path components.
This bug was introduced in issue15377 and misleading test which provoked it was added in issue15180.
I proposed two patches. Patch for 3.4 only eliminates wrong specialcasing of bytearray (none of os.path methods work with bytearray). Patch for 3.5 also adds better error messages for wrong argument types of posixpath.join (of course we can apply it to 3.4 too). |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2014年07月22日 09:33:29 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, ncoghlan, hynek |
| 2014年07月22日 09:33:29 | serhiy.storchaka | set | messageid: <1406021609.78.0.443791365349.issue22034@psf.upfronthosting.co.za> |
| 2014年07月22日 09:33:29 | serhiy.storchaka | link | issue22034 messages |
| 2014年07月22日 09:33:29 | serhiy.storchaka | create |
|