question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Use of ob_shash is deprecated on 3.11

See original GitHub issue

Describe the bug A clear and concise description of what the bug is.

Using PyStringObject->ob_shash is deprecated in Python 3.11 and emits a warning. NumPy fails the builds on warnings.

To Reproduce We are seeing this in NumPy when building for Python 3.11. Expected behavior A clear and concise description of what you expected to happen.

Environment (please complete the following information):

  • OS: [e.g. Linux, Windows, macOS]
  • Python version [e.g. 3.8.4]
  • Cython version [e.g. 0.29.18]

All OSs, Python 3.11alpha, Cython HEAD and 0.29.28

Additional context Add any other context about the problem here.

Cython could decide to tell downstream projects to ignore the deprecation warning, which would allow the problem to be pushed off for 2 years.

Another alternative is to avoid the fast path that uses internals. Would it be a significant slowdown to skip this for Python>=3.11? https://github.com/cython/cython/blob/c79ae55a7440459dae7667699284a72b09e89185/Cython/Utility/StringTools.c#L369-L379

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
scodercommented, Apr 7, 2022

Given the CYTHON_USE_UNICODE_INTERNALS guard, this is probably a relict of Py2 times, when Py2 str was more important than it is today. I’d just mark the fast path as Py<3.11 only and phase it out that way. It shouldn’t make that much of a difference, except for longer byte strings (with long identical prefixes).

0reactions
felixxmcommented, Apr 7, 2022

Thanks 🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop using distutils in python module #10251 - GitHub
Describe the bug The python module uses distutils inside the INTROSPECT_COMMAND. But distutils is deprecated with removal planned for Python ...
Read more >
40485 – Use of deprecated methods is not shown - Bugs
When I make use of a deprecated method it used to be shown in task-view. Since 2.1, 2.1.1, 3.0 it isn't any more....
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
Bug :1523 - "[IDEA] Offload work by distributing trivial ebuild maintenance to users, ... Bug:270575 - "[TRACKER] Deprecating USE="arts esd"" status:RESOLVED ...
Read more >
(ann) @Deprecated annotation has no effect on packages
Type: Bug; Component: core-libs; Sub-Component: java.lang ... Compilers warn when a deprecated program element is used or overridden in non-deprecated code.
Read more >
stx/integ uses soon-to-be deprecated pip install
Bug #1964372 reported by Scott Little on 2022-03-09 ... The pip team is planning to depreciate the '--use-deprecated legacy-resolver'
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found