Amaury Forgeot d'Arc added the comment:

> My expectation was that a platform os.chdir would parse the string for
> these characters and do something intelligent with them i.e a legal
> path from any of the systems (mac, linux or windows) passed in as a
> string to os.chdir would be converted to something that worked
> correctly.

This is not related to os.chdir.
In string literals, \ is the "escape character", and this is independent from 
the platform (and most programming language use the same convention).

As soon as the Python script is parsed and loaded into memory, there is no \t 
or \n anymore, but a "tab character", or a "newline character"; and os.chdir 
can't do anything about it.

> The suggestion of using forward slashes is unworkable when the scripts
> will be used across a range of computers where environment or registry
> variables get used.

How are those scripts written? Are the string constants generated on the fly? 
os.chdir("%SOME_DIRECTORY%")?

And did you try the r'' notation?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17366>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to