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

Python 3.5.1 AttributeError: 'str' object has no attribute 'decode' #37

Closed
gtors opened this issue Mar 18, 2016 · 3 comments
Closed

Python 3.5.1 AttributeError: 'str' object has no attribute 'decode' #37

gtors opened this issue Mar 18, 2016 · 3 comments

Comments

@gtors
Copy link

gtors commented Mar 18, 2016

This code cause exception:

import url
url.parse('http://example.com')
@b4hand
Copy link
Contributor

b4hand commented Mar 18, 2016

It would be a lot more helpful if you gave the full stack trace in an error report.

I can reproduce this:

$ python
Python 3.5.1 (default, Mar 18 2016, 08:38:49)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import url
>>> url.parse('http://example.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/brandon/.pyenv/versions/3.5.1/lib/python3.5/site-packages/url.py", line 54, in parse
    return URL.parse(url, encoding)
  File "/Users/brandon/.pyenv/versions/3.5.1/lib/python3.5/site-packages/url.py", line 85, in parse
    url.decode(encoding).encode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

@b4hand
Copy link
Contributor

b4hand commented Mar 18, 2016

FWIW, this is a general incompatibility with Python 3, rather than something specific to Python 3.5.1. Currently this package does not support Python 3, but we would accept a pull request that provided such compatibility.

@b4hand
Copy link
Contributor

b4hand commented Mar 18, 2016

Closing as a duplicate of #3.

@b4hand b4hand closed this as completed Mar 18, 2016
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

No branches or pull requests

2 participants