Issue #12 new

Needs python3 support (has been done already)

Christopher Welborn
created an issue

I wish this project had Python 3 support.

I actually modified django-wsgiserver to work with Python3. It's not something that I want to actively develop or support. It was really just a way for me to enjoy django-wsgiserver using the python version I love. Anyway, it was mostly changes like except Exception, e: to except Exception as e:, a couple small bytes/str issues, a small fix to BlockIteratorResponse.__iter__, and a small fix to a raise statement in WSGIGateway.start_response. Overall, it wasn't that painful.

There is 1 thing that would definitely break compatibility with Python 2, and that is the raise statement in WSGIGateway.start_response that I spoke of before. But it's only because BaseException.with_traceback is not available. I think it could be worked around.

Django and CherryPy are Python 3 compatible now, so I think it would be nice if some of the plugins/extensions/apps started moving towards that too. If you are looking for a use-case, I can only say that I personally would use it instead of a lot of the other options that are out there. Through all of my searching, this was the only "CherryPy Server with Django App" solution that properly handles static files out of the box.

My changes are available here on BitBucket at https://bitbucket.org/cjwelborn/django-wsgiserver3 . I don't think you would want to just merge them in, because of all the formatting I did to the code. But I wanted you to know that I'm not just throwing wild ideas out there, and that it can be (and has been) done. I must admit that I haven't fully tested every feature of my fork, but it does work for my little project and serves up the static files found in my app directories.

Comments (1)

  1. cleemesser repo owner

    thank you. python 3 is definitely a goal and your fork with changes is a major contribution. I've read about the different strategies people are using to maintain dual version codebases. I will look at your fork.

  2. Log in to comment