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 compatibility #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChielBruin
Copy link

@ChielBruin ChielBruin commented Feb 8, 2019

The current version of pymtp only works when using Python2. This as the has_key() function of dictionaries is removed in Python3 (see this). Replacing the two occurrences of this construct by in makes the module work* in both Python2 and Python3.

This same fix can also be found in py3mtp [link]

*It compiles and runs, but behaviour is slightly different due to changes in ctypes

`has_key` is removed in Python3, therefore breaking the module in this version.
By updating to `in`, the module can now be used in both Python2 and Python3.
@ChielBruin
Copy link
Author

I also had some troubles packaging the module in its current state on master. Using from .main import * in __init__.py and prefixing the period for the imports in the other files fixed the problems I had.
It seems that the developer of py3mtp had the same issues, as he moved all the code to a single file. This is another solution to combat the same problems I encountered.

@eighthave
Copy link
Owner

Great that you are maintaining pymtp! I haven't touched this since 2013. How about you take over the maintenance? I can give you access to pypi to upload the releases there.

@ChielBruin
Copy link
Author

Sounds good to me

@eighthave
Copy link
Owner

@nick125 what do you think about handing over PyMTP maintenance to @ChielBruin?

@ChielBruin
Copy link
Author

It seems like @nick125 is not very active on GitHub anymore. His last public commit is from a couple years ago.

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