You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seems that NamedTemporaryFiles under Windows are opened automatically. This causes issues when codec.open is then used to open the file in the IPython V3 code. I changed the code to use the following method as opposed to codecs_open in the save and get methods.
Am happy to integrate it in if need be.
Thanks for this work.
Regards
Paul
def_codecs_open(self, filename, file_handle, mode='rb', encoding=None, errors='strict', buffering=1):
# Copy of codecs.openifencodingisnotNone:
if'U'inmode:
# No automatic conversion of '\n' is done on reading and writingmode=mode.strip().replace('U', '')
ifmode[:1] notinset('rwa'):
mode='r'+modeif'b'notinmode:
# Force opening of the file in binary modemode=mode+'b'try:
file=open(filename, mode, buffering)
except:
file=file_handleifencodingisNone:
returnfileinfo=codecs.lookup(encoding)
srw=codecs.StreamReaderWriter(file, info.streamreader, info.streamwriter, errors)
# Add attributes to simplify introspectionsrw.encoding=encodingreturnsrw
That seems like strange behavior but https://bugs.python.org/issue14243 and others suggest that some special handling is indeed necessary on windows. Can you please submit a pull request with code that works on windows and we can iterate from there?
Seems that NamedTemporaryFiles under Windows are opened automatically. This causes issues when codec.open is then used to open the file in the IPython V3 code. I changed the code to use the following method as opposed to codecs_open in the save and get methods.
Am happy to integrate it in if need be.
Thanks for this work.
Regards
Paul
Save was changed as follows (get the same)
The text was updated successfully, but these errors were encountered: