Skip to content

Conversation

@NeilHanlon
Copy link
Contributor

Fixes #5647

Python 3's sys.stdin is not of type "file" anymore, but rather
_io.TextIOWrapper -- which parses down to just type Class (apparently)

This should fix python3, but also work in python2.

This might be a naive approach, but I don't really see another option. 😨

Python 3's sys.stdin is not of type "file" anymore, but rather
_io.TextIOWrapper -- which parses down to just type Class (apparently)

This should fix python3, but also work in python2.
@NeilHanlon NeilHanlon changed the title Fix #5647 (python 3 restore broken) Fix for #5647 Apr 12, 2016
path, base = os.path.split(path)
return (base, db, os.path.splitext(table_file)[0])

is_fileobj = type(options["in_file"]) is file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this case I think it would be a lot clearer to do this: options["in_file"] is sys.stdin. That does not allow for other open files, but in this case we don't allow for that anyways, and would need some more work to avoid copying the file anyways. Additionally I would rather see this line folded into line 155, as that would make it a more linear read.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good point. I'll make that change!

@larkost larkost self-assigned this Apr 12, 2016
@NeilHanlon
Copy link
Contributor Author

This look good @larkost ?

@larkost
Copy link
Collaborator

larkost commented Apr 15, 2016

Perfect! I don't see a previous contribution from you (easy to get wrong though), so have you signed our CLA? With that I will merge this in. Thanks again!

@larkost larkost merged commit 39a7d41 into rethinkdb:next Apr 15, 2016
@larkost
Copy link
Collaborator

larkost commented Apr 15, 2016

@NeilHanlon never mind, I just confirmed internally that you have signed it, so merging now!

@danielmewes
Copy link
Member

@larkost Could you also cherry-pick this into v2.3.x please?

@danielmewes danielmewes added this to the 2.3.x milestone Apr 19, 2016
@danielmewes danielmewes modified the milestones: 2.3.x, 2.3.1 Apr 20, 2016
danielmewes pushed a commit that referenced this pull request Apr 21, 2016
@danielmewes
Copy link
Member

Cherry-picked into v2.3.x as e6e6b2b.

@snackycracky
Copy link

please release this 👍

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.

Rethinkdb-restore fails in 2.3.0 with Python 3.4

4 participants