Always use b
mode when reading and writing pickles (open(f, 'wb')
for writing, open(f, 'rb')
for reading). To “fix” the file you already have, convert its newlines using dos2unix
.
More Related Contents:
- Writing a list to a file with Python
- CSV in Python adding an extra carriage return, on Windows
- Python 32-bit memory limits on 64bit windows
- Writing a list to a file with Python, with newlines
- IOError: [Errno 13] Permission denied when trying to open hidden file in “w” mode
- Is pickle file of python cross-platform?
- What is the difference between rb and r+b modes in file objects [duplicate]
- Is it possible to get writing access to raw devices using python with windows?
- Mixing read() and write() on Python files in Windows
- Python – How to check if a file is used by another application?
- “python” not recognized as a command
- Getting MAC Address
- Which is the easiest way to simulate keyboard and mouse on Python?
- Is there a way to list all the available Windows’ drives?
- fcntl substitute on Windows
- Python Window Activation
- Python command not working in command prompt
- Using Python, how can I access a shared folder on windows network?
- python ctypes issue on different OSes
- How to delete specific strings from a file?
- Replace string within file contents [duplicate]
- tkinter.TclError: image “pyimage3” doesn’t exist
- Batch Renaming of Files in a Directory
- How to write Unix end of line characters in Windows?
- How to solve “OSError: telling position disabled by next() call”
- pyclipper installation error: “tp_print is not a member of _typeobject”
- How to stop Python closing immediately when executed in Microsoft Windows
- How can I read large text files line by line, without loading them into memory? [duplicate]
- Python file operations
- Python: why pickle?