Manuel Jacob <me@manueljacob.de> [Wed, 01 Jun 2022 02:21:41 +0200] rev 49319
py3: catch specific OSError subclasses instead of checking errno
On Python 3, the "not a directory" error is mapped to ENOTDIR instead of
EINVAL. Therefore, catching the NotADirectoryError subclass is sufficient.
Manuel Jacob <me@manueljacob.de> [Wed, 01 Jun 2022 00:47:25 +0200] rev 49318
py3: catch specific OSError subclasses instead of checking errno
Contrary to the previous changesets in this series, this covers cases where
errno was checked for multiple values.
EACCES -> PermissionError
ENOENT -> FileNotFoundError
ENOTDIR -> NotADirectoryError
EISDIR -> IsADirectoryError
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 23:45:33 +0200] rev 49317
py3: catch ProcessLookupError instead of checking errno == ESRCH
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 23:41:15 +0200] rev 49316
py3: catch PermissionError instead of checking errno == EPERM
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 23:38:51 +0200] rev 49315
py3: catch PermissionError instead of checking errno == EACCES
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 22:50:01 +0200] rev 49314
py3: catch FileNotFoundError instead of checking errno == ENOENT
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 21:16:17 +0200] rev 49313
py3: catch FileExistsError instead of checking errno == EEXIST
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 16:54:58 +0200] rev 49312
py3: catch BrokenPipeError instead of checking errno == EPIPE
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 04:18:22 +0200] rev 49311
py3: catch ChildProcessError instead of checking errno == ECHILD
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 04:11:34 +0200] rev 49310
py3: remove retry on EINTR errno
Since the implementation of PEP 475 (Python 3.5), Python retries system calls
failing with EINTR. Therefore we don’t need the logic that retries it in Python
code.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 03:39:42 +0200] rev 49309
py3: stop catching TypeError that was raised on Python 2
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 03:06:05 +0200] rev 49308
py3: use `x.hex()` instead of `pycompat.sysstr(node.hex(x))`
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:47:22 +0200] rev 49307
tests: assume that `raw` attribute is present on original socket file object
It seems like the original socket file object is always an io.BufferedIO
instance. If not, the code will fail and we should try harder to get the socket
object (e.g. if the original socket file object is unbuffered, we can get the
`_sock` attribute directly from it).
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:36:05 +0200] rev 49306
tests: constant-fold a `pycompat.ispy3` in testlib/badserverext.py
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:19:07 +0200] rev 49305
tests: remove Python 2 special cases in test-stdio.py
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:43:21 +0200] rev 49304
py3: remove dead code to make file descriptors non-inheritable
On Python 3, file descriptors are already non-inheritable by default.
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:53:01 +0200] rev 49303
py3: remove hack that removed flush argument from print() calls on Python 2
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 16:12:27 +0200] rev 49302
py3: remove long() compatibility code
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 02:04:24 +0200] rev 49301
zeroconf: constant-fold a `pycompat.ispy3`
I’ve checked that both bytes and str gets passed as the `name` parameter, so
the rest of the condition is still required. Because there aren’t really any
tests for the extensions, I didn’t want to refactor it to pass a single type.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 01:23:19 +0200] rev 49300
py3: remove conditional to import collections.abc.MutableMapping
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 16:24:44 +0200] rev 49299
py3: remove dead code to open file with O_CLOEXEC on Python 2
The O_CLOEXEC flag is passed by default on Python 3.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 01:16:41 +0200] rev 49298
py3: don’t encode node.bin() argument
It accepts str and bytes.
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 01:06:29 +0200] rev 49297
convert: inline Python 3 variant of url2pathname_like_subversion()
Manuel Jacob <me@manueljacob.de> [Tue, 31 May 2022 00:50:29 +0200] rev 49296
py3: constant-fold some `pycompat.ispy3`
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:38:01 +0200] rev 49295
py3: use `zip()` instead of trying to use `itertools.izip()`
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:33:39 +0200] rev 49294
py3: replace mention of “xrange” in docstring by “range”
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:32:43 +0200] rev 49293
py3: remove xrange() compatibility code
Some code used its own xrange() compatibility code instead of
pycompat.xrange().
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 15:17:27 +0200] rev 49292
py3: replace `pycompat.xrange` by `range`
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 12:38:54 +0200] rev 49291
hgweb: remove dead code handling UnicodeDecodeError
I’m quite confident that the error can’t happen on Python 3, as the main
motivation for separating bytes and str in Python 3 was to avoid this class of
errors.
Manuel Jacob <me@manueljacob.de> [Sun, 29 May 2022 12:28:31 +0200] rev 49290
cleanup: remove import of already imported module