-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix for #5647 #5648
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
Fix for #5647 #5648
Conversation
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.
| path, base = os.path.split(path) | ||
| return (base, db, os.path.splitext(table_file)[0]) | ||
|
|
||
| is_fileobj = type(options["in_file"]) is file |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
|
This look good @larkost ? |
|
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! |
|
@NeilHanlon never mind, I just confirmed internally that you have signed it, so merging now! |
|
@larkost Could you also cherry-pick this into |
|
Cherry-picked into v2.3.x as e6e6b2b. |
|
please release this 👍 |
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. 😨