Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-121735: Fix module-adjacent references in zip files #123037

Merged
merged 8 commits into from
Sep 12, 2024

Conversation

jaraco
Copy link
Member

@jaraco jaraco commented Aug 15, 2024

Merge after #123028.

@jaraco jaraco added needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Aug 15, 2024
@jaraco jaraco changed the title Fix module-adjacent references in zip files gh-121735: Fix module-adjacent references in zip files Aug 15, 2024
@jaraco
Copy link
Member Author

jaraco commented Aug 15, 2024

Note that a lot of refactoring happened in the test suite to enable testing this behavior. The history of the refactoring can be found in python/importlib_resources@f77da58...23afc90. These changes were released with importlib_resources 6.4.1.

@jaraco
Copy link
Member Author

jaraco commented Aug 15, 2024

I'm a little apprehensive about the prospect of backporting this to Python 3.12, given the amount of refactoring that had to happen in the tests to make them viable. I may opt to backport the fix but limit the amount of changes backported to the tests, depending on how complicated it turns out to be.

Copy link
Member

@FFY00 FFY00 left a comment

Choose a reason for hiding this comment

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

This looks okay to me.

I don't really have any strong opinion regarding backporting the changes to 3.12. I agree it would be nicer to backport without the large test suite refactoring, but that isn't unreasonable to me if the changes don't end up applying cleanly. Not backporting the test suite changes also increases the possibility for test suite bugs to sneak into the 3.12 branch, as that won't be maintained as closely as the main branch. Additionally, it can also cause conflicts when backporting other fixes, so, eh, I guess I am +0.5 on backporting this PR as a whole.

@Gatsik
Copy link

Gatsik commented Aug 16, 2024

Oh, I was going to open a PR that potentially fixes this issue, but noticed that there's already a PR for that
The one thing that it misses is that it doesn't fix the issue when the importlib library itself is compiled -- in that case inferring caller doesn't work correctly (my attempt to fix it: Gatsik@50c1596)

@jaraco
Copy link
Member Author

jaraco commented Aug 16, 2024

@Gatsik - the implementation provided herein has already been reviewed and released as importlib_resources 6.4.1. It proves the fix and is available.

The one thing that it misses is that it doesn't fix the issue when the importlib library itself is compiled -- in that case inferring caller doesn't work correctly (my attempt to fix it: Gatsik@50c1596)

It's not obvious to me from this fix what the failure mode is. I think I see it now - if the _common module is available as bytecode but has no source, then __file__ may not be valid. I think that issue would affect both zip files and direct disk files. Would you be willing to write up a separate issue, either in this repo or in python/importlib_resources that describes the missed expectation and why it's an important use-case to support? It's certainly something worthy of consideration, but it's also something that can be considered independent of this PR.

@Gatsik
Copy link

Gatsik commented Aug 17, 2024

@jaraco sure! i created an issue #123085

@jaraco jaraco merged commit ba687d9 into python:main Sep 12, 2024
37 checks passed
@miss-islington-app
Copy link

Thanks @jaraco for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 12, 2024
…H-123037)

* pythongh-116608: Apply style and compatibility changes from importlib_metadata.

* pythongh-121735: Ensure module-adjacent resources are loadable from a zipfile.

* pythongh-121735: Allow all modules to be processed by the ZipReader.

* Add blurb

* Remove update-zips script, unneeded.

* Remove unnecessary references to removed static fixtures.

* Remove zipdata fixtures, unused.
(cherry picked from commit ba687d9)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
@miss-islington-app
Copy link

Sorry, @jaraco, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker ba687d9481c04fd160795ff8d8568f5c9f877128 3.12

@bedevere-app
Copy link

bedevere-app bot commented Sep 12, 2024

GH-123986 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 12, 2024
@bedevere-bot
Copy link

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

Hi! The buildbot s390x RHEL9 Refleaks 3.x has failed when building commit ba687d9.

What do you need to do:

  1. Don't panic.
  2. Check the 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/#/builders/1589/builds/145) and take a look at the build logs.
  4. Check if the failure is related to this commit (ba687d9) 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/#/builders/1589/builds/145

Failed tests:

  • test_importlib

Failed subtests:

  • test_open_text - test.test_importlib.resources.test_functional.FunctionalAPITest_StringAnchor.test_open_text
  • test_read_text - test.test_importlib.resources.test_functional.FunctionalAPITest_StringAnchor.test_read_text
  • test_read_text - test.test_importlib.resources.test_functional.FunctionalAPITest_ModuleAnchor.test_read_text
  • test_open_text - test.test_importlib.resources.test_functional.FunctionalAPITest_ModuleAnchor.test_open_text

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 144, in test_open_text
    self.assertEndsWith(  # ignore the BOM
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        f.read(),
        ^^^^^^^^^
    ...<2 lines>...
        ),
        ^^
    )
    ^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 50, in assertEndsWith
    self.assertEqual(string[-len(suffix) :], suffix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.refleak/build/Lib/test/test_importlib/resources/test_read.py", line 46, in test_read_text_with_errors
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        result,
        ^^^^^^^
    ...<2 lines>...
        '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 92, in test_read_text
    self.assertEndsWith(  # ignore the BOM
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        resources.read_text(
        ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        ),
        ^^
    )
    ^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 50, in assertEndsWith
    self.assertEqual(string[-len(suffix) :], suffix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.refleak/build/Lib/test/test_importlib/resources/test_open.py", line 49, in test_open_text_with_errors
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        result,
        ^^^^^^^
    ...<2 lines>...
        '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �

@bedevere-bot
Copy link

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

Hi! The buildbot s390x RHEL8 Refleaks 3.x has failed when building commit ba687d9.

What do you need to do:

  1. Don't panic.
  2. Check the 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/#/builders/75/builds/1345) and take a look at the build logs.
  4. Check if the failure is related to this commit (ba687d9) 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/#/builders/75/builds/1345

Failed tests:

  • test_importlib

Failed subtests:

  • test_open_text - test.test_importlib.resources.test_functional.FunctionalAPITest_StringAnchor.test_open_text
  • test_read_text - test.test_importlib.resources.test_functional.FunctionalAPITest_StringAnchor.test_read_text
  • test_read_text - test.test_importlib.resources.test_functional.FunctionalAPITest_ModuleAnchor.test_read_text
  • test_open_text - test.test_importlib.resources.test_functional.FunctionalAPITest_ModuleAnchor.test_open_text

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/test_importlib/resources/test_open.py", line 49, in test_open_text_with_errors
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        result,
        ^^^^^^^
    ...<2 lines>...
        '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 92, in test_read_text
    self.assertEndsWith(  # ignore the BOM
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        resources.read_text(
        ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        ),
        ^^
    )
    ^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 50, in assertEndsWith
    self.assertEqual(string[-len(suffix) :], suffix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 144, in test_open_text
    self.assertEndsWith(  # ignore the BOM
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        f.read(),
        ^^^^^^^^^
    ...<2 lines>...
        ),
        ^^
    )
    ^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 50, in assertEndsWith
    self.assertEqual(string[-len(suffix) :], suffix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-rhel8-z.refleak/build/Lib/test/test_importlib/resources/test_read.py", line 46, in test_read_text_with_errors
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        result,
        ^^^^^^^
    ...<2 lines>...
        '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �

@bedevere-bot
Copy link

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

Hi! The buildbot s390x Fedora Refleaks 3.x has failed when building commit ba687d9.

What do you need to do:

  1. Don't panic.
  2. Check the 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/#/builders/433/builds/1320) and take a look at the build logs.
  4. Check if the failure is related to this commit (ba687d9) 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/#/builders/433/builds/1320

Failed tests:

  • test_importlib

Failed subtests:

  • test_open_text - test.test_importlib.resources.test_functional.FunctionalAPITest_StringAnchor.test_open_text
  • test_read_text - test.test_importlib.resources.test_functional.FunctionalAPITest_StringAnchor.test_read_text
  • test_read_text - test.test_importlib.resources.test_functional.FunctionalAPITest_ModuleAnchor.test_read_text
  • test_open_text - test.test_importlib.resources.test_functional.FunctionalAPITest_ModuleAnchor.test_open_text

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.refleak/build/Lib/test/test_importlib/resources/test_read.py", line 46, in test_read_text_with_errors
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        result,
        ^^^^^^^
    ...<2 lines>...
        '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.refleak/build/Lib/test/test_importlib/resources/test_open.py", line 49, in test_open_text_with_errors
    self.assertEqual(
    ~~~~~~~~~~~~~~~~^
        result,
        ^^^^^^^
    ...<2 lines>...
        '\x00w\x00o\x00r\x00l\x00d\x00!\x00\n\x00',
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 92, in test_read_text
    self.assertEndsWith(  # ignore the BOM
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        resources.read_text(
        ^^^^^^^^^^^^^^^^^^^^
    ...<6 lines>...
        ),
        ^^
    )
    ^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 50, in assertEndsWith
    self.assertEqual(string[-len(suffix) :], suffix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �


Traceback (most recent call last):
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 144, in test_open_text
    self.assertEndsWith(  # ignore the BOM
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
        f.read(),
        ^^^^^^^^^
    ...<2 lines>...
        ),
        ^^
    )
    ^
  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.refleak/build/Lib/test/test_importlib/resources/test_functional.py", line 50, in assertEndsWith
    self.assertEqual(string[-len(suffix) :], suffix)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: '\x00H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\[61 chars]00\n' != 'H\x00e\x00l\x00l\x00o\x00,\x00 \x00U\x00T[61 chars]\x00'
- �H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
? -
+ H�e�l�l�o�,� �U�T�F�-�1�6� �w�o�r�l�d�!�
- 
+ �

@bedevere-bot
Copy link

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

Hi! The buildbot PPC64LE RHEL8 Refleaks 3.x has failed when building commit ba687d9.

What do you need to do:

  1. Don't panic.
  2. Check the 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/#/builders/384/builds/1280) and take a look at the build logs.
  4. Check if the failure is related to this commit (ba687d9) 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/#/builders/384/builds/1280

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

Click to see traceback logs
remote: Enumerating objects: 27, done.        
remote: Counting objects:   4% (1/24)        
remote: Counting objects:   8% (2/24)        
remote: Counting objects:  12% (3/24)        
remote: Counting objects:  16% (4/24)        
remote: Counting objects:  20% (5/24)        
remote: Counting objects:  25% (6/24)        
remote: Counting objects:  29% (7/24)        
remote: Counting objects:  33% (8/24)        
remote: Counting objects:  37% (9/24)        
remote: Counting objects:  41% (10/24)        
remote: Counting objects:  45% (11/24)        
remote: Counting objects:  50% (12/24)        
remote: Counting objects:  54% (13/24)        
remote: Counting objects:  58% (14/24)        
remote: Counting objects:  62% (15/24)        
remote: Counting objects:  66% (16/24)        
remote: Counting objects:  70% (17/24)        
remote: Counting objects:  75% (18/24)        
remote: Counting objects:  79% (19/24)        
remote: Counting objects:  83% (20/24)        
remote: Counting objects:  87% (21/24)        
remote: Counting objects:  91% (22/24)        
remote: Counting objects:  95% (23/24)        
remote: Counting objects: 100% (24/24)        
remote: Counting objects: 100% (24/24), done.        
remote: Compressing objects:   8% (1/12)        
remote: Compressing objects:  16% (2/12)        
remote: Compressing objects:  25% (3/12)        
remote: Compressing objects:  33% (4/12)        
remote: Compressing objects:  41% (5/12)        
remote: Compressing objects:  50% (6/12)        
remote: Compressing objects:  58% (7/12)        
remote: Compressing objects:  66% (8/12)        
remote: Compressing objects:  75% (9/12)        
remote: Compressing objects:  83% (10/12)        
remote: Compressing objects:  91% (11/12)        
remote: Compressing objects: 100% (12/12)        
remote: Compressing objects: 100% (12/12), done.        
remote: Total 27 (delta 12), reused 12 (delta 12), pack-reused 3 (from 1)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to 'ba687d9481c04fd160795ff8d8568f5c9f877128'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ba687d9481c gh-121735: Fix module-adjacent references in zip files (#123037)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)

make: *** [Makefile:2305: buildbottest] Terminated

@jaraco jaraco deleted the gh-121735/zip-module-resources branch September 12, 2024 14:15
jaraco added a commit to jaraco/cpython that referenced this pull request Sep 12, 2024
…ythonGH-123037)

* pythongh-116608: Apply style and compatibility changes from importlib_metadata.

* pythongh-121735: Ensure module-adjacent resources are loadable from a zipfile.

* pythongh-121735: Allow all modules to be processed by the ZipReader.

* Add blurb

* Remove update-zips script, unneeded.

* Remove unnecessary references to removed static fixtures.

* Remove zipdata fixtures, unused.
(cherry picked from commit ba687d9)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
@jaraco
Copy link
Member Author

jaraco commented Sep 12, 2024

In jaraco/cpython@330cfcdae71, I've started work on a backport, but it's really broken. I got stuck when MultiplexedPath doesn't have support for zip files. That was added to Python 3.13 only in #106531. Since that wasn't backported (and shouldn't have been), it won't be possible to backport these tests.

jaraco added a commit to jaraco/cpython that referenced this pull request Sep 12, 2024
…ythonGH-123037)

* pythongh-116608: Apply style and compatibility changes from importlib_metadata.

* pythongh-121735: Ensure module-adjacent resources are loadable from a zipfile.

* pythongh-121735: Allow all modules to be processed by the ZipReader.

* Add blurb

* Remove update-zips script, unneeded.

* Remove unnecessary references to removed static fixtures.

* Remove zipdata fixtures, unused.
(cherry picked from commit ba687d9)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
@vstinner
Copy link
Member

@jaraco: Tests fail on Big Endian machines, look at previous buildbot messages.

cc @encukou

@jaraco
Copy link
Member Author

jaraco commented Sep 12, 2024

@jaraco: Tests fail on Big Endian machines, look at previous buildbot messages.

See #123994 (should be fixed now)

@bedevere-app
Copy link

bedevere-app bot commented Sep 12, 2024

GH-124011 is a backport of this pull request to the 3.12 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants