You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When invoking tempfile.TemporaryFile(..., dir=dir) when dir does not exist on a fake filesystem under Linux, a FileNotFoundError is not raised. This does not occur on macOS.
This test fails because FileNotFoundError is not raised. When running the test on macOS, it passes.
Checking the expected behaviour using the real filesystem:
# macOS
Python 3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 03:02:14)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.TemporaryFile(dir="/bogus")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tempfile.py", line 622, in TemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tempfile.py", line 262, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/bogus/tmp9fiv_v7v'
# Linux
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.TemporaryFile(dir="/bogus")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/tempfile.py", line 761, in TemporaryFile
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
File "/usr/lib/python3.6/tempfile.py", line 401, in _mkstemp_inner
fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/bogus/tmpnkiv2m_v'
Your enviroment
Linux-4.9.140-tegra-aarch64-with-Ubuntu-18.04-bionic
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
pyfakefs 4.0
The text was updated successfully, but these errors were encountered:
Describe the bug
When invoking
tempfile.TemporaryFile(..., dir=dir)
whendir
does not exist on a fake filesystem under Linux, aFileNotFoundError
is not raised. This does not occur on macOS.How To Reproduce
This test fails because
FileNotFoundError
is not raised. When running the test on macOS, it passes.Checking the expected behaviour using the real filesystem:
Your enviroment
The text was updated successfully, but these errors were encountered: