summaryrefslogtreecommitdiff
path: root/doc/python3.rst
AgeCommit message (Collapse)Author
2017-10-31[FIX] doc: fix typoFabien Meghazi
2017-09-15[IMP] doc: update P3 compatibility policyOlivier Dony
2017-08-20[FIX] P3: remove pycompat.{keys,items,values} helpersOlivier Dony
Now that we're closer to switching to P3 for good, these helpers have outlived their usefulness, and mostly add noise. All remaining dict.iter*() or dict.view*() must be converted to the normal keys(), values() or items() calls. Whenever the result is likely to be used for more than the scope of a loop, or when the dict needs to be modified during iteration, the calls must be wrapped in a ``list()``, to protect the new P3 semantics. Those cases are very exceptional. Also removed some dead code or improved the API to remove unnecessary conversions.
2017-08-20[FIX] P3: CSV reading & writingXavier Morel
2017-08-20[FIX] P3: fix base64 and StringIO usesXavier Morel
* StringIO removed from stdlib, replace with io * try to correctly handle BytesIO/StringIO (one is for bytes the other is for text) * fix base64: Python 3 removed bytes-encoding and bytes-bytes codecs (via #encode) so replace all calls to str.encode('base64'), also b64encode is a bytes->bytes conversion so attempt to properly handle that issue #8530
2017-07-03[FIX] doc warningsXavier Morel
* add Sphinx 1.6 compatibility (use app.set_translator when available as in that case programmatically setting html_translator_class is broken) * fix a bunch of code block lexers to avoid warnings & get better coloration * add a few options which were referred to without being actually defined * fix some rST formatting
2017-06-12[ADD] P3: hash randomisation docsXavier Morel
2017-05-15[FIX] P3: document stdlib changesXavier Morel
Also lint away verboten stdlib modules.
2017-05-10[FIX] P3: list -> iterable builtins (#16811)xmo-odoo
In Python 3: * various builtins and dict methods were changed to return view/iterable objects rather than lists * and the separate Python 2 view/iterable builtins and methods were removed altogether This is problematic when using these items as list (which the happens repeatedly in Odoo), but more viciously when iterating *multiple times* over them (which also happens, which I've messed up multiple times while writing this, and which is a pain to debug even when you've just created the issue). Convert all code using these to semantics-matching cross-version helper functions to get the LCD behaviour between P2 and P3, and forbid the builtins via lint. issue #8530
2017-04-28[FIX] Various P3-related import changesxmo-odoo
* LDAP import: python-ldap is not python3-compatible, pyldap is Warning: only supported from debian Stretch (current testing)? https://packages.debian.org/search?searchon=names&keywords=pyldap * implicitly relative imports * imports of moved or removed stdlib modules issue #8530
2017-04-27[FIX] builtins removed from Python 3xmo-odoo
* Reverse wrapper courtesy of @rco-odoo's original P3 branch * thin compat module stripped down from werkzeug (to augment as needed) issue 8530
2017-04-12[#8530] fix uses of ``reduce`` builtinXavier Morel
Demoted to library in Python 3, see if uses can be replaced by more specific construct, just import functools.reduce otherwise. Futurize fixers: * lib2to3.fixes.fix_reduce
2017-04-11[#8530] fix octal literals (and remove unwittingly octals)Xavier Morel
For readability and coherence, in Python 3 the prefix for octal literal becomes ``0o`` (rather than just ``0``). This new version was also added to Python 2 as of 2.6. Convert all octal literals in file-manipulation code (POSIX ACL), and fix a few integers which were unwittingly octal. (lib2to3.fixes.fix_numliterals)
2017-04-11[#8530] convert dict.has_keyXavier Morel
Redundant with `in` and removed from Python 3. Removed odd, old and long-unused UpdatableDict (which defines and uses has_key) and UpdatableStr (which was nearby and caught in the blast), validated with al. (lib2to3.fixes.fix_has_key)
2017-04-11[#8530] convert deprecated operatorsXavier Morel
* `<>` was removed and should be replaced by `!=` (lib2to3.fixes.fix_ne) * `\`` was removed and should be replaced by either `repr()` or the `%r` format string modifier (lib2to3.fixes.fix_repr followed by hand-rolled edition to replace concatenation)
2017-04-11[#8530] convert exception handlers to except..as syntaxXavier Morel
Futurize fixers: * lib2to3.fixes.fix_except