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 DaveH
Recipients DaveH, amaury.forgeotdarc
Date 2013-03-06.21:38:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CANVamNjUQu-fg4Q9aat9hbDrE9KhT0UqwiBzLYDrgodccKXRjQ@mail.gmail.com>
In-reply-to <1362559839.47.0.333268514687.issue17366@psf.upfronthosting.co.za>
Content
Hi Amaury,
As I can't reopen the bug I will have to add it here (or open a new bug report).

The issue was about the string used in os.chdir() particularly.
While this is expected behaviour in a python string it is not expected
behaviour from a well formed file path:
1. \t and \n are errors when used in a path.
2. A well formed Windows path with directories that start with a t or
n is interpreted as tabs and line feeds by Python. That is certainly
not expected behaviour in Windows this also means that any Python
built in method that uses the os.chdir() with a standard format
environment variable or registry setting will fail with the same
issue. It also sounds like any os module method will also be affected.
3. This issue took 1/2 hr to resolve. This makes python unreliable to
use on Windows with a difficult to find bug.

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.

My suggestion is that the os methods get rewritten so that path
parsing rules match the expected behaviour for the platform.

Regards,
Dave

On Wed, Mar 6, 2013 at 7:50 PM, Amaury Forgeot d'Arc
<report@bugs.python.org> wrote:
>
> Amaury Forgeot d'Arc added the comment:
>
> The backslash \ has a special meaning in strings: \n is the new line character, and \t is the tab character: http://docs.python.org/2/reference/lexical_analysis.html#string-literals
>
> Try to print the string!
> You could use \\, or raw strings r"like this".
> Or just use forward slashes / which are allowed by Windows.
>
> ----------
> nosy: +amaury.forgeotdarc
> resolution:  -> invalid
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue17366>
> _______________________________________
History
Date User Action Args
2013-03-06 21:38:43DaveHsetrecipients: + DaveH, amaury.forgeotdarc
2013-03-06 21:38:43DaveHlinkissue17366 messages
2013-03-06 21:38:42DaveHcreate