Skip to content

bpo-30565: Remove PEP 538 warnings #2186

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

Closed
wants to merge 1 commit into from
Closed

bpo-30565: Remove PEP 538 warnings #2186

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

Writing warnings to stderr causes many test failures and the warning
cannot be disabled.

@vstinner
Copy link
Member Author

@ncoghlan: So Nick, what do you think? :-)

Writing warnings to stderr causes many test failures in the Python
test suite, warning which could only be disabled when building Python
but not at runtime.

Remove also --with(out)-c-locale-warning option of configure and
PY_WARN_ON_C_LOCALE define.
@vstinner
Copy link
Member Author

I don't understand the AppVeyor failure :-( I'm not sure that it's related to my PR.

======================================================================
FAIL: test_s_option (test.test_site.HelperFunctionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\projects\cpython\lib\test\test_site.py", line 188, in test_s_option
    self.assertIn(usersite, sys.path)
AssertionError: 'C:\\Users\\appveyor\\AppData\\Roaming\\Python\\Python37\\site-packages' not found in ['', 'C:\\projects\\cpython\\PCbuild\\win32\\python37.zip', 'C:\\projects\\cpython\\DLLs', 'C:\\projects\\cpython\\lib', 'C:\\projects\\cpython\\PCbuild\\win32', 'C:\\projects\\cpython', 'C:\\projects\\cpython\\lib\\site-packages']

@ncoghlan
Copy link
Contributor

I'm fine with making the stderr warnings opt-in at runtime via PYTHONCOERCECLOCALE=warn, but I'm not a fan of removing them entirely.

With the off-by-default runtime switch, you could still remove the compile time option, though.

Copy link
Contributor

@ncoghlan ncoghlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of this approach, so I'll put together an alternative PR that instead adds PYTHONCOERCECLOCALE=warn as a runtime guard for both the successful coercion warning and for the coercion-failed-or-was-not-attempted warning, while remove the build time option.

@ncoghlan
Copy link
Contributor

Competing proposal: #2260

@ncoghlan
Copy link
Contributor

@Haypo +1'ed #2260, so closing this in favour of that PR.

@ncoghlan ncoghlan closed this Jun 17, 2017
@vstinner
Copy link
Member Author

vstinner commented Jun 17, 2017 via email

@vstinner vstinner deleted the pep538_warn branch August 10, 2017 23:40
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.

3 participants