Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Revise run_python_script_in_terminal #17635

Merged
merged 4 commits into from
Apr 7, 2022

Conversation

mrclary
Copy link
Contributor

@mrclary mrclary commented Apr 6, 2022

Description of Changes

run_python_script_in_terminal is revised to:

  • ensure proper execution when spaces are present in wdir and/or python file path
  • remove Python 2 consideration
  • remove redundancies in changing the current working directory for execution

Issue(s) Resolved

Fixes #17595

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: @mrclary

Quote wdir for darwin in write statement.
Fix typo for PYTHONHOME environment variable.
For Terminal.app, env and cwd kwargs in Popen do not have any affect.
@pep8speaks
Copy link

pep8speaks commented Apr 6, 2022

Hello @mrclary! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-04-06 19:36:44 UTC

@mrclary mrclary self-assigned this Apr 6, 2022
@mrclary mrclary added this to the v5.3.1 milestone Apr 6, 2022
Do not 'cd' in cmd as this is redundant with cwd keyword argument.
remove wdir-option as it is redundant with cwd.
run_program does not like quoted python file, whereas run_shell_command is okay with it.
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help with this @mrclary! I left a small question for you, otherwise looks good to me.

spyder/utils/programs.py Show resolved Hide resolved
@ccordoba12 ccordoba12 requested a review from dalthviz April 7, 2022 15:52
@ccordoba12
Copy link
Member

@dalthviz, could you manually check if this fixes issue #17595 on Windows? Thanks!

@mrclary
Copy link
Contributor Author

mrclary commented Apr 7, 2022

@ccordoba12 @dalthviz, I neglected to mention that I successfully tested the behavior on macOS, Ubuntu (VM), and Windows (VM). Just an FYI; please do verify as well, if you can.

Copy link
Member

@dalthviz dalthviz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mrclary for helping fixing this! Testing this locally on Windows worked for me 👍

Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @mrclary!

@ccordoba12 ccordoba12 merged commit 2a28827 into spyder-ide:5.x Apr 7, 2022
ccordoba12 added a commit that referenced this pull request Apr 7, 2022
@mrclary mrclary deleted the space-in-path branch April 7, 2022 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants