`os.mkfifo` is not supported
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia in fake_os.py, in FakeOsModule, e confronta la gestione esistente di os.pipe(). Determina se mkfifo debba creare soltanto una voce nel filesystem oppure utilizzare un oggetto FakeFIFO con comportamenti distinti per apertura, lettura e scrittura; il lavoro è completato quando os.mkfifo è supportato solo su Unix senza creare una FIFO reale, incluse le opzioni e gli errori documentati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
No implementation for os.mkfifo() (Unix only).
Describe the solution you'd like
Add implementation so that real FIFOs don't get created in the filesystem.
Describe alternatives you've considered
Currently requires additional mocking.
Need to add something like the following to FakeOsModule in fake_os.py:
def mkfifo(
self,
path: AnyStr,
mode: int = PERM_DEF_FILE,
*,
dir_fd: Optional[int] = None,
) -> None:
"""Create a FIFO (a named pipe) named 'path'.
Args:
path: (str) Name of the file to create.
mode: (int) Permissions to use and type of file to be created.
Default permissions are 0o666. The umask is applied to this
mode.
dir_fd: If not `None`, the file descriptor of a directory,
with `path` being relative to this directory.
Raises:
OSError: If called with unsupported options or the file can not be
created.
"""
if self.filesystem.is_windows_fs:
raise AttributeError("module 'os' has no attribute 'mkfifo'")
path = self._path_with_dir_fd(path, self.mkfifo, dir_fd)
head, tail = self.path.split(path)
if not tail:
if self.filesystem.exists(head, check_link=True):
self.filesystem.raise_os_error(errno.EEXIST, path)
self.filesystem.raise_os_error(errno.ENOENT, path)
if tail in (matching_string(tail, "."), matching_string(tail, "..")):
self.filesystem.raise_os_error(errno.ENOENT, path)
if self.filesystem.exists(path, check_link=True):
self.filesystem.raise_os_error(errno.EEXIST, path)
self.filesystem.add_object(
head,
FakeFile(tail, mode & ~self.filesystem.umask, filesystem=self.filesystem),
)
However, in using a regular file object in the example above, this doesn't simulate the semantics of a FIFO. Could also take inspiration from os.pipe(), except os.mkfifo() doesn't actually open fds, it just creates the entry in the filesystem - maybe create a FakeFIFO object in the filesystem which would then presumably need to handle open/read/write differently.
- Lingua principale
- Python
- Stelle
- 756
- Fork
- 111
- Merge medio
- 3g 21h
- PR unite (30g)
- 10
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytest-dev/pyfakefs
-
`patched_packages.py` fail: `AttributeError: module 'django' has no attribute 'conf'`Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
pytest-dev/pyfakefs#1367 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Real Path objects keep a lowercased _str_normcase after a fake filesystem session on Python 3.14Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
pytest-dev/pyfakefs#1359 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
fnmatch.filter and glob don't match uppercase names under Windows simulationForse già presa @sricharanreddycheruku l’ha presa 27 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
pytest-dev/pyfakefs#1345 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
`Path` is replaced with `FakePathlibPathModule` instead of `FakePath` when imported directlyForse già presa @sunxiuguo l’ha presa 19 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
pytest-dev/pyfakefs#1334 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
pytest-dev/pyfakefs#1321 · 4 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di pytest-dev/pyfakefs
Issue simili
-
New InternshipApertanew_internship
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
get_graph warns that the oneway column is missing when no way has a oneway tagForse già presa @HTenkanen l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
cython/cython#8110 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
fix: security 🔐 style: article/section 📝 system: data-mgmt 🗃️ system: security 🔐 system: software 💻
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
uabrc/uabrc.github.io#1267 ·
-
Link Checker ReportApertaBot Type: Bug Type: Documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno