fixes for Python 3 compatibility

#7 Declined
  1. matt chisholm

Here are some fixes that I made to achieve python3 compatibility

Comments (6)

  1. Jason R. Coombs

    Hi Matt. Thanks for the contrib.

    Can you describe in what scenario you're unable to use distribute with Python 3? Distribute has been running on Python 3 basically since it forked from setuptools. It uses the 2to3 tool to automatically do the conversion during the install process. Furthermore, I believe some of the changes you've made may break Python 2.4 compatibility, such as changes to use of exec.

    If you want a distribution that's already converted for Python 3, I suggest the following: Download the source distribution, extract it to a directory, then run 'python3 bdist_egg' in that directory. That will do the conversion and save a .egg in ./dist. You can use the files in that egg directly on Python 3.

    If you have any issues with distribute as converted by 2to3 during install, please don't hesitate to file a ticket.

    Regards, Jason

  2. matt chisholm author

    I'm using to manage my virtualenvs. That installs distribute inside /.venvburrito/lib/python/ and sets $PYTHONPATH to point there. Without these fixes to distribute, Python 3 virtualenvs created with virtualenv-burrito won't even start, because they can't import the (unconverted) distribute package installed there.

    I guess perhaps virutalenv-burrito is doing something wrong here, although I'm not sure how I would go about fixing it.

    1. Jason R. Coombs

      In that case, the next thing I would do is try creating a simple virtualenv (not managed by virtualenvwrapper) and see if that works. If it does, then virtualenvwrapper or virtualenv-burrito is implicated. If it doesn't, then it's probably a bug in virtualenv (though I see from the changelog that Python 3 has been supported since virtualenv 1.6).

      If I can find some time this weekend, I'll try it out myself and see what I get.

  3. Jason R. Coombs

    I've created issue #339 to track the proposal to have a unified code base on Python 2 and 3. I think it's a worthwhile endeavor, but probably lower priority than other efforts. It will probably take more work than is outlined here, but I've referenced this pull request so that we don't waste your effort.

    It occurs to me now that the pull request might be lost if you were to delete your fork. I'll pull the changesets into another branch so that we have them for posterity.

    Thanks again for your efforts.