Known issues.

[Imported from Trac: page Python3, version 11]
itamarst 2020-07-22 14:26:50 +00:00
parent 2430240827
commit c44165e48d

@ -81,6 +81,17 @@ In particular:
**Fifth**, add a note to the module docstring saying it was ported to Python 3. **Fifth**, add a note to the module docstring saying it was ported to Python 3.
### Other notes ## Known issues with `future`
The `from builtins import <every builtin ever>` thing gives a decent Python 3 layer for Python 2. For example it'll automatically create `*nonzero*` to wrap a `*bool*`.
But there are caveats.
One of them is the `bytes` objects:
1. `builtins.bytes.translate` are `builtins.bytes.maketrans` buggy on [PyPy](PyPy). One way to fix this is with a `if PY2: translate = string.translate else: translate = bytes.translate`.
2. The behavior with `b"%s" % some_bytes_object` works fine if both objects are Future `builtins.bytes`, or both objects are native Python 2 strings/bytes, but not if you combine them. This has caused bugs. One way to fix this is by exposing only native byte strings for now, see e.g. `allmydata.util.base32`.
## Other notes
If you just want to run the tests from the explicitly ported test modules, you can do `python -m allmydata.util._python3`. If you just want to run the tests from the explicitly ported test modules, you can do `python -m allmydata.util._python3`.