Skip to content

Conversation

@taleinat
Copy link
Contributor

@taleinat taleinat commented Nov 11, 2018

The warning is displayed in new shell windows, except when running a command or a script. (This is identical to the existing behavior of the warning about problematic Tcl/Tk versions on macOS.)

https://bugs.python.org/issue34864

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

The idea is good in principle, thanks. But the code cannot assume that the preference is always available.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@taleinat
Copy link
Contributor Author

Thanks for the review @ned-deily!

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@ned-deily: please review the changes made to this pull request.

Copy link
Member

@ned-deily ned-deily left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for making the changes. BTW, I notice that, with macOS 10.13 at least, if a change to "Always" is made while IDLE is running, the change is honored on the next window open; no need to restart IDLE. So perhaps the message can be simplified. Also, just an FYI, if a tab (rather than a window) is created, it can be converted to a window by control-clicking on the tab title bar and selecting the "Move Tab to New Window" option; this is a standard macOS feature with tabs and seems to work OK with IDLE.

Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

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

Thank you both for PR and review. IDLE still start normally on Windows with patch.
I removed 2.7 backport only because it will have to be done by hand.
Besides CI tests, I think manually testing it on Mac should be enough.

@@ -0,0 +1 @@
On macOS, warn if "Prefer tabs when opening documents" is set to "Always".
Copy link
Member

Choose a reason for hiding this comment

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

For the idlelib/News.txt entry, I am thinking about the more specific

When opening IDLE with Shell on macOS, warn if System
Preference "Prefer tabs when opening documents" is set to "Always".

Do what you like best for the blurb.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer not mentioning the shell, since that's an implementation detail of how we currently show warnings, and could change in the future.

Copy link
Member

@terryjreedy terryjreedy Nov 15, 2018

Choose a reason for hiding this comment

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

The issue I addressed is when the check is made, which appears to at at startup if Shell is opened and no code is run by command line options. If 'always' is set after IDLE is open, there will be no warning until the next start.

Where messages go is a different issue, except that not using Shell will allow checks when IDLE is opened to edit a file. config._warn prints to stderr (the console if IDLE started from one). I am thinking all messages from IDLE should go to a message log (output) window that can be saved or printed.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be put in the comfy chair!

@taleinat taleinat force-pushed the bpo-34864/idle_warn_macos_prefer_tabs_setting branch from ae5a09c to 81975d8 Compare November 12, 2018 06:26
@taleinat
Copy link
Contributor Author

@ned-deily

BTW, I notice that, with macOS 10.13 at least, if a change to "Always" is made while IDLE is running, the change is honored on the next window open; no need to restart IDLE. So perhaps the message can be simplified.

Thanks, I've updated the warning message.

@taleinat
Copy link
Contributor Author

Thanks for the review @terryjreedy!

I have made the requested changes; please review again.

Regarding the 2.7 backport, I'll do it manually after this goes in.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@ned-deily, @terryjreedy: please review the changes made to this pull request.

@terryjreedy
Copy link
Member

If people changes to 'alway' while IDLE is running, there will be no warning until IDLE is started again. It is up to them to connect 'I changed the setting' to 'IDLE changed behavior'.

@terryjreedy
Copy link
Member

Since this was written, there has been a question (report) about this on Stackoverflow. I added a note to idlelib/NEWS.txt and will merge when CI passes to get this in the upcoming rcs.

@terryjreedy terryjreedy merged commit 9ebe879 into python:master Dec 7, 2018
@miss-islington
Copy link
Contributor

Thanks @taleinat for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

@terryjreedy: Please replace # with GH- in the commit message next time. Thanks!

@bedevere-bot
Copy link

GH-11013 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 7, 2018
…s" (pythonGH-10464)

* bpo-34864: warn if "Prefer tabs when opening documents" set to "Always"

* add NEWS entry

* address code review comments

* address second code review comments

* Add entry for idlelib/NEWS.txt.
(cherry picked from commit 9ebe879)

Co-authored-by: Tal Einat <[email protected]>
@bedevere-bot
Copy link

GH-11014 is a backport of this pull request to the 3.6 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 7, 2018
…s" (pythonGH-10464)

* bpo-34864: warn if "Prefer tabs when opening documents" set to "Always"

* add NEWS entry

* address code review comments

* address second code review comments

* Add entry for idlelib/NEWS.txt.
(cherry picked from commit 9ebe879)

Co-authored-by: Tal Einat <[email protected]>
miss-islington added a commit that referenced this pull request Dec 7, 2018
…s" (GH-10464)

* bpo-34864: warn if "Prefer tabs when opening documents" set to "Always"

* add NEWS entry

* address code review comments

* address second code review comments

* Add entry for idlelib/NEWS.txt.
(cherry picked from commit 9ebe879)

Co-authored-by: Tal Einat <[email protected]>
miss-islington added a commit that referenced this pull request Dec 7, 2018
…s" (GH-10464)

* bpo-34864: warn if "Prefer tabs when opening documents" set to "Always"

* add NEWS entry

* address code review comments

* address second code review comments

* Add entry for idlelib/NEWS.txt.
(cherry picked from commit 9ebe879)

Co-authored-by: Tal Einat <[email protected]>
vstinner added a commit that referenced this pull request Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OS-mac type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants