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 support #177

Closed
kobzar opened this issue Sep 28, 2016 · 5 comments
Closed

Python 3 support #177

kobzar opened this issue Sep 28, 2016 · 5 comments

Comments

@kobzar
Copy link

kobzar commented Sep 28, 2016

No description provided.

@kobzar
Copy link
Author

kobzar commented Sep 28, 2016

Have a lot of errors on python3.4 with str & byte convert.
Example, when i try used Frame() or feedback_server.items() a was error

"TypeError: Can't convert 'bytes' object to str implicitly"

For second trouble i fixed it simply:
apns.py

  def items(self):
        """
        A generator that yields (token_hex, fail_time) pairs retrieved from
        the APNs feedback server
        """
        buff = b'' #changed buff = '' to buff = b''

But cant fixed the same for Frame()

@kobzar
Copy link
Author

kobzar commented Oct 11, 2016

Just change '/xx' to b'/xx'
And all working now.

@jd20
Copy link

jd20 commented Mar 3, 2017

Another Python 3 compatibility issue (tested with 3.6.0):

  File "/.../lib/python3.6/site-packages/apns.py", line 218
    except ssl.SSLError, err:
                       ^
SyntaxError: invalid syntax

Also, not sure what version of Python 3 is supported, might be good to add that somewhere to the README.md.

@djacobs
Copy link
Owner

djacobs commented Mar 7, 2017

This is something that is in mind, but I don't have time to follow-up right now.

@ExplodingCabbage
Copy link
Collaborator

@jd20 the code you're quoting doesn't exist any more on the master branch, but the version of the library on PyPi is out of date (see #163). The master version from GitHub should be usable on Python 3.

@kobzar kobzar closed this as completed Jul 26, 2017
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

4 participants