TypeError: tag_configure() got multiple values for keyword argument 'font'
Closed this issue · 3 comments
I apologize in advance, first time posting an issue, so I do not know how to format.
When I download this program using the Thonny Plug-in installer (Including updating dependencies), and then restart my thonny, I can use thonny without the theme just fine. However, if I start up the theme, and then close thonny, when I launch thonny again, I will recieve this error message:
`Traceback (most recent call last):
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1230, in _show_views
self.show_view(view_id, False)
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1382, in show_view
view = self.get_view(view_id)
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1300, in get_view
self
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\assistance.py", line 56, in init
insertwidth=0,
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\tktextext.py", line 774, in init
self.text = text_class(self, **final_text_options)
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\rst_utils.py", line 26, in init
self.configure_tags()
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\assistance.py", line 430, in configure_tags
super().configure_tags()
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\rst_utils.py", line 66, in configure_tags
font=underline_font)
TypeError: tag_configure() got multiple values for keyword argument 'font'
It then follows up with a second internal error that is ~mostly the same`
`Traceback (most recent call last):
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 194, in _try_action
action()
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 2005, in _open_views
self.show_view(view_name)
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1382, in show_view
view = self.get_view(view_id)
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\workbench.py", line 1300, in get_view
self
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\assistance.py", line 56, in init
insertwidth=0,
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\tktextext.py", line 774, in init
self.text = text_class(self, **final_text_options)
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\rst_utils.py", line 26, in init
self.configure_tags()
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\assistance.py", line 430, in configure_tags
super().configure_tags()
File "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\rst_utils.py", line 66, in configure_tags
font=underline_font)
TypeError: tag_configure() got multiple values for keyword argument 'font'
`
Once you get these two errors, you can use thonny just fine up until the moment you attempt to close thonny. At this point, it will hang with a white screen until you force close it with task manager, with seemingly no fix. During this time, the "window" that is thonny is still moveable, stretchable, and minimizable, but it does not close. I tried to step through the code to see if I couldn't source the error and help out but I was overwhelmed.
I have duplicated this error on two other devices running the latest thonny on windows 10. One of these devices is running the default font (I think) and dark theme alongside dracula, the other two are running Yu Gothic font and dark theme alongside dracula. This error has been present for at least 2 months (I first downloaded dracula at the end of very end of august/beginning of september), I just did not have the time to write up the error until now. I can't think of anything else to mention here so if you have any questions, just let me know.
I have since solved the issue (to an extent), and anyone else wanting to use it can just follow this step until we get an official update.
Simply go to your rst_utils, located at "C:\Users\XUSERNAME\AppData\Local\Programs\Thonny\lib\site-packages\thonny\rst_utils.py", and make line 64-66 one line (as in removed the new lines between the code) and then just delete font=underline_font. Then it works. It just works.
Your new line of code will be "self.tag_configure("a", **{**get_syntax_options_for_tag("hyperlink"), 'underline' : False})"
I realized I am not supposed to close this until it gets a full patch. That's my bad.
I'm sorry. For some reason, I never got a notification for this issue and I am seeing this only now. I'll take a look as soon as I can.