[issue24505] shutil.which wrong result on Windows

2016-01-16 Thread Toby Tobkin

Toby Tobkin added the comment:

Steve, yeah I saw that and started playing with Clinic last night. I'll have 
the updated patch out soon--I've just been slow because I've been flying around 
to interviews trying to get my first job out of college and it's been eating 
all my free time.

--

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



[issue24505] shutil.which wrong result on Windows

2015-12-30 Thread Toby Tobkin

Toby Tobkin added the comment:

Patch incorporating Eryk Sun's feedback for various Windows-specific behavior 
attached.

--
Added file: http://bugs.python.org/file41459/issue-24505-proposed-patch-2.diff

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



[issue24505] shutil.which wrong result on Windows

2015-12-17 Thread Toby Tobkin

Toby Tobkin added the comment:

Patch and tests attached. All Python tests passed on Windows 8 and Ubuntu 
14.04LTS.

--
keywords: +patch
Added file: http://bugs.python.org/file41338/issue 24505 proposed patch windows 
cmd semantics.patch

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



[issue24505] shutil.which wrong result on Windows

2015-12-14 Thread Toby Tobkin

Toby Tobkin added the comment:

Hopefully this isn't too much of an amateur question, but I ran into a 
semantics issue: should which be imitating the semantics of the Windows shell 
or of CreateProcess[3]? The current implementation of shutil.which implies 
Windows shell, but Python uses CreateProcess in subprocess for executing 
commands, not cmd.exe.

In order to correctly emulate the behavior of the Windows command search 
sequence[1] (e.g. for cmd.exe or Powershell), one needs to check whether or not 
a given command matches one of the internal Windows shell commands. For 
instance, if we have an executable at C:\xyz\chdir.exe, the following outputs 
should be observed from which if our current directory is C:\xyz:

>>> which('chdir')
(none)

>>> which('.\\chdir')
'C:\\xyz\\chdir.exe'

On the other hand, CreateProcess[3] would work this way:

CreateProcess(NULL, "chdir", ...) --> executes C:\xyz\chdir.exe
CreateProcess(NULL, "chdir.exe", ...) --> executes C:\xyz\chdir.exe

There are other semantic differences as well. For example, CreateProcess will 
not do path extension of e.g. "abc" to "abc.bat", but Powershell and cmd will.

Which semantics do I follow? Powershell/cmd or CreateProcess?

[1] Subsection "Command Search Sequence" of 
https://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection127121120120
[2] Subsection "Internal and External Commands" of 
https://technet.microsoft.com/en-us/library/cc723564.aspx#XSLTsection127121120120
[3] 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx

--

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



[issue24505] shutil.which wrong result on Windows

2015-12-11 Thread Toby Tobkin

Toby Tobkin added the comment:

I'm working on a patch and an accompanying unit test for this now. Should have 
it out today.

--
nosy: +tobytobkin

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



[issue25807] test_multiprocessing_fork.test_mymanager fails and hangs

2015-12-08 Thread Toby Tobkin

Toby Tobkin added the comment:

Do you have more information on the environment you're running tests on? I did 
not reproduce the crash by running the tests on a stock Ubuntu 14 64-bit.

--
nosy: +tobytobkin

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