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

DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats #190

Closed
olebole opened this issue Feb 20, 2021 · 3 comments
Closed

Comments

@olebole
Copy link
Contributor

olebole commented Feb 20, 2021

I got the following bug report as Debian#983149:

When running the following lines

from ephem import Mars, constellation
m = Mars('1970')
print(constellation(m))

one gets the warning

DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats

This is Python 3.9.1+.

@brandon-rhodes
Copy link
Owner

Interesting! Thanks for letting us know, this will need to be tackled before the next release.

@hrnciar
Copy link

hrnciar commented Mar 29, 2021

Hello, we are testing Python 3.10.0+ in Fedora and this is not anymore DeprecationWarning.

=================================== FAILURES ===================================
_______________________ FunctionTests.test_constellation _______________________

self = <ephem.tests.test_bodies.FunctionTests testMethod=test_constellation>

    def test_constellation(self):
        oneb = readdb('Orion Nebula,f,5.59,-5.45,2,2000.0,')
        oneb.compute('1999/2/28')
>       self.assertEqual(constellation(oneb), ('Ori', 'Orion'))
E       SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

tests/test_bodies.py:309: SystemError

https://docs.python.org/3.10/whatsnew/3.10.html#id2

The PY_SSIZE_T_CLEAN macro must now be defined to use PyArg_ParseTuple() and Py_BuildValue() formats which use #: es#, et#, s#, u#, y#, z#, U# and Z#. See Parsing arguments and building values and the PEP 353. https://bugs.python.org/issue40943

Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=1891793

@brandon-rhodes
Copy link
Owner

Thanks for letting us know! I've not heard of that constant before, but it looks like there are fairly full explanations of what's going on in the docs, so it should hopefully be straightforward to fix once I (or another contributor) has time.

shadchin added a commit to shadchin/pyephem that referenced this issue Oct 2, 2021
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

No branches or pull requests

3 participants