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

bpo-33289: Return RGB triplet of ints instead of floats from tkinter.colorchooser #6578

Merged
merged 15 commits into from Jan 21, 2021

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Apr 23, 2018

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Docstrings look excessive verbose.

Any chance of writing tests for the color chooser?

Lib/tkinter/__init__.py Outdated Show resolved Hide resolved
Lib/tkinter/__init__.py Outdated Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_misc.py Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_misc.py Outdated Show resolved Hide resolved
@csabella
Copy link
Contributor Author

csabella commented Apr 23, 2018

Any chance of writing tests for the color chooser?

The color chooser invokes the show() method which automatically displays the dialog. I couldn't figure out how to automate the test to click 'ok' or 'cancel' since I wasn't defining those myself. What's the best way to interact with that kind of dialog window?

Lib/tkinter/colorchooser.py Outdated Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_misc.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented Apr 25, 2018

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented May 13, 2018

@csabella, do you mind to add a simple test as @terryjreedy required? I don't like tests that depend on implementation details, but here we don't have other way.

@csabella
Copy link
Contributor Author

csabella commented May 16, 2018

I have made the requested changes; please review again.

@bedevere-bot
Copy link

bedevere-bot commented May 16, 2018

Thanks for making the requested changes!

@terryjreedy: please review the changes made to this pull request.

Copy link
Member

@terryjreedy terryjreedy left a comment

Running test_tk runs the two ChooserTests. They pass and look complete. Anything else is up to Serhiy.

Lib/tkinter/test/test_tkinter/test_misc.py Outdated Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_misc.py Outdated Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_misc.py Outdated Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_misc.py Outdated Show resolved Hide resolved
Lib/tkinter/test/test_tkinter/test_colorchooser.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented Jul 12, 2018

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@codecov

This comment has been minimized.

@terryjreedy
Copy link
Member

terryjreedy commented Dec 25, 2020

Cheryl has not been active for some months, so I am fixing the conflict. It is mostly in the imports. I made the minimal edits needed; you might want to review the import section.

@terryjreedy
Copy link
Member

terryjreedy commented Dec 28, 2020

Pipelines Ubuntu:
======================================================================
FAIL: test_winfo_rgb (tkinter.test.test_tkinter.test_misc.MiscTest)
----------------------------------------------------------------------
Traceback (most recent call last):
18504
- (19018, 15420, 35980)
+ (18504, 15677, 35723)
======================================================================
FAIL: test_fixresult (tkinter.test.test_tkinter.test_colorchooser.ChooserTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vsts/work/1/s/Lib/tkinter/test/test_tkinter/test_colorchooser.py", line 38, in test_fixresult
    self.assertEqual(cc._fixresult(self.root, '#1e90ff'),
AssertionError: Tuples differ: ((33, 142, 255), '#1e90ff') != ((30, 144, 255), '#1e90ff')

First differing element 0:
(33, 142, 255)
(30, 144, 255)
- ((33, 142, 255), '#1e90ff')
?    ^    ^
+ ((30, 144, 255), '#1e90ff')
?    ^    ^

@terryjreedy
Copy link
Member

terryjreedy commented Jan 21, 2021

On tracker msg385400 (today, on the bpo issue) I give preliminary experimental results and speculations about the test failures. I necessary, I will add some temporary debug prints to the tests.

Lib/tkinter/__init__.py Outdated Show resolved Hide resolved
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
@serhiy-storchaka serhiy-storchaka merged commit 6713e86 into python:master Jan 21, 2021
3 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Jan 21, 2021

Thanks @csabella for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Jan 21, 2021

Sorry, @csabella and @serhiy-storchaka, I could not cleanly backport this to 3.9 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 6713e869c4989c04318158b406c30a147ea52904 3.9

@miss-islington
Copy link
Contributor

miss-islington commented Jan 21, 2021

Sorry @csabella and @serhiy-storchaka, I had trouble checking out the 3.8 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 6713e869c4989c04318158b406c30a147ea52904 3.8

@bedevere-bot
Copy link

bedevere-bot commented Jan 24, 2021

GH-24318 is a backport of this pull request to the 3.9 branch.

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Jan 24, 2021
…inter.colorchooser (pythonGH-6578).

(cherry picked from commit 6713e86)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 25, 2021
…inter.colorchooser (pythonGH-6578). (pythonGH-24318)

(cherry picked from commit 6713e86)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
(cherry picked from commit 3d5434d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Jan 25, 2021
…inter.colorchooser (GH-6578). (GH-24318)

(cherry picked from commit 6713e86)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
miss-islington added a commit that referenced this pull request Jan 25, 2021
…inter.colorchooser (GH-6578). (GH-24318)

(cherry picked from commit 6713e86)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
(cherry picked from commit 3d5434d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport to 3.8 type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants