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 bar.harel
Recipients bar.harel, bobjalex, eryksun, paul.moore, r.david.murray, steve.dower, tim.golden, zach.ware
Date 2015-10-05.23:18:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAMsGuynYio8xBeA9OqeQHOdH2RJUgCZYQxz82afaXWc7HxnQUw@mail.gmail.com>
In-reply-to <1444077811.17.0.968407586856.issue24505@psf.upfronthosting.co.za>
Content
Thanks eryksun.

Regarding the slashes, it should be fine as the input should be with
backslashes anyway. We don't need to fix the input as fixing it would
result in inaccurate data. Just as it won't work without backslashes on
CMD, it shouldn't work here.

On Mon, Oct 5, 2015 at 11:43 PM eryksun <report@bugs.python.org> wrote:

>
> eryksun added the comment:
>
> My suggestion is only for 3.5 / 3.6, because Windows XP is no longer
> supported. Starting with Windows Vista, both cmd.exe and CreateProcess
> support this behavior. I realize that disabling searching the current
> director by default is going beyond what cmd.exe does, which is to require
> opting in via the environment variable. But Python can choose to follow the
> more-modern behavior of PowerShell as a precedent here.
>
> As Steve mentioned, technically a program isn't supposed to check for the
> environment variable, but instead call NeedCurrentDirectoryForExePath. This
> would require either adding a built-in function, e.g. to the _winapi
> module, or require ctypes:
>
>     >>> kernel32.NeedCurrentDirectoryForExePathW('command')
>     1
>     >>> os.environ['NoDefaultCurrentDirectoryInExePath'] = '1'
>     >>> kernel32.NeedCurrentDirectoryForExePathW('command')
>     0
>
> Note that it requires first normalizing the path to replace slashes with
> backslashes, which is unusual for the Windows API.
>
>     >>> kernel32.NeedCurrentDirectoryForExePathW(r'.\command')
>     1
>     >>> kernel32.NeedCurrentDirectoryForExePathW('./command')
>     0
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue24505>
> _______________________________________
>
History
Date User Action Args
2015-10-05 23:18:07bar.harelsetrecipients: + bar.harel, paul.moore, tim.golden, r.david.murray, zach.ware, eryksun, steve.dower, bobjalex
2015-10-05 23:18:07bar.harellinkissue24505 messages
2015-10-05 23:18:07bar.harelcreate