Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-127146: Mark test_bz2 tests with requires_subprocess#127562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

hoodmane
Copy link
Contributor

@hoodmanehoodmane commentedDec 3, 2024
edited by bedevere-appbot
Loading

@freakboy3742
Copy link
Contributor

This doesn't seem quite right - iOS and Android don't support subprocesses, but have no problem implementing the bz2 tests. How are you seeing this problem manifest?

@hoodmane
Copy link
ContributorAuthor

Traceback (most recent call last):  File "/home/rchatham/cpython/Lib/test/test_bz2.py", line 252, in testWrite    self.assertEqual(ext_decompress(f.read()), self.TEXT)                     ~~~~~~~~~~~~~~^^^^^^^^^^  File "/home/rchatham/cpython/Lib/test/test_bz2.py", line 34, in ext_decompress    return subprocess.check_output(['bunzip2'], input=data)           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/rchatham/cpython/Lib/subprocess.py", line 472, in check_output    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,           ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^               **kwargs).stdout               ^^^^^^^^^  File "/home/rchatham/cpython/Lib/subprocess.py", line 554, in run    with Popen(*popenargs, **kwargs) as process:         ~~~~~^^^^^^^^^^^^^^^^^^^^^^  File "/home/rchatham/cpython/Lib/subprocess.py", line 824, in __init__    raise OSError(        errno.ENOTSUP, f"{sys.platform} does not support processes."    )OSError: [Errno 138] emscripten does not support processes.

@hoodmane
Copy link
ContributorAuthor

Looking atext_decompress:

defext_decompress(data):globalhas_cmdline_bunzip2ifhas_cmdline_bunzip2isNone:has_cmdline_bunzip2=bool(shutil.which('bunzip2'))ifhas_cmdline_bunzip2:returnsubprocess.check_output(['bunzip2'],input=data)else:returnbz2.decompress(data)

Looks like the problem is thatshutil.which('bunzip2') returns something truthy for some reason.

@hoodmane
Copy link
ContributorAuthor

$ ./python.sh -c "import shutil; print(shutil.which('bunzip2'))"/usr/bin/bunzip2

Okay the problem is that innode_entry.mjs I should do one or both of:

  1. not propagate the PATH environment variable or
  2. not mount the /usr directory.

@hoodmane
Copy link
ContributorAuthor

Thanks@freakboy3742!

@hoodmanehoodmane deleted the bz2-tests-requires-subprocess branchDecember 3, 2024 14:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@freakboy3742freakboy3742Awaiting requested review from freakboy3742

Assignees
No one assigned
Labels
awaiting core reviewskip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hoodmane@freakboy3742

[8]ページ先頭

©2009-2025 Movatter.jp