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
DateEntry bug in with Python 3.8 #61
Comments
Nevermind, I made a mistake here--clearly passing as not keyword arguments is just passing it as a different argument. I believe this is caused by a bug in Python, which I have logged in their issue tracker: https://bugs.python.org/issue38661?@ok_message=msg%20355818%20created%0Aissue%2038661%20created&@template=item Can we keep this open for now, and see what they say? |
Thanks a lot for noticing this and opening an issue in Python. I will leave this issue opened for now and if they decide not to restore the previous behavior, I will fix it in tkcalendar. |
What OS are you using? I have just installed python 3.8.0 in Archlinux and tkcalendar works fine, I have the same output of |
I am using Windows, which sounds like it would be part of the problem! |
Or maybe this issue is specific to the default windows ttk theme. Can you try to call |
I have made a temporary fix in branch https://github.com/j4321/tkcalendar/tree/fix_63 (I manually input the correct style map). |
Sounds good, although the fix will be theme-specific :( |
If you give me the output style map for every ttk theme specific to windows (I cannot get them from linux), I can implement a more general fix which takes the theme into account. The themes I already have are 'clam' and 'alt'. |
I can do! I generated them with this script: from tkinter import ttk
style = ttk.Style()
for theme in style.theme_names():
style.theme_use(theme)
print(theme)
print(style.map("TCombobox"))
print() This is the output:
I forgot to reply to your earlier comment--I was using |
Thanks, I have updated the code in branch https://github.com/j4321/tkcalendar/tree/fix_63. Can you test it? If this works fine for you I will merge it into master. |
Thank you @j4321 I haven't been able to try it yet I'm afraid, but it looks like a good temporary solution. |
Hey @j4321 trying this in my project, but noticed the update is not yet in the pip release. Are you going to put it in pip, or wait until a proper fix is in place? |
Sounds good @j4321 , looking forward to using the updated version in my project and the course I'm teaching. Thanks! |
Hello!
Superb package, thank you so much for making it. I've been testing in Python 3.8 and found a bug when following your example code:
The error is as follows:
After a lot of debugging, I figured out the reason for this.
The problem starts at
dateentry.py:160
as per the stacktrace:Line 160 is the third line ^
This goes on to call an internal
ttk
function, which then has multiple other internal calls.One of the internal calls is to
_format_mapdict
, and receives the keyword arguments passed toself.style.map
:Allegedly that function takes a mapdict and formats it to pass it off to
tk.call
. This is that function's documentation:However, my debugging suggests that in Python3.8, it's actually returning this:
('-expand', '{ a c t i v e s e l e c t e d } g r e y f o c u s { 1 , 2 , 3 , 4 } ')
This causes big problems, naturally.
The solution seems to be to not pass keyword arguments individually, but to pass the dictionary of keyword arguments itself. Then the
_format_mapdict
function will work properly:I can make a PR for this if you agree with this analysis.
The text was updated successfully, but these errors were encountered: