test_process_env_2 not portable to non-FHS systems
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- operating-systems, testing-qa
Rechercherichtung
Beginne mit tests/test_process.py und den im Bericht gezeigten Fällen test_process_env_2 und vergleiche die uvloop- und asyncio-Fehler unter GNU Guix. Sorge dafür, dass der Test die ausführbare Datei env findet, ohne sich auf einen festen impliziten PATH zu verlassen, und überprüfe anschließend, dass beide Implementierungen auf Nicht-FHS-Systemen erfolgreich mit leerer Ausgabe und Rückgabecode 0 abgeschlossen werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
- uvloop version: 0.21.0
- Python version: 3.10
- Platform: GNU Guix
This test code:
def test_process_env_2(self):
async def test():
cmd = 'env'
env = {} # empty environment
proc = await asyncio.create_subprocess_exec(
cmd,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, _ = await proc.communicate()
self.assertEqual(out, b'')
self.assertEqual(proc.returncode, 0)
self.loop.run_until_complete(test())
fails like:
=================================== FAILURES ===================================
______________________ Test_UV_Process.test_process_env_2 ______________________
Traceback (most recent call last):
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
yield
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/tmp/guix-build-python-uvloop-0.21.0.drv-0/uvloop-0.21.0/tests/test_process.py", line 67, in test_process_env_2
self.loop.run_until_complete(test())
File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
File "/tmp/guix-build-python-uvloop-0.21.0.drv-0/uvloop-0.21.0/tests/test_process.py", line 57, in test
proc = await asyncio.create_subprocess_exec(
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/subprocess.py", line 218, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "uvloop/loop.pyx", line 2841, in subprocess_exec
File "uvloop/loop.pyx", line 2799, in __subprocess_run
File "uvloop/handles/process.pyx", line 611, in uvloop.loop.UVProcessTransport.new
File "uvloop/dns.pyx", line 112, in uvloop.loop.__convert_pyaddr_to_sockaddr
FileNotFoundError: [Errno 2] No such file or directory
_____________________ Test_AIO_Process.test_process_env_2 ______________________
Traceback (most recent call last):
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
yield
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/unittest/case.py", line 591, in run
self._callTestMethod(testMethod)
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
method()
File "/tmp/guix-build-python-uvloop-0.21.0.drv-0/uvloop-0.21.0/tests/test_process.py", line 67, in test_process_env_2
self.loop.run_until_complete(test())
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
return future.result()
File "/tmp/guix-build-python-uvloop-0.21.0.drv-0/uvloop-0.21.0/tests/test_process.py", line 57, in test
proc = await asyncio.create_subprocess_exec(
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/subprocess.py", line 218, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/base_events.py", line 1667, in subprocess_exec
transport = await self._make_subprocess_transport(
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/unix_events.py", line 207, in _make_subprocess_transport
transp = _UnixSubprocessTransport(self, protocol, args, shell,
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/base_subprocess.py", line 36, in __init__
self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/asyncio/unix_events.py", line 799, in _start
self._proc = subprocess.Popen(
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/subprocess.py", line 969, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/gnu/store/jjcka1g6sk2cvwx8nm4fdwpdq3vll0v0-python-3.10.7/lib/python3.10/subprocess.py", line 1845, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'env'
This is because on non-file-hierarchy-standard systems like GNU Guix and Nix, env is not found at some fixed location burnt on the implicit PATH value; instead it must be looked from PATH, but the tests clears it.
- Vorherrschende Sprache
- Cython
- Sterne
- 11.9k
- Forks
- 615
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus MagicStack/uvloop
-
License not clear Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
MagicStack/uvloop#759 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
MagicStack/uvloop#741 · 2 Reaktionen ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
MagicStack/uvloop#702 · 8 Kommentare · 9 Reaktionen ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
MagicStack/uvloop#766 ·
-
Directly constructed subprocess pipe protocols segfault when callbacks use a non-process owner Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
MagicStack/uvloop#765 ·
Alle Issues in MagicStack/uvloop
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
nextbsd/nextbsd-userland#285 ·
-
bug good first issue os compatibility
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Bug Good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
johnsonjh/emu2-cpm86#61 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100