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
Python exception IOError : Bad file descriptor under Windows #313
Comments
|
@kevinushey Could you take a look at this? Perhaps a windows-specific issue? |
|
Looks like this is indeed an issue with Python 2.7; for some reason only manifesting on Windows. From https://stackoverflow.com/questions/4230855/why-am-i-getting-ioerror-9-bad-file-descriptor-error-while-making-print-st:
What confuses me is that Lines 3 to 10 in 8b5d928
However, this doesn't happen as Python initialize its reticulate/inst/python/rpytools/output.py Lines 57 to 61 in 8b5d928
@jjallaire, it seems like the easiest fix here would be to unconditionally re-wire the stdout and stderr streams on Windows when Python 2.7 is being used. What do you think? |
|
Yeah, I think we could do that. The reason I'm keeping it carefully scoped now is that I don't know if the remapping leads to other side effects and I want to limit it's impact in the case that it does. However, it seems like we definitely need it here. I'll merge your PR (could you add a NEWS item for it?) |
|
I've just tested latest GitHub commit : under Windows & Python 2.7, reticulate works now like a charm. Thx for the fix ... and long life to reticulate ! ... :-) |
Hi,
With latest 1.9 CRAN or 1.9.0.9001 Github version of reticulate, every time repl_python() is used (manually via R Console, or automatically via RStudio (run selection)), reticulate package throw the following Python exception :
Normally Bad file descriptor is thrown when trying to read / write on an manually closed file object.
Under Linux, is ok, there is no error.
``
Small bug, but rather annoying.
Thx, in advance.
Cyril.
Here is my environment :
And :
Note : perhaps this is related to this previously fixed bug :
rstudio/keras#33 (comment)
The text was updated successfully, but these errors were encountered: