This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients DaveH, amaury.forgeotdarc, tim.golden
Date 2013-03-13.12:42:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1363178548.09.0.411416895216.issue17366@psf.upfronthosting.co.za>
In-reply-to
Content
> 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?
History
Date User Action Args
2013-03-13 12:42:28amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, tim.golden, DaveH
2013-03-13 12:42:28amaury.forgeotdarcsetmessageid: <1363178548.09.0.411416895216.issue17366@psf.upfronthosting.co.za>
2013-03-13 12:42:28amaury.forgeotdarclinkissue17366 messages
2013-03-13 12:42:27amaury.forgeotdarccreate