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

Consistent IO with Python 2 and Python 3 #46

Closed
ogrisel opened this issue Apr 24, 2015 · 2 comments
Closed

Consistent IO with Python 2 and Python 3 #46

ogrisel opened this issue Apr 24, 2015 · 2 comments

Comments

@ogrisel
Copy link

ogrisel commented Apr 24, 2015

It seems that it's not possible to save a file when rodeo is run with Python 3.4 at the moment:

Traceback (most recent call last):
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/Users/ogrisel/venvs/py34/lib/python3.4/site-packages/rodeo/rodeo.py", line 60, in save_file
    f.write(request.form['source'])
TypeError: 'str' does not support the buffer interface

To make the code behave consistently under both Python 2 and Python 3, it would be neat to be able to use the http://python-future.org:

http://python-future.org/compatible_idioms.html#strings-and-bytes
http://python-future.org/what_else.html#open

WDYT? Would you accept pull request that would make the future package a dependency for the rodeo project?

@glamp
Copy link
Contributor

glamp commented Apr 24, 2015

blast. my bad on this one. i haven't done much testing w/ python3 yet apart from the "will it install" test.

WDYT? Would you accept pull request that would make the future package a dependency for the rodeo project?

absolutely! that would be awesome.

@stonebig
Copy link
Contributor

stonebig commented May 7, 2015

isn't this issue corrected now, shouldn't it be closed ?

@glamp glamp closed this as completed May 7, 2015
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

3 participants