Message299646
| Author |
paul.moore |
| Recipients |
007hengxyx, paul.moore, steve.dower, tim.golden, zach.ware |
| Date |
2017年08月02日.07:42:14 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1501659735.3.0.676026146837.issue31101@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
There are two problems with your code and bug report:
1. By using a single quoted string, some of the backslashes in the path are being interpreted as starting a special character (specifically \t is interpreted as a tab character). You should either double the backslashes to prevent this interpretation (dir_path='d:\\c\\d\\e\\t\\c\\t.xf'), use forward slashes (dir_path='d:/c/d/e/t/c/t.xf') or use a raw string (dir_path=r'd:\c\d\e\t\c\t.xf').
2. You're reporting that Python "auto adds \". It doesn't, it's just that the repr of the string shows a single quoted string with backslashes doubled - that's the standard repr for strings.
So, Python is behaving as expected, and there's no bug here. |
|