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
/home/nvidia/passengerai/device/.venv/python-3.6.9/lib/python3.6/tempfile.py:735: in TemporaryFile
fd = _os.open(dir, flags2, 0o600)
fs.create_dir("/dir")
> tempfile.TemporaryFile(dir="/dir")
/home/nvidia/passengerai/device/tests/unit/media_streaming/storage_management/test_pyfakefs.py:11:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/nvidia/passengerai/device/.venv/python-3.6.9/lib/python3.6/tempfile.py:735: in TemporaryFile
fd = _os.open(dir, flags2, 0o600)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pyfakefs.fake_filesystem.FakeOsModule object at 0x7f7e8a0eb8>, path = '/dir'
flags = 4243586, mode = 384, dir_fd = None
def open(self, path, flags, mode=None, dir_fd=None):
"""Return the file descriptor for a FakeFile.
Args:
path: the path to the file
flags: low-level bits to indicate io operation
mode: bits to define default permissions
Note: only basic modes are supported, OS-specific modes are
ignored
dir_fd: If not `None`, the file descriptor of a directory,
with `file_path` being relative to this directory.
New in Python 3.3.
Returns:
A file descriptor.
Raises:
IOError: if the path cannot be found
ValueError: if invalid mode is given
NotImplementedError: if `os.O_EXCL` is used without `os.O_CREAT`
"""
path = self._path_with_dir_fd(path, self.open, dir_fd)
if mode is None:
if self.filesystem.is_windows_fs:
mode = 0o666
else:
mode = 0o777 & ~self._umask()
open_modes = _OpenModes(
must_exist=not flags & os.O_CREAT,
can_read=not flags & os.O_WRONLY,
can_write=flags & (os.O_RDWR | os.O_WRONLY),
truncate=flags & os.O_TRUNC,
append=flags & os.O_APPEND,
must_not_exist=flags & os.O_EXCL
)
if open_modes.must_not_exist and open_modes.must_exist:
raise NotImplementedError(
> 'O_EXCL without O_CREAT mode is not supported')
E NotImplementedError: O_EXCL without O_CREAT mode is not supported
/home/nvidia/passengerai/device/.venv/python-3.6.9/lib/python3.6/site-packages/pyfakefs/fake_filesystem.py:3739: NotImplementedError
=================================== 2 failed, 1 passed in 2.63s ===================================
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 3.7.1
This also happens on pyfakefs 4.0 from the master branch.
The text was updated successfully, but these errors were encountered:
vtsatskin
changed the title
tempfile.TemporaryFile does not work on Linux
tempfile.TemporaryFile does not work on Linux with a fake filesystem
Jan 10, 2020
Describe the bug
When invoking
tempfile.TemporaryFile
on a fake filesystem under Linux, aNotImplementedError
is raised. This does not occur on macOS.How To Reproduce
Both of the following tests fail:
With the following truncated output:
Your enviroment
This also happens on pyfakefs 4.0 from the master branch.
The text was updated successfully, but these errors were encountered: