Open MasloMaslane opened 7 months ago
I wonder if we should add tests for this kinda stuff
Ughh, Python for some reason dups file descriptors 0-2, so the tests fail (for example test/src/sum_python3.9.py
)
And when dup
returns EACCES
, python fails with runtime error 1
Looks like Python 3.9 in its infinite wisdom uses dup
to check if an FD is valid.
https://github.com/python/cpython/blob/v3.9.18/Python/pylifecycle.c#L1735-L1765
Looks like they changed it to fcntl in 3.11 and later https://github.com/python/cpython/commit/f87ea0350286837e9e96de03f8bfa215176c2928
But if python 3.9 specifically is used in some contests then we can't drop support for that by forbidding dup....
OIJ and Szkopuł use python3.9, so I guess for now we have to allow mmap
for fd < 3
Now
mmap
is allowed to read only from fd > 2, anddup
isn't allowed to use fd < 3