On Thu, Mar 30, 2017 at 8:47 PM, Zachary Ware
<zachary.ware+py...@gmail.com> wrote:
> In this case, the problem is the bogus Unicode escape that you
> inadvertently included in your path: `\Us...`.  To fix it, either use a
> 'raw' string (`r"C:\Users\..."`) or use forward slashes rather than
> backslashes, which Windows is happy to accept.

Forward slash is acceptable when all you need to support is DOS-style
paths that are limited to DOS semantics and MAX_PATH. A raw string
works, except not for paths ending in backslash and not for unicode
strings in Python 2. A generic solution is to use a pathlib.Path() in
3.x, which normalizes the path to use backslash, or os.path.normpath()
in 2.x.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to