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.

classification
Title: distutils C compiler: set_executables() incorrectly parse values with spaces
Type: behavior Stage: resolved
Components: Distutils Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Dee Mee, dstufft, eric.araujo, vstinner
Priority: normal Keywords: patch

Created on 2017-11-06 10:34 by Dee Mee, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 4296 closed Dee Mee, 2017-11-06 13:17
PR 4316 merged python-dev, 2017-11-07 13:33
Messages (5)
msg305627 - (view) Author: Dee Mee (Dee Mee) * Date: 2017-11-06 10:34
Function set_executable() in ccompiler.py does the following check:

    def set_executable(self, key, value):
        if isinstance(value, str):
            setattr(self, key, split_quoted(value))
        else:
            setattr(self, key, value)


The check "if isinstance(value, str)" is incorrect, because type of value can be unicode, while it should be splitted as well.
msg305645 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-06 15:43
> The check "if isinstance(value, str)" is incorrect, because type of value can be unicode, while it should be splitted as well.

Your pull request is for Python 3, but the type of paths is expected to be str on Python 3, no?

For Python 2, you can use isinstance(value, basestring).
msg305760 - (view) Author: Dee Mee (Dee Mee) * Date: 2017-11-07 14:00
I agree, that this fix is necessary only for Python 2. Submitted new PR 4316
msg305858 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-08 15:48
New changeset 849482955f70eb1adc47a20dcbce3b4add47d864 by Victor Stinner (Mazay0) in branch '2.7':
bpo-31955: Fix distutils CCompiler.set_executable() for Unicode (GH-4316)
https://github.com/python/cpython/commit/849482955f70eb1adc47a20dcbce3b4add47d864
msg305860 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-11-08 15:50
Thank you Dee Mee for your bug report and your bug fix!
History
Date User Action Args
2022-04-11 14:58:54adminsetgithub: 76136
2017-11-08 15:50:23vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg305860

stage: patch review -> resolved
2017-11-08 15:48:50vstinnersetmessages: + msg305858
2017-11-07 14:00:22Dee Meesetmessages: + msg305760
versions: - Python 3.6, Python 3.7
2017-11-07 13:33:12python-devsetpull_requests: + pull_request4275
2017-11-06 15:43:31vstinnersetnosy: + vstinner

messages: + msg305645
versions: + Python 3.7, - Python 3.4, Python 3.5
2017-11-06 15:38:36vstinnersettitle: set_executables() incorrectly parse values with spaces -> distutils C compiler: set_executables() incorrectly parse values with spaces
2017-11-06 13:17:22Dee Meesetkeywords: + patch
stage: patch review
pull_requests: + pull_request4256
2017-11-06 10:34:35Dee Meecreate