[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: I appreciate your suggestion regarding cygwin, but in the new code base we want to avoid this dependency. Thanks for your time on this issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: Isn't Python's crossplatform functionality a key feature? A quick fix would be to retry the call by adding cwd to arg[0] in case of FileNotFoundError. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: As requested I did extra tests with extension. Same result as before: proc = subprocess.Popen(plink.exe, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace) proc = subprocess.Popen(.\plink.exe, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace) proc = subprocess.Popen(.\\plink.exe, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace) proc = subprocess.Popen(.\plink.exe, stdout=subprocess.PIPE, cwd=c:/python33/workspace) proc = subprocess.Popen(plink.exe, stdout=subprocess.PIPE, cwd=c:/python33/workspace) Traceback (most recent call last): File C:\Python33\lib\subprocess.py, line 1104, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified During handling of the above exception, another exception occurred: Traceback (most recent call last): File stdin, line 1, in module File C:\Python33\lib\subprocess.py, line 819, in __init__ restore_signals, start_new_session) File C:\Python33\lib\subprocess.py, line 1110, in _execute_child raise WindowsError(*e.args) FileNotFoundError: [WinError 2] The system cannot find the file specified I believe it's a wider issue, since my colleagues insisted on using shell=True on Windows by default (I didn't understand why, until now) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: plink.exe is located in c:\python33\workspace. I'm aware of the docstring difference between Python 2 and 3, thus submitted the bug for Python 3 only. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19643] shutil rmtree fails on readonly files in Windows
Jovik added the comment: This could be at least part of docs; I found that people tend to avoid shutil.rmtree(...) on Windows because of such issues. Some of them call subprocess(rmdir /S /Q path) to get desired behavior. -- nosy: +Jovik ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19643 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: Why this feature works on Posix systems, but not Windows? If my memory is correct, it didn't work anywhere when I used Python 2.7 (according with docs). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: I'm quite aware of the os.sep issues between the systems, but I checked both out of curiosity. Here are latest results: All of the following commands raises the same exception: proc = subprocess.Popen(plink, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace) proc = subprocess.Popen(plink, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace\\) proc = subprocess.Popen(.\plink, stdout=subprocess.PIPE, cwd=c:\python33\workspace) proc = subprocess.Popen(.\\plink, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace) proc = subprocess.Popen(plink, stdout=subprocess.PIPE, cwd=c:/python33/workspace) Traceback (most recent call last): File C:\Python33\lib\subprocess.py, line 1104, in _execute_child startupinfo) FileNotFoundError: [WinError 2] The system cannot find the file specified During handling of the above exception, another exception occurred: Traceback (most recent call last): File stdin, line 1, in module File C:\Python33\lib\subprocess.py, line 819, in __init__ restore_signals, start_new_session) File C:\Python33\lib\subprocess.py, line 1110, in _execute_child raise WindowsError(*e.args) FileNotFoundError: [WinError 2] The system cannot find the file specified But, when I set shell=True, then everything works just fine: proc = subprocess.Popen(plink, stdout=subprocess.PIPE, cwd=c:\python33\workspace, shell=True) proc = subprocess.Popen(.\plink, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace, shell=True) proc = subprocess.Popen(.\\plink, stdout=subprocess.PIPE, cwd=c:\\python33\\workspace, shell=True) proc = subprocess.Popen(plink, stdout=subprocess.PIPE, cwd=c:/python33/workspace, shell=True) I can get plink's output afterwards with proc.communicate() -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
New submission from Jovik: This works on Linux as expected: import subprocess proc = subprocess.Popen([./app], stdout=subprocess.PIPE, cwd=workspace) but on Windows I get: FileNotFoundError: [WinError 2] The system cannot find the file specified To successfully execute it on Windows I need to set shell=True first: proc = subprocess.Popen([app.exe], stdout=subprocess.PIPE, cwd=workspace, shell=True) which is odd since by default it should use cwd when searching for binary: If cwd is not None, the function changes the working directory to cwd before executing the child. In particular, the function looks for executable (or for the first item in args) relative to cwd if the executable path is a relative path. from http://docs.python.org/3.3/library/subprocess.html -- assignee: docs@python components: Documentation messages: 213570 nosy: Jovik, docs@python priority: normal severity: normal status: open title: Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path) type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20927] Different behaviour on Posix and Windows when using subprocess.Popen(..., cwd=path)
Jovik added the comment: I did a test with cwd being set to full path, but the result was the same (still had to use shell=True to execute a command). Let me know if I can provide any more details. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20927 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16521] logging.basicConfig creates empty file when using handlers
New submission from Jovik: Using logging.basicConfig() with Python 3.2.3 accepts handlers options without any errors. It creates an empty file. I don't think this should be default behaviour, sice it's very missleading (no exception thrown; no warning on standard output or in the file) -- components: Library (Lib) files: logginghandler.py messages: 176052 nosy: Jovik priority: normal severity: normal status: open title: logging.basicConfig creates empty file when using handlers type: behavior versions: Python 3.2 Added file: http://bugs.python.org/file28060/logginghandler.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16521 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com