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

setup.py: handle more corner cases for pg_config #1600

Merged
merged 2 commits into from
Aug 4, 2023

Conversation

jchampio
Copy link
Contributor


I took this opportunity to simplify a bit using subprocess.run(), since it looks like the minimum Python version is now 3.6.

Originally I planned to set run(..., encoding='ascii'), but I realized that standard error messages coming back are not guaranteed to be in ASCII. So I switched to UTF-8 decoding (strict for stdout, lax for stderr), which should also handle more unusual installation paths. If that's too much change for a single bugfix, I can revert to ASCII-only.

jchampio and others added 2 commits August 4, 2023 17:18
- Differentiate between unexpected empty values and execution failure.
- Accept empty --cppflags and --ldflags output. Fixes psycopg#1599.
- Accept UTF-8 output from pg_config, for alternative client locales.
@dvarrazzo dvarrazzo merged commit fb77bdc into psycopg:master Aug 4, 2023
10 checks passed
@jchampio jchampio deleted the dev/fix-meson-build branch August 15, 2023 19:25
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.

Build fails with empty pg_config --cppflags output
2 participants