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

Python3 compatibility fixes #3

Merged
merged 1 commit into from
Dec 18, 2016

Conversation

IlyaSemenov
Copy link
Contributor

The latest version didn't work in Python 3.5 due to JSON loading errors:

ERROR: test_status_handled (tests.test_webpack_manifest.TestBundles)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/semenov/work/github/patches/python-webpack-manifest/tests/test_webpack_manifest.py", line 69, in test_status_handled
    static_url='/static',
  File "/Users/semenov/work/github/patches/python-webpack-manifest/webpack_manifest/webpack_manifest.py", line 108, in load
    manifest = build(path, static_url, debug, timeout, read_retry)
  File "/Users/semenov/work/github/patches/python-webpack-manifest/webpack_manifest/webpack_manifest.py", line 119, in build
    data = read(path, read_retry)
  File "/Users/semenov/work/github/patches/python-webpack-manifest/webpack_manifest/webpack_manifest.py", line 198, in read
    return json.loads(content)
  File "/Users/semenov/.pyenv/versions/3.5.2/lib/python3.5/json/__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

Also, all the exception tests were broken in Python3 since Exception.message attribute was removed.

The PR fixes both problems. Tested in 2.7.12 and 3.5.2.

@markfinger
Copy link
Owner

Cool. Thanks, @IlyaSemenov!

I'll merge your changes and push a new release to PyPI this weekend.

@markfinger markfinger merged commit 367e331 into markfinger:master Dec 18, 2016
@markfinger
Copy link
Owner

Thanks again, @IlyaSemenov. I've published your changes as 1.1.0

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.

2 participants