René's URL Explorer Experiment


Title: Py313 replace pkgutil get loader for 3.14 by pattems · Pull Request #130 · python-postgres/fe · GitHub

Open Graph Title: Py313 replace pkgutil get loader for 3.14 by pattems · Pull Request #130 · python-postgres/fe

X Title: Py313 replace pkgutil get loader for 3.14 by pattems · Pull Request #130 · python-postgres/fe

Description: Three commits. 1. Replace pkgutil.get_loader for 3.14 postgresql/python/command.py does from pkgutil import get_loader as module_loader. pkgutil.get_loader was deprecated in Python 3.12 and removed in 3.14, so on 3.14 >>> import postgresql.python.command ImportError: cannot import name 'get_loader' from 'pkgutil' which also takes down postgresql.bin.pg_python (the pg_python script). On 3.12/3.13 it emits a DeprecationWarning on every -m/-C module: use. The change defines module_loader(name) on top of importlib.util.find_spec() (available since 3.4, so fine for requires-python >= 3.7), returning the spec's loader or None, which is what Execution expects. 2. Always set version; fixes pg_dotconf import postgresql/__init__.py does from .project import version_info, version, \ author as __author__, date as __date__ __version__ = version inside try/except ImportError. project.py no longer defines author or date, so the import fails after binding version and before __version__ is set; the error is swallowed. As a result, on any Python version: >>> import postgresql.bin.pg_dotconf ImportError: cannot import name '__version__' from 'postgresql' >>> from postgresql import * AttributeError: module 'postgresql' has no attribute '__author__' The change imports only version_info and version, sets __version__ after the try, and drops __author__/__date__ from __all__. 3. Fix pg_dotconf -f/--file With the import fixed, pg_dotconf -f settings.conf postgresql.conf hits NameError: name 'comment' is not defined: the loop uses bare comment and unquote instead of configfile.comment/configfile.unquote. It also tested line[pl[0].start] (the first character of the key) for the comment marker, so a commented-out setting in the settings file would have been applied. It now checks line[:pl[0].start], as configfile.alter_config() does. Testing Driving postgresql.python.command.command() directly with ['pg_python', '-C', 'module:pgcmd_ctx', '-m', 'pgcmd_main', 'a1', 'a2'] (two small throwaway modules on sys.path), plus -m no_such_module_xyz, with DeprecationWarning turned into errors: Before (f71e4b2): 3.14.3 -> ImportError on import; 3.12.13 and 3.13.14 -> DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14. After, CPython 3.12.13, 3.13.14 and 3.14.3: main module runs as __main__ with argv ['a1', 'a2'] and the context module's globals, returns 0; the missing module raises ImportError: Python module 'no_such_module_xyz' does not exist or cannot be read as before. python -m unittest postgresql.test.test_python: OK on all three. Commits 2 and 3: import postgresql, from postgresql import *, then pg_dotconf.command(['pg_dotconf', '--stdout', '-f', 'settings.conf', 'postgresql.conf']) with a settings file holding port = 5433 and #work_mem = 64MB, and a postgresql.conf holding #port = 5432, max_connections = 100, #work_mem = 4MB: Before (f71e4b2 + commit 1): __version__ missing, star import AttributeError, import postgresql.bin.pg_dotconf ImportError (CPython 3.12.13 and 3.13.14). After commit 2 only: NameError comment in command(). After commit 3, CPython 3.12.13, 3.13.14 and 3.14.3: __version__ == '1.3.1', star import OK, output port = '5433', max_connections = 100, #work_mem = 4MB (the commented work_mem line in the settings file is skipped). python -m unittest postgresql.test.test_configfile: OK on all three.

Open Graph Description: Three commits. 1. Replace pkgutil.get_loader for 3.14 postgresql/python/command.py does from pkgutil import get_loader as module_loader. pkgutil.get_loader was deprecated in Python 3.12 and removed...

X Description: Three commits. 1. Replace pkgutil.get_loader for 3.14 postgresql/python/command.py does from pkgutil import get_loader as module_loader. pkgutil.get_loader was deprecated in Python 3.12 and removed...

Opengraph URL: https://github.com/python-postgres/fe/pull/130

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:05f5754f-6512-ddeb-02e6-6eed4e4d12e4
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAE2A:2D6F70:3B4C1:5353A:6B046158
html-safe-noncef32a4b84683a4a7beb5162922c12fb5b7a99fb7b66cf9ee7a7834ebe2e7fa362
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTJBOjJENkY3MDozQjRDMTo1MzUzQTo2QjA0NjE1OCIsInZpc2l0b3JfaWQiOiI5NDc1NjEyMTQyNjE4NzkxMjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf61759720c76e513f39cba1d73594e6098089cacb54d194d6e44c9fb27eea230
hovercard-subject-tagpull_request:5026435178
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python-postgres/fe/pull/130/files
twitter:imagehttps://avatars.githubusercontent.com/u/2626332?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/2626332?s=400&v=4
og:image:altThree commits. 1. Replace pkgutil.get_loader for 3.14 postgresql/python/command.py does from pkgutil import get_loader as module_loader. pkgutil.get_loader was deprecated in Python 3.12 and removed...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python-postgres/fe git https://github.com/python-postgres/fe.git
octolytics-dimension-user_id2132548
octolytics-dimension-user_loginpython-postgres
octolytics-dimension-repository_id100230
octolytics-dimension-repository_nwopython-postgres/fe
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id100230
octolytics-dimension-repository_network_root_nwopython-postgres/fe
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release03e114520787ad27289207f153520ef97461127c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-postgres/fe/pull/130/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-postgres%2Ffe%2Fpull%2F130%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-postgres%2Ffe%2Fpull%2F130%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python-postgres%2Ffe
Reloadhttps://github.com/python-postgres/fe/pull/130/files
Reloadhttps://github.com/python-postgres/fe/pull/130/files
Reloadhttps://github.com/python-postgres/fe/pull/130/files
python-postgreshttps://github.com/python-postgres
fehttps://github.com/python-postgres/fe
Codehttps://github.com/python-postgres/fe
Issues17 (17)https://github.com/python-postgres/fe/issues
Pull requests2 (2)https://github.com/python-postgres/fe/pulls
Actionshttps://github.com/python-postgres/fe/actions
Security and qualityhttps://github.com/python-postgres/fe/security
Insightshttps://github.com/python-postgres/fe/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython-postgres%2Ffe%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython-postgres%2Ffe%2Fissues%2Fnew%2Fchoose
jwphttps://github.com/jwp
python-postgres:masterhttps://github.com/python-postgres/fe/tree/master
pattems:py313-replace-pkgutil-get-loader-for-3-14https://github.com/pattems/python-postgres-fe/tree/py313-replace-pkgutil-get-loader-for-3-14
Conversation 1 https://github.com/python-postgres/fe/pull/130
Commits 3 https://github.com/python-postgres/fe/pull/130/commits
Checks 0 https://github.com/python-postgres/fe/pull/130/checks
Files changed https://github.com/python-postgres/fe/pull/130/files
Please reload this pagehttps://github.com/python-postgres/fe/pull/130/files
Py313 replace pkgutil get loader for 3.14 https://github.com/python-postgres/fe/pull/130/files#top
Show all changes 3 commits https://github.com/python-postgres/fe/pull/130/files
cd6ff46 Replace pkgutil.get_loader for 3.14. pattems Oct 13, 2026 https://github.com/python-postgres/fe/pull/130/commits/cd6ff46d4081aec717e882a36d8c3aff05324ce4
4ae3746 Always set __version__; fixes pg_dotconf import. pattems Oct 15, 2026 https://github.com/python-postgres/fe/pull/130/commits/4ae3746457284f296fa30c373b9e7362f2035846
b8c39af Fix pg_dotconf -f/--file. pattems Oct 15, 2026 https://github.com/python-postgres/fe/pull/130/commits/b8c39af442edda2b8bad4806d23557024cb12e2e
Clear filters https://github.com/python-postgres/fe/pull/130/files
Please reload this pagehttps://github.com/python-postgres/fe/pull/130/files
Please reload this pagehttps://github.com/python-postgres/fe/pull/130/files
__init__.py https://github.com/python-postgres/fe/pull/130/files#diff-7008655e8992b3a7fed9c7a468d9bfd65b94cc47bcb3626e18d4a6e413fdc289
pg_dotconf.py https://github.com/python-postgres/fe/pull/130/files#diff-2a859a3de2331e32a9961acf164c22829f0115f4817a2be2878aaad127532658
command.py https://github.com/python-postgres/fe/pull/130/files#diff-70ff012495095686ae31041e691e90aa3ab9e8218ed9e5c7d262ca6c9bc2984f
postgresql/__init__.pyhttps://github.com/python-postgres/fe/pull/130/files#diff-7008655e8992b3a7fed9c7a468d9bfd65b94cc47bcb3626e18d4a6e413fdc289
View file https://github.com/pattems/python-postgres-fe/blob/b8c39af442edda2b8bad4806d23557024cb12e2e/postgresql/__init__.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-postgres/fe/pull/130/{{ revealButtonHref }}
https://github.com/python-postgres/fe/pull/130/files#diff-7008655e8992b3a7fed9c7a468d9bfd65b94cc47bcb3626e18d4a6e413fdc289
https://github.com/python-postgres/fe/pull/130/files#diff-7008655e8992b3a7fed9c7a468d9bfd65b94cc47bcb3626e18d4a6e413fdc289
https://github.com/python-postgres/fe/pull/130/files#diff-7008655e8992b3a7fed9c7a468d9bfd65b94cc47bcb3626e18d4a6e413fdc289
postgresql/bin/pg_dotconf.pyhttps://github.com/python-postgres/fe/pull/130/files#diff-2a859a3de2331e32a9961acf164c22829f0115f4817a2be2878aaad127532658
View file https://github.com/pattems/python-postgres-fe/blob/b8c39af442edda2b8bad4806d23557024cb12e2e/postgresql/bin/pg_dotconf.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-postgres/fe/pull/130/{{ revealButtonHref }}
https://github.com/python-postgres/fe/pull/130/files#diff-2a859a3de2331e32a9961acf164c22829f0115f4817a2be2878aaad127532658
https://github.com/python-postgres/fe/pull/130/files#diff-2a859a3de2331e32a9961acf164c22829f0115f4817a2be2878aaad127532658
postgresql/python/command.pyhttps://github.com/python-postgres/fe/pull/130/files#diff-70ff012495095686ae31041e691e90aa3ab9e8218ed9e5c7d262ca6c9bc2984f
View file https://github.com/pattems/python-postgres-fe/blob/b8c39af442edda2b8bad4806d23557024cb12e2e/postgresql/python/command.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python-postgres/fe/pull/130/{{ revealButtonHref }}
https://github.com/python-postgres/fe/pull/130/files#diff-70ff012495095686ae31041e691e90aa3ab9e8218ed9e5c7d262ca6c9bc2984f
https://github.com/python-postgres/fe/pull/130/files#diff-70ff012495095686ae31041e691e90aa3ab9e8218ed9e5c7d262ca6c9bc2984f
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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.