Skip to content

Python3 compatibility fixes#3

Merged
markfinger merged 1 commit intomarkfinger:masterfrom
IlyaSemenov:python3_compat
Dec 18, 2016
Merged

Python3 compatibility fixes#3
markfinger merged 1 commit intomarkfinger:masterfrom
IlyaSemenov:python3_compat

Conversation

@IlyaSemenov
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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