praw-dev / praw

PRAW, an acronym for "Python Reddit API Wrapper", is a python package that allows for simple access to Reddit's API.
http://praw.readthedocs.io/
BSD 2-Clause "Simplified" License
3.5k stars 460 forks source link

Import error in python 3.3 #136

Closed bboe closed 12 years ago

bboe commented 12 years ago
Python 3.3.0 (default, Sep 29 2012, 15:50:43)
[GCC 4.7.1 20120721 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import praw
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/.local/lib/python3.3/site-packages/praw/__init__.py", line 24, in <module>
    from praw import decorators, errors, helpers, objects
  File "/home/user/.local/lib/python3.3/site-packages/praw/decorators.py", line 30, in <module>
    from praw.compat import urljoin  # pylint: disable-msg=E0611
  File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1528, in _find_and_load_unlocked
KeyError: 'praw.compat.urljoin'

Source: http://www.reddit.com/r/learnpython/comments/12fuph/error_when_importing_praw_with_python_330/

bboe commented 12 years ago

I now have a fix for the bug. Doing a full test of python 3.3 before releasing.

bboe commented 12 years ago

Fixed in 1086a64357ddc82cf24812f86d4aa709a352553c, version 1.0.14.

I hadn't properly implemented load_module as I didn't insert the module into sys.modules. Somehow it still worked with python2.7 and 3.2 though.