Sitelet https://github.com/expfactory/expfactory-python/issues/21
Skip to content

Python 3 support #21

Description

@vsoch

Activity

  1. tangi75 commented on Oct 24, 2016

    @tangi75
    Contributor

    Here are the patches I've made to make expfactory-python work on Python 3 (no guarantee of completeness but you can run the tests) :

    cd "python -c 'import site; print(site.getsitepackages()[0])'/expfactory/"
    find . -name "*.py" | xargs sed -i -e 's/iteritems/items/g'
    find . -name "*.py" | xargs sed -i -e 's/print \(.*\)$/print(\1)/'
    find . -name "*.py" | xargs sed -i -e 's/SimpleHTTPServer/http.server/'
    find . -name "*.py" | xargs sed -i -e 's/SocketServer/socketserver/'
    sed -i -e 's/from exceptions import ValueError//' survey.py
    sed -i -e 's/urllib2/urllib.request/' utils.py
    sed -i -e 's/__init__/expfactory.__init__/' utils.py
    sed -i -e '84s/"rb"/"r"/' utils.py
    sed -i -e 's/basestring/str/' utils.py
    sed -i -e '322s/^./ /' survey.py # replace leading tab with 8 spaces

  2. vsoch commented on Oct 24, 2016

    @vsoch
    MemberAuthor

    This is very helpful! If you've made the changes, would you like to do a pull request? If not, we can definitely get this tested soon. Just a heads up - we are going to be going into production of version 2.0 in about a month or so, which will hopefully give you much better tools for deploying these experiments.

  3. vsoch commented on Oct 24, 2016

    @vsoch
    MemberAuthor

    In case you haven't gotten your quota yet :)

  4. tangi75 commented on Oct 25, 2016

    @tangi75
    Contributor

    I just did the minimum hacks to make expfactory work on Python3 without caring about backward compatibility with Python2. I'll try to do a cleaner thing this week and submit a pull request.

  5. self-assigned this
    on Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions