Skip to content

gh-156568: Make zipapp archives executable with PathLike targets - #156569

Merged
pfmoore merged 4 commits into
python:mainfrom
eoan-ermine-forks:gh-156568
Oct 14, 2026
Merged

pfmoore merged 4 commits into
python:mainfrom
eoan-ermine-forks:gh-156568

Conversation

@eoan-ermine

@eoan-ermine eoan-ermine commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Fix zipapp.create_archive() not setting the executable bit for PathLike targets.

@python-cla-bot

python-cla-bot Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@eoan-ermine

Copy link
Copy Markdown
Contributor Author

@pfmoore fyi

@aisk aisk added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Aug 29, 2026
Comment thread Misc/NEWS.d/next/Library/2026-08-29-14-28-46.gh-issue-156568.mkxLY8.rst Outdated
Comment thread Lib/test/test_zipapp.py
@bedevere-app

bedevere-app Bot commented Aug 29, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

eoan-ermine and others added 2 commits August 29, 2026 21:32
…kxLY8.rst

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
Co-authored-by: Paul Moore <p.f.moore@gmail.com>
@eoan-ermine

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

@bedevere-app

bedevere-app Bot commented Aug 29, 2026

Copy link
Copy Markdown

Thanks for making the requested changes!

@pfmoore: please review the changes made to this pull request.

@bedevere-app
bedevere-app Bot requested a review from pfmoore August 29, 2026 19:00
@eoan-ermine

Copy link
Copy Markdown
Contributor Author

@pfmoore Just following up on this PR — would appreciate a review when you get a chance. Thanks!

@pfmoore

pfmoore commented Sep 9, 2026

Copy link
Copy Markdown
Member

@hugovk Should I hold off on merging this as we're so close to 3.15 release (or at least hold off on the 3.15 backport)? It's not an urgent fix, so I'm personally happy to wait till 3.15 is released.

@hugovk

hugovk commented Sep 12, 2026

Copy link
Copy Markdown
Member

You can merge it to main (and 3.13/3.14) and just hold off on the 3.15 backport if you like.

@pfmoore

pfmoore commented Sep 15, 2026

Copy link
Copy Markdown
Member

Given that we're only a couple of weeks from 3.15 final, I'll wait - otherwise I'll probably just forget to do the 3.15 backport 🙁

@pfmoore
pfmoore merged commit efc6211 into python:main Oct 14, 2026
51 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @eoan-ermine for the PR, and @pfmoore for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Oct 14, 2026

Copy link
Copy Markdown

GH-159404 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 14, 2026
@bedevere-app

bedevere-app Bot commented Oct 14, 2026

Copy link
Copy Markdown

GH-159405 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 14, 2026
@bedevere-app

bedevere-app Bot commented Oct 14, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Oct 14, 2026
@pfmoore

pfmoore commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution, @eoan-ermine!

@pfmoore

pfmoore commented Oct 14, 2026

Copy link
Copy Markdown
Member

Backports merged, with the exception of 3.13 as that is now in security-only mode.

@bedevere-bot

Copy link
Copy Markdown

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

Hi! The buildbot AMD64 FreeBSD Refleaks 3.x (tier-3) has failed when building commit efc6211.

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/1613/builds/3971) and take a look at the build logs.
  4. Check if the failure is related to this commit (efc6211) 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/1613/builds/3971

Failed tests:

  • test_imaplib

Failed subtests:

  • test_idle_process_reuse_one - test.test_concurrent_futures.test_process_pool.ProcessPoolForkserverProcessPoolExecutorTest.test_idle_process_reuse_one
  • test_imaplib_timeout_functionality_test - test.test_imaplib.NewIMAPSSLTests.test_imaplib_timeout_functionality_test

Test leaking resources:

  • test_events: memory blocks

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

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('127.0.0.1', 27337), raddr=('127.0.0.1', 12675)>
Task was destroyed but it is pending!
task: <Task pending name='Task-4666' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('127.0.0.1', 28364), raddr=('127.0.0.1', 26779)>
Task was destroyed but it is pending!
task: <Task pending name='Task-1815' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=8>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('127.0.0.1', 36896), raddr=('127.0.0.1', 57268)>
Task was destroyed but it is pending!
task: <Task pending name='Task-3808' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/test_concurrent_futures/test_process_pool.py", line 202, in test_idle_process_reuse_one
    self.assertEqual(len(executor._processes), 1)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 2 != 1


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/test_imaplib.py", line 906, in test_imaplib_timeout_functionality_test
    client = self.imap_class("localhost", addr, timeout=0.001)
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/imaplib.py", line 2070, in __init__
    IMAP4.__init__(self, host, port, timeout)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/imaplib.py", line 313, in __init__
    self.open(host, port, timeout)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/imaplib.py", line 2083, in open
    IMAP4.open(self, host, port, timeout)
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/imaplib.py", line 427, in open
    self.sock = self._create_socket(timeout)
                ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/imaplib.py", line 2073, in _create_socket
    sock = IMAP4._create_socket(self, timeout)
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/imaplib.py", line 416, in _create_socket
    return socket.create_connection(address, timeout)
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/socket.py", line 894, in create_connection
    raise exceptions[0]
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/socket.py", line 879, in create_connection
    sock.connect(sa)
    ~~~~~~~~~~~~^^^^
ConnectionRefusedError: [Errno 61] Connection refused


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('127.0.0.1', 32810), raddr=('127.0.0.1', 28970)>
Task was destroyed but it is pending!
task: <Task pending name='Task-1805' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=8>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('127.0.0.1', 27854), raddr=('127.0.0.1', 58958)>
Task was destroyed but it is pending!
task: <Task pending name='Task-3238' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('127.0.0.1', 27015), raddr=('127.0.0.1', 27743)>
Task was destroyed but it is pending!
task: <Task pending name='Task-1506' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=8, family=2, type=1, proto=6, laddr=('127.0.0.1', 29771), raddr=('127.0.0.1', 49729)>
Task was destroyed but it is pending!
task: <Task pending name='Task-2667' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=8>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('127.0.0.1', 14784), raddr=('127.0.0.1', 52970)>
Task was destroyed but it is pending!
task: <Task pending name='Task-1516' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
k


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/test/support/__init__.py", line 977, in gc_collect
    gc.collect()
    ~~~~~~~~~~^^
ResourceWarning: unclosed <socket.socket fd=7, family=2, type=1, proto=6, laddr=('127.0.0.1', 55646), raddr=('127.0.0.1', 32265)>
Task was destroyed but it is pending!
task: <Task pending name='Task-2377' coro=<BaseSelectorEventLoop._accept_connection2() done, defined at /home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py:220> wait_for=<Future pending cb=[Task.task_wakeup()]>>
Warning -- Unraisable exception
Exception ignored while calling deallocator <function _SelectorTransport.__del__ at 0x15d201194e90>:
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14.refleak/build/Lib/asyncio/selector_events.py", line 882, in __del__
    _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ResourceWarning: unclosed transport <_SelectorSocketTransport closing fd=7>
k

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