-
Notifications
You must be signed in to change notification settings - Fork 142
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 check for python version on sc2json script #179
Conversation
Python3 deprecates encoding option on json.dumps and defaults to UTF8.
This was nonsense. Scripts still errors for me though even with the TypeError. Is the executable delivered with the pip package out of date? |
Python3 deprecates encoding option on json.dumps and defaults to UTF8. The existing try didn't work since the plugin wrapper doesn't call json.dumps until after except statement in line 41.
Can you please provide the stack trace for the TypeError? |
The existing TypeError check doesn't seem to work since the plugin wrapper doesn't invoke json dumps until after the replay is being loaded in line 41 |
The TypeError is thrown on factory.load_replay, not on factory.register_plugin, which is being checked. sc2reader/sc2reader/scripts/sc2json.py Line 41 in 7da58b1
|
Can you please provide the stack trace? |
Traceback (most recent call last): |
args = parser.parse_args() | ||
|
||
factory = sc2reader.factories.SC2Factory() | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change above is good.
The change below is not really required because the try / except block does the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I would leave the original try/except it would throw an AttributeError before the TypeError though if args.encoding doesn't exist
If python3 doesn't support |
Yes, but we should also drop Python 2… #163 (comment) |
You already did a great job clearing out a bunch of Python 2 stuff in this PR #174 Is there more we need to do in the code to drop support, or is it just a config thing? |
@manuelseeger Can you please rebase this pull request or close it? |
parser.add_argument( | ||
"path", | ||
metavar="path", | ||
type=str, | ||
nargs=1, | ||
help="Path to the replay to serialize.", | ||
) | ||
if sys.version_info.major < 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of #174 Python 2 is no longer supported.
Python3 deprecates encoding option on json.dumps and defaults to UTF8.