Message163883
Tinkering with os.path.join, that traceback means that "name" is a str instance, while "path" is a bytes instance.
The culprit actually appears to be the fact that the type returned by os.listdir (et al) when handed a file descriptor is always a string (this is not explicitly documented, a problem in itself, but that's the behaviour I see here on linux).
One way to handle this would be to use the filesystem encoding with surrogateescape to decode any bytes path passed in to shutil.rmtree (at least in the _rmtree_safe_fd case) and handle the actual removal with Unicode throughout.
So long as the original encoding of the supplied bytes path is compatible with that of the underlying filesystem, surrogateescape should ensure that everything round trips correctly. |
|
Date |
User |
Action |
Args |
2012-06-25 03:18:56 | ncoghlan | set | recipients:
+ ncoghlan, loewis, georg.brandl, jcea, pitrou, larry, schmir, tarek, ezio.melotti, eric.araujo, Arfrever, mrts, neologix, teamnoir, rosslagerwall, python-dev, petri.lehtinen, hynek |
2012-06-25 03:18:55 | ncoghlan | set | messageid: <1340594335.78.0.785867991206.issue4489@psf.upfronthosting.co.za> |
2012-06-25 03:18:55 | ncoghlan | link | issue4489 messages |
2012-06-25 03:18:54 | ncoghlan | create | |
|