GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code by freakboy3742 · Pull Request #120984 · python/cpython

Conversation

@freakboy3742

@freakboy3742 freakboy3742 commented Jun 25, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Apple’s macOS App Store is auto-rejects any app that has the string itms-services in it. This is the custom URL prefix used for requesting an app installation from the iTunes App Store; however, sandboxed apps are prohibited from using these URLs. Apple’s automagical review processes are catching on the code in urllib’s parser’s handling of these URLs - even if the app in question never uses an itms-services:// URL. It’s present in the standard library; therefore the app is rejected.

Following a discussion on discuss.python.org, this PR adds a --with-app-store-compliance option to configure that will patch out any code that is known to be an issue with app store compliance.

There is currently a single patch, in the Mac resources directory, patching the known occurrences of itms-services. This patch is optionally applied on macOS if the configure flag is enabled, but the patch is applied in as "dry run" if the flag is not enabled. This ensures that a standard macOS CI pass will identify any drift in the patch.

The same patch is also used by iOS builds, as the review issues are the same. On iOS, the patch is always applied, because all apps will need to pass App Store compliance.

The option allows for a custom patch file to be provided (in case App Store rules change after support for a Python release has ceased. This also a platform other than iOS or macOS to apply a "compliance" patch by manually supplying one; although there's no known use case for this at present.

Fixes #120522.

  • Issue: Python 3.12 change results in Apple App Store rejection #120522

📚 Documentation preview 📚: https://cpython-previews--120984.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

davecom, buganini, and ThatOneCalculator reacted with thumbs up emoji noamcohen97 and ThatOneCalculator reacted with laugh emoji
All reactions
  • 👍 3 reactions
  • 😄 2 reactions
freakboy3742 added 3 commits June 25, 2024 15:26
@freakboy3742
Add --app-store-compliance configuration option.
e30787f
@freakboy3742
Added blurb.
ae53183
@freakboy3742
Correct tab-vs-spaces formatting issue.
eee0c93
@freakboy3742 freakboy3742 added OS-mac 3.12 only security fixes 3.13 only security fixes OS-ios 3.14 bugs and security fixes needs backport to 3.13 only security fixes labels Jun 25, 2024
@freakboy3742
freakboy3742 requested review from a team, corona10 and erlend-aasland as code owners June 25, 2024 07:45
@bedevere-app bedevere-app Bot mentioned this pull request Jun 25, 2024
Python 3.12 change results in Apple App Store rejection #120522
Closed
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 25, 2024
@freakboy3742

freakboy3742 commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

I've flagged this for backport to 3.13, and documented the option as being added in 3.13. The issue also exists in (and was originally reported against) 3.12; I'm not sure what the policy is regarding a backport of a new (strictly optional) configuration option.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742

freakboy3742 commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

!buildbot iOS

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jun 25, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit eee0c93 🤖

The command will test the builders whose names match following regular expression: iOS

The builders matched are:

  • iOS ARM64 Simulator PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nineteendo
nineteendo reviewed Jun 25, 2024
View reviewed changes
Comment thread Doc/using/ios.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742 @nineteendo
Correct source file name in docs.
eeb976f
Co-authored-by: Nice Zombies <[email protected]>
nineteendo
nineteendo reviewed Jun 25, 2024
View reviewed changes
Comment thread Doc/using/mac.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742 @nineteendo
Correct source code reference in Mac docs
26cd9ae
Co-authored-by: Nice Zombies <[email protected]>
@nineteendo

nineteendo commented Jun 25, 2024

Copy link
Copy Markdown
Contributor

Did this get fixed already? https://buildbot.python.org/all/#/builders/1382/builds/32

patch -p1 --dry-run < ../../Mac/Resources/app-store-compliance.patch
File to patch: 
No file found--skip this patch? [y] 
/bin/sh: line 1: 33119 Segmentation fault: 11  patch -p1 --dry-run < ../../Mac/Resources/app-store-compliance.patch
make: *** [app-store-compliance] Error 139
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742

freakboy3742 commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

Did this get fixed already?

No - the patch command isn't quite right for out-of-tree builds. I need to make a small tweak.

nineteendo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742
Only apply the patch forward, and ensure the working directory is cor…
2d5a0a7
…rect.
@freakboy3742

freakboy3742 commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

!buildbot iOS

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot

bedevere-bot commented Jun 25, 2024

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @freakboy3742 for commit 2d5a0a7 🤖

The command will test the builders whose names match following regular expression: iOS

The builders matched are:

  • iOS ARM64 Simulator PR
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742
freakboy3742 marked this pull request as draft June 25, 2024 10:17
@bedevere-app bedevere-app Bot removed the awaiting core review label Jun 25, 2024
@freakboy3742

freakboy3742 commented Jun 25, 2024

Copy link
Copy Markdown
Contributor Author

Hrm... that still isn't quite right. I'll need to take another look in the morning.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742
Make patching reslient to multiple builds.
12cb469
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 30, 2024
@freakboy3742 @nineteendo
@ncoghlan @erlend-aasland @miss-islington
pythongh-120522: Add a --with-app-store-compliance configure option…
0b733c5
… to patch out problematic code (pythonGH-120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <[email protected]>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <[email protected]>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <[email protected]>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <[email protected]>

* Regenerate configure script.

* Silence the patch echo output.

---------

(cherry picked from commit 48cd104)

Co-authored-by: Russell Keith-Magee <[email protected]>
Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-app

bedevere-app Bot commented Jun 30, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 30, 2024
@freakboy3742 freakboy3742 added the needs backport to 3.12 only security fixes label Jun 30, 2024
@miss-islington-app

miss-islington-app Bot commented Jun 30, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Jun 30, 2024

Copy link
Copy Markdown

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

cherry_picker 48cd104b0cf05dad8958efa9cb9666c029ef9201 3.12
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned freakboy3742 Jun 30, 2024
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull request Jun 30, 2024
@freakboy3742 @nineteendo
@ncoghlan @erlend-aasland
[3.12] pythongh-120522: Add a --with-app-store-compliance configure…
2e82cae
… option to patch out problematic code (pythonGH-120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <[email protected]>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <[email protected]>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <[email protected]>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <[email protected]>

* Regenerate configure script.

* Silence the patch echo output.

---------

(cherry picked from commit 48cd104)

Co-authored-by: Russell Keith-Magee <[email protected]>
Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull request Jun 30, 2024
@freakboy3742 @nineteendo
@ncoghlan @erlend-aasland
[3.12] pythongh-120522: Add a --with-app-store-compliance configure…
8a21d05
… option to patch out problematic code (pythonGH-120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <[email protected]>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <[email protected]>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <[email protected]>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <[email protected]>

* Regenerate configure script.

* Silence the patch echo output.

---------

(cherry picked from commit 48cd104)

Co-authored-by: Russell Keith-Magee <[email protected]>
Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
freakboy3742 added a commit to freakboy3742/cpython that referenced this pull request Jun 30, 2024
@freakboy3742 @nineteendo
@ncoghlan @erlend-aasland
[3.12] pythongh-120522: Add a --with-app-store-compliance configure…
5252c49
… option to patch out problematic code (pythonGH-120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <[email protected]>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <[email protected]>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <[email protected]>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <[email protected]>

* Regenerate configure script.

* Silence the patch echo output.

---------

(cherry picked from commit 48cd104)

Co-authored-by: Russell Keith-Magee <[email protected]>
Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-app

bedevere-app Bot commented Jun 30, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jun 30, 2024
freakboy3742 added a commit that referenced this pull request Jun 30, 2024
@miss-islington @freakboy3742
@nineteendo @ncoghlan @erlend-aasland
[3.13] gh-120522: Add a --with-app-store-compliance configure optio…
0dfb437
…n to patch out problematic code (GH-120984) (#121173)

gh-120522: Add a `--with-app-store-compliance` configure option to patch out problematic code (GH-120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.



* Correct source code reference in Mac docs



* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review



* Documentation and configure.ac syntax improvements



* Regenerate configure script.

* Silence the patch echo output.

---------

(cherry picked from commit 48cd104)

Co-authored-by: Russell Keith-Magee <[email protected]>
Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
@freakboy3742 @nineteendo
@ncoghlan @erlend-aasland @mrahtz
pythongh-120522: Add a --with-app-store-compliance configure option…
14e2c0e
… to patch out problematic code (python#120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <[email protected]>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <[email protected]>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <[email protected]>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <[email protected]>

* Regenerate configure script.

* Silence the patch echo output.

---------

Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
@erlend-aasland

erlend-aasland commented Jul 1, 2024

Copy link
Copy Markdown
Contributor

Oh, next time, remember to edit the commit message upon merging, @freakboy3742 :)

freakboy3742 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742

freakboy3742 commented Jul 1, 2024

Copy link
Copy Markdown
Contributor Author

@erlend-aasland Will do; might be worth adding notes on this to the dev guide about this; AFAICT, there's nothing about the format/style of final commit messages.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland mentioned this pull request Jul 1, 2024
Improve the "Making Good PRs" section python/devguide#931
Open
@ned-deily

ned-deily commented Jul 2, 2024

Copy link
Copy Markdown
Member

Sorry for the late comment but I believe the approach in this PR has some incompatibilities that need to be addressed. See the comment in the issue.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742 freakboy3742 mentioned this pull request Jul 16, 2024
gh-120522: Apply App Store compliance patch to installed products, not source #121830
Closed
ned-deily added a commit to ned-deily/cpython that referenced this pull request Jul 16, 2024
@ned-deily
Revert "pythongh-120522: Add a --with-app-store-compliance configur…
2d8c46b
…e option to patch out problematic code (python#120984)"

This reverts commit 48cd104 prior
to the release of 3.13.0b4 to allow for additional review time.
ned-deily added a commit that referenced this pull request Jul 16, 2024
@ned-deily
gh-120522: Revert "Add a --with-app-store-compliance configure opti…
f27593a
…on to patch out problematic code" (gh-120984) (#121844)

This reverts commit 48cd104 prior
to the release of 3.13.0b4 to allow for additional review time.
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 16, 2024
@ned-deily @miss-islington
pythongh-120522: Revert "Add a --with-app-store-compliance configur…
1c81db1
…e option to patch out problematic code" (pythongh-120984) (pythonGH-121844)

This reverts commit 48cd104 prior
to the release of 3.13.0b4 to allow for additional review time.
(cherry picked from commit f27593a)

Co-authored-by: Ned Deily <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@freakboy3742 @nineteendo
@ncoghlan @erlend-aasland @estyxx
pythongh-120522: Add a --with-app-store-compliance configure option…
8913836
… to patch out problematic code (python#120984)

* Add --app-store-compliance configuration option.

* Added blurb.

* Correct tab-vs-spaces formatting issue.

* Correct source file name in docs.

Co-authored-by: Nice Zombies <[email protected]>

* Correct source code reference in Mac docs

Co-authored-by: Nice Zombies <[email protected]>

* Only apply the patch forward, and ensure the working directory is correct.

* Make patching reslient to multiple builds.

* Documentation fixes found during review

Co-authored-by: Alyssa Coghlan <[email protected]>

* Documentation and configure.ac syntax improvements

Co-authored-by: Erlend E. Aasland <[email protected]>

* Regenerate configure script.

* Silence the patch echo output.

---------

Co-authored-by: Nice Zombies <[email protected]>
Co-authored-by: Alyssa Coghlan <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@ned-deily @estyxx
pythongh-120522: Revert "Add a --with-app-store-compliance configur…
a0ee522
…e option to patch out problematic code" (pythongh-120984) (python#121844)

This reverts commit 48cd104 prior
to the release of 3.13.0b4 to allow for additional review time.
@freakboy3742 freakboy3742 mentioned this pull request Jul 18, 2024
gh-120522: Apply App Store compliance patch during installation #121947
Merged
@kcoombs

kcoombs commented Jan 23, 2025

Copy link
Copy Markdown

Not sure where this best belongs, but relevant to Python App Store compliance issues, I ran into this Apple rejection today:

Guideline 2.5.1 - Performance - Software Requirements

Your app uses or references the following non-public or deprecated APIs:

Contents/Frameworks/Python.framework/Versions/3.12/lib/libtk8.6.dylib

Symbols:

• _NSWindowDidOrderOnScreenNotification

The use of non-public or deprecated APIs is not permitted on the App Store, as they can lead to a poor user experience should these APIs change and are otherwise not supported on Apple platforms.

Note, this is the framework inserted into the app by Briefcase 0.3.20.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742

freakboy3742 commented Jan 23, 2025

Copy link
Copy Markdown
Contributor Author

@kcoombs I've opened #129247 to track the problem; however, there's not much we can do to address this.

If your app actually uses Tkinter, unfortunately, you're out of luck. It appears that Tk cannot be distributed on the macOS App Store (see the upstream Tk bug).

If your app doesn't use Tkinter, you can safely delete the tk dylibs from your app bundle (and in the process, dramatically reduce the size of your app!). In Briefcase, you can do this with the cleanup_paths option; other tools may have analogous options.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kcoombs

kcoombs commented Jan 23, 2025

Copy link
Copy Markdown

@freakboy3742, thanks for the info. I don't use Tkinter, so I'll just use briefcase to remove it, as suggested.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@freakboy3742

freakboy3742 commented Jan 23, 2025

Copy link
Copy Markdown
Contributor Author

@kcoombs I've logged this as beeware/briefcase#2131, and provided a sample configuration fix.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kcoombs

kcoombs commented Jan 24, 2025

Copy link
Copy Markdown

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ncoghlan ncoghlan ncoghlan approved these changes
@erlend-aasland erlend-aasland erlend-aasland approved these changes
@corona10 corona10 Awaiting requested review from corona10 corona10 is a code owner
+1 more reviewer
@nineteendo nineteendo nineteendo left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@freakboy3742 freakboy3742

Labels

3.12 only security fixes 3.13 only security fixes 3.14 bugs and security fixes OS-ios OS-mac

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Python 3.12 change results in Apple App Store rejection

Uh oh!

There was an error while loading. Please reload this page.

7 participants

@freakboy3742 @bedevere-bot @nineteendo @ncoghlan @erlend-aasland @ned-deily @kcoombs
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.