- Problem:
plistlib can't read/write binary plists (2.6, 2.7)
- Solution:
pip install biplist
It's a drop-in replacement of py2's plistlib, and it handles XML plists too by calling through to plistlib.
Since biplist requires 3.4 for py3, which is when binary plist support was added to plistlib anyway, it's only useful for 2.6 and 2.7. I haven't tested it on 3.0 to 3.3 though.
- Problem:
os.makedirs doesn't have exist_ok (<3.2)
- Solution: catch the error and ignore it if it's EEXIST. StackOverflow answer
Why not use pathlib2, like the top answer suggests? Because it's not a perfect port and can't handle non-ASCII paths, thanks to the difference in Unicode/string handling between py2 and py3.
- Problem: no
enum (<3.4)
- Solution:
pip install enum34
- Problem: no
os.walk (<2.3)
- Solution: use
os.path.walk
This is useful for PyS60 1.4.5 because that uses Python 2.2. Note that the code needs to be adapted, as os.path.walk uses a callback function.