René's URL Explorer Experiment


Title: python variables called _m lead to unreproducible pyc installations · Issue #92132 · python/cpython · GitHub

Open Graph Title: python variables called _m lead to unreproducible pyc installations · Issue #92132 · python/cpython

X Title: python variables called _m lead to unreproducible pyc installations · Issue #92132 · python/cpython

Description: Hi, in Debian we backported the changes from #27926 to cpython 3.10 and indeed most pyc files that we generate when installing python packages are now bit-by-bit reproducible. There is only a single pyc file that still sometimes leads to...

Open Graph Description: Hi, in Debian we backported the changes from #27926 to cpython 3.10 and indeed most pyc files that we generate when installing python packages are now bit-by-bit reproducible. There is only a singl...

X Description: Hi, in Debian we backported the changes from #27926 to cpython 3.10 and indeed most pyc files that we generate when installing python packages are now bit-by-bit reproducible. There is only a singl...

Opengraph URL: https://github.com/python/cpython/issues/92132

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"python variables called _m lead to unreproducible pyc installations","articleBody":"Hi,\r\n\r\nin Debian we backported the changes from #27926 to cpython 3.10 and indeed most pyc files that we generate when installing python packages are now bit-by-bit reproducible. There is only a single pyc file that still *sometimes* leads to a different pyc file after installation: ` /usr/lib/python3.10/json/__pycache__/decoder.cpython-310.pyc`. I tracked down the reason to its use of the variable name `_m` and filed this as [Debian bug 1010368](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010368). More specifically, that pyc file will have one content in 1/3 cases and another in 2/3 of the cases. The diff between the pyc files is:\r\n\r\n```diff\r\n@@ -1,8 +1,8 @@\r\n 00000000: 6f0d 0d0a 0300 0000 5371 fe33 17b6 dd59  o.......Sq.3...Y\r\n 00000010: e300 0000 0000 0000 0000 0000 0000 0000  ................\r\n 00000020: 0001 0000 0040 0000 0073 0800 0000 6500  .....@...s....e.\r\n-00000030: 0100 6400 5300 2901 4e29 01da 025f 6da9  ..d.S.).N)..._m.\r\n-00000040: 0072 0200 0000 7202 0000 00fa 0f2f 746d  .r....r....../tm\r\n+00000030: 0100 6400 5300 2901 4e29 015a 025f 6da9  ..d.S.).N).Z._m.\r\n+00000040: 0072 0100 0000 7201 0000 00fa 0f2f 746d  .r....r....../tm\r\n 00000050: 702f 6465 636f 6465 722e 7079 da08 3c6d  p/decoder.py..\u003cm\r\n 00000060: 6f64 756c 653e 0100 0000 7302 0000 0008  odule\u003e....s.....\r\n 00000070: 00\r\n```\r\nI can make this problem trigger on a different variable name than `_m` via the following patch:\r\n\r\n```diff\r\n--- a/Lib/types.py\r\n+++ b/Lib/types.py\r\n@@ -37,8 +37,8 @@ _ag = _ag()\r\n AsyncGeneratorType = type(_ag)\r\n \r\n class _C:\r\n-    def _m(self): pass\r\n-MethodType = type(_C()._m)\r\n+    def _b(self): pass\r\n+MethodType = type(_C()._b)\r\n \r\n BuiltinFunctionType = type(len)\r\n BuiltinMethodType = type([].append)     # Same as BuiltinFunctionType\r\n```\r\n\r\nWith that patch, python files containing the variable name `_b` are now sometimes unreproducible.\r\n\r\nI don't seem to be the first who stumbled across the `_m` variable: https://github.com/python/cpython/issues/78903#issuecomment-1093799639\r\n\r\nIn the Debian bug I referenced above, Chris Lamb states, that there is no semantic difference between the different pyc files and Keith Amling points out, that the difference is `FLAG_REF` being added or not.\r\n\r\nSince pyc files containing the variable `_m` are only sometimes unreproducible on new python installations but stable on the same installation, this might as well be a python packaging bug in Debian or maybe we need to backport more than just #27926 to 3.10 to make pyc files stable across different installations. I thus wanted to ask you for any input or advice you can give on this issue.\r\n\r\nThanks!","author":{"url":"https://github.com/josch","@type":"Person","name":"josch"},"datePublished":"2022-05-02T07:45:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/92132/cpython/issues/92132"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:627b6846-bd2f-ba68-22f4-ac86f7898e1c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE6F4:1E4FEF:2F60FFF:3DBE38E:696B8099
html-safe-noncecd3c8fb2fd96ff92b58cb1bc26a32a0503ebb4d97f11ffc3185daaaa37698dc8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkY0OjFFNEZFRjoyRjYwRkZGOjNEQkUzOEU6Njk2QjgwOTkiLCJ2aXNpdG9yX2lkIjoiMjY3NjE0NTU0NzgyNjEzNTE5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac174d1cf4d0ef71721912e37b49b3c548096fa8ea93f1ab1f64a9cba8c810e652
hovercard-subject-tagissue:1222587245
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/92132/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3c851f309a3ba7806c5e6cc055b61b0c2e69b09a5ce00cbe13da6109e2c2270c/python/cpython/issues/92132
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3c851f309a3ba7806c5e6cc055b61b0c2e69b09a5ce00cbe13da6109e2c2270c/python/cpython/issues/92132
og:image:altHi, in Debian we backported the changes from #27926 to cpython 3.10 and indeed most pyc files that we generate when installing python packages are now bit-by-bit reproducible. There is only a singl...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejosch
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/92132#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F92132
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F92132
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/92132
Reloadhttps://github.com/python/cpython/issues/92132
Reloadhttps://github.com/python/cpython/issues/92132
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/92132
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/92132
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/92132
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/92132
python variables called _m lead to unreproducible pyc installationshttps://github.com/python/cpython/issues/92132#top
https://github.com/josch
https://github.com/josch
joschhttps://github.com/josch
on May 2, 2022https://github.com/python/cpython/issues/92132#issue-1222587245
#27926https://github.com/python/cpython/pull/27926
Debian bug 1010368https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1010368
#78903 (comment)https://github.com/python/cpython/issues/78903#issuecomment-1093799639
#27926https://github.com/python/cpython/pull/27926
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.