Author akira
Recipients akira, berker.peksag, charpov, gregory.p.smith, haypo, ronaldoussoren, travis.thieman, tshepang
Date 2014-11-19.22:38:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1416436681.92.0.835942451086.issue22536@psf.upfronthosting.co.za>
In-reply-to
Content
It would be inconsitent to provide filename only if exec is called e.g.:

   >>> import subprocess
   subprocess.call("not used", cwd="nonexistent")
   FileNotFoundError: [Errno 2] No such file or directory: 'nonexistent'

The error message shows the filename (cwd) despite exec not being 
called therefore it would be logical to provide non-None `filename` 
attribute here too.

If we ignore the backward compatibility issue I've mentioned in msg231297 
then the current code:

                        if errno_num == errno.ENOENT:
                            if child_exec_never_called:
                                # The error must be from chdir(cwd).
                                err_msg += ': ' + repr(cwd)
                            else:
                                err_msg += ': ' + repr(orig_executable)
                    raise child_exception_type(errno_num, err_msg)

could be replaced with:
                        
                        if errno_num == errno.ENOENT:
                            if child_exec_never_called:
                                # The error must be from chdir(cwd).
                                filename = cwd
                            else:
                                filename = orig_executable
                            raise child_exception_type(errno_num, err_msg, filename)
                    raise child_exception_type(errno_num, err_msg)


[1] https://hg.python.org/cpython/file/23ab1197df0b/Lib/subprocess.py#l1443
History
Date User Action Args
2014-11-19 22:38:02akirasetrecipients: + akira, gregory.p.smith, ronaldoussoren, haypo, tshepang, berker.peksag, charpov, travis.thieman
2014-11-19 22:38:01akirasetmessageid: <1416436681.92.0.835942451086.issue22536@psf.upfronthosting.co.za>
2014-11-19 22:38:01akiralinkissue22536 messages
2014-11-19 22:38:01akiracreate