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

[FIX] application: Fix argparse type error #228

Merged

Conversation

ales-erjavec
Copy link
Collaborator

Issue

Ref: biolab/orange3#5927

orange-canvas raises an error with Python <= 3.7 and PyQt5 >= 5.14

...
  File "/root/DATA/orange_env/lib/python3.7/site-packages/orangecanvas/application/application.py", line 190, in argumentParser
    default=default,
  File "/usr/local/python3/lib/python3.7/argparse.py", line 1362, in add_argument
    type_func = self._registry_get('type', action.type, action.type)
  File "/usr/local/python3/lib/python3.7/argparse.py", line 1304, in _registry_get
    return self._registries[registry_name].get(value, default)
TypeError: unhashable type: 'dict'

This is due to https://bugs.python.org/issue16516

Changes

Wrap a dict.get bound method in a function.
Add test configuration that would have caught this.

@codecov-commenter
Copy link

codecov-commenter commented Mar 31, 2022

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.08%. Comparing base (5c6ccbd) to head (d90b29f).
Report is 257 commits behind head on master.

Files with missing lines Patch % Lines
orangecanvas/application/application.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #228      +/-   ##
==========================================
+ Coverage   74.07%   74.08%   +0.01%     
==========================================
  Files          95       95              
  Lines       20310    20312       +2     
==========================================
+ Hits        15044    15049       +5     
+ Misses       5266     5263       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@markotoplak markotoplak merged commit 3616512 into biolab:master Mar 31, 2022
@ales-erjavec ales-erjavec deleted the fixes/argparse-unhashable-type branch January 10, 2023 12:45
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.

3 participants