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

bpo-28494: Test existing zipfile working behavior.#15853

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

Merged
Yhg1s merged 2 commits intopython:masterfromgpshead:new_zipfile_test
Sep 10, 2019

Conversation

gpshead
Copy link
Member

@gpsheadgpshead commentedSep 10, 2019
edited by bedevere-bot
Loading

Adds unittests for executables with a zipfile appended to test_zipfile
as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.

This is being added as a regression test that#5053 would otherwise fail today.

https://bugs.python.org/issue28494

Adds unittests for executables with a zipfile appended to test_zipfileas zipfile.is_zipfile and zipfile.ZipFile work properly on these today.
@gpshead
Copy link
MemberAuthor

duh, fixing the test to skip the execute one on windows :)

@@ -2496,11 +2496,15 @@ def test_read_zip64_with_exe_prepended(self):
self._test_zip_works(self.exe_zip64)

@unittest.skipUnless(sys.executable, 'sys.executable required.')
@unittest.skipUnless(os.access('/bin/bash', os.X_OK),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How about using shutil.which('bash') instead? There are some windows machines with bash installed now... will the test work there?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I didn't think windows supported #! line executables as a concept. executable is based on filename ending in bat/cmd/com/exe, not an execute bit there.

@miss-islington
Copy link
Contributor

Thanks@gpshead for the PR, and@Yhg1s for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-15891 is a backport of this pull request to the3.8 branch.

@gpsheadgpshead deleted the new_zipfile_test branchSeptember 10, 2019 22:23
miss-islington added a commit that referenced this pull requestSep 10, 2019
Add unittests for executables with a zipfile appended to test_zipfile, as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.(cherry picked from commit3f4db4a)Co-authored-by: Gregory P. Smith <greg@krypto.org>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotx86 Gentoo Installed with X 3.8 has failed when building commit74b0291.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/230/builds/317) and take a look at the build logs.
  4. Check if the failure is related to this commit (74b0291) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/230/builds/317

Failed tests:

  • test_zipfile

Failed subtests:

  • test_read_zip64_with_exe_prepended - test.test_zipfile.TestExecutablePrependedZip
  • test_read_zip_with_exe_prepended - test.test_zipfile.TestExecutablePrependedZip
  • test_execute_zip64 - test.test_zipfile.TestExecutablePrependedZip
  • test_execute_zip2 - test.test_zipfile.TestExecutablePrependedZip

Summary of the results of the build (if available):

== Tests result: FAILURE then FAILURE ==

411 tests OK.

1 test failed:
test_zipfile

11 tests skipped:
test_asdl_parser test_clinic test_devpoll test_gdb test_kqueue
test_msilib test_startfile test_winconsoleio test_winreg
test_winsound test_zipfile64

1 re-run test:
test_zipfile

Total duration: 24 min 26 sec

Click to see traceback logs
Traceback (most recent call last):  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/test/test_zipfile.py", line2469, intest_read_zip64_with_exe_prependedself._test_zip_works(self.exe_zip64)  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/test/test_zipfile.py", line2457, in_test_zip_worksself.assertTrue(zipfile.is_zipfile(name),AssertionError:False is not true : is_zipfile failed on ziptestdata/exe_with_z64Traceback (most recent call last):  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/test/test_zipfile.py", line2482, intest_execute_zip64    output= subprocess.check_output([self.exe_zip64, sys.executable])  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line411, incheck_outputreturn run(*popenargs,stdout=PIPE,timeout=timeout,check=True,  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line489, inrunwith Popen(*popenargs,**kwargs)as process:  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line845, in__init__self._execute_child(args, executable, preexec_fn, close_fds,  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line1689, in_execute_childraise child_exception_type(errno_num, err_msg, err_filename)FileNotFoundError:[Errno 2] No such file or directory: 'ziptestdata/exe_with_z64'Traceback (most recent call last):  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/test/test_zipfile.py", line2466, intest_read_zip_with_exe_prependedself._test_zip_works(self.exe_zip)  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/test/test_zipfile.py", line2457, in_test_zip_worksself.assertTrue(zipfile.is_zipfile(name),AssertionError:False is not true : is_zipfile failed on ziptestdata/exe_with_zipTraceback (most recent call last):  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/test/test_zipfile.py", line2475, intest_execute_zip2    output= subprocess.check_output([self.exe_zip, sys.executable])  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line411, incheck_outputreturn run(*popenargs,stdout=PIPE,timeout=timeout,check=True,  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line489, inrunwith Popen(*popenargs,**kwargs)as process:  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line845, in__init__self._execute_child(args, executable, preexec_fn, close_fds,  File"/buildbot/buildarea/cpython/3.8.ware-gentoo-x86.installed/build/target/lib/python3.8/subprocess.py", line1689, in_execute_childraise child_exception_type(errno_num, err_msg, err_filename)FileNotFoundError:[Errno 2] No such file or directory: 'ziptestdata/exe_with_zip'

@Yhg1s
Copy link
Member

Buildbot failure should have been fixed byGH-15902.

websurfer5 pushed a commit to websurfer5/cpython that referenced this pull requestJul 20, 2020
Add unittests for executables with a zipfile appended to test_zipfile, as zipfile.is_zipfile and zipfile.ZipFile work properly on these today.
@thomaswaldmannthomaswaldmannmannequin mentioned this pull requestApr 10, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Yhg1sYhg1sYhg1s left review comments

Assignees

@Yhg1sYhg1s

Labels
skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@gpshead@miss-islington@bedevere-bot@Yhg1s@the-knights-who-say-ni

[8]ページ先頭

©2009-2025 Movatter.jp