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

Minimal changes to allow running on Py3K #14

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from

Conversation

scottkmaxwell
Copy link

Change all has_key() to "key in container" form
Catch exception from gettype() in HTTPMessage and try get_content_type since this object completely changed in Py3K
Change print to a function
Fix pickle import so it works on Py2 and Py3
Import httplib or http.client for required exception classes
Change pickle files to binary
Use temp file.TemporaryFile instead of os.tmpfile on Py3K

cakebread and others added 16 commits February 5, 2012 22:04
Merge patch from https://bitbucket.org/dbinit/yolk/
that modifies urllib2.addinfourl to add getheader() method
needed to avoid AttributeError in xmlrpclib
Classes should inherit from object
Change all has_key() to "key in container" form
Catch exception from gettype() in HTTPMessage and try get_content_type since this object completely changed in Py3K
Change print to a function
Fix pickle import so it works on Py2 and Py3
Import httplib or http.client for required exception classes
Change pickle files to binary
Use temp file.TemporaryFile instead of os.tmpfile on Py3K
@airstrike
Copy link

As per the changes listed in the 3.1+ docs under Library Changes[0], I believe the code should be:

    import pickle

rather than

    import cPickle as pickle

[0] http://docs.python.org/3.3/whatsnew/3.0.html#library-changes

@scottkmaxwell
Copy link
Author

Updated to support Python 3.4

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.

4 participants