Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python 3.14#2611

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
filmor wants to merge14 commits intomaster
base:master
Choose a base branch
Loading
frompython3.14
Open

Python 3.14#2611

filmor wants to merge14 commits intomasterfrompython3.14

Conversation

@filmor
Copy link
Member

@filmorfilmor commentedAug 9, 2025
edited
Loading

Main changes:

TODO:

  • Reenable all tests
  • Ensure that there are no crashes during garbage collection
  • Ensure that the meta type uses the correct (i.e.: our)tp_setattro instead of the generic one

@kunom
Copy link

kunom commentedOct 16, 2025
edited
Loading

Some subjective feedback from my Windows machine with VS 2022:

guywithface and filmor reacted with thumbs up emoji

@guywithface
Copy link

guywithface commentedOct 16, 2025
edited
Loading

Also had to replace the target framework from net6.0 to net8.0. Also some feedback for .net 8:

  • Add#pragma warning disable SYSLIB0011 for where BinaryFormatter is being used
  • Add<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization> to all projects
  • Remove NonCopyable from ref struct NewReference
  • Remove NonCopyable from ref struct StolenReference
  • Need to consider migrating away from using BinaryFormatter as it will be deprecated in .net9

And now getting an access memory violation for PyGC_Collect(); in Runtime.cs

@filmor
Copy link
MemberAuthor

Status report: After applying the alignment "fix" (thanks!), things work for the most part. There are some crashes in explicit garbage collection, so I have disabled those tests for now.

@filmor
Copy link
MemberAuthor

Also, we currently apparently have a weird inheritance order for our meta type, which leads to it using thePyObject_GenericSetAttr instead oftype_setattro, which in turn triggers assertions sincepython/cpython@5a1618a

@kunom
Copy link

@filmor As the CI seems to be pretty broken (pytest: command not found), could you please provide a list of the outstanding tasks for this PR to reach completion, as you did in the description block ofthe corresponding 3.13 PR.

Things not clear to me:

  • do you want to have the exluded tests re-enabled?
  • do the tests failing due to missing BinarySerializer functionality block this PR?

Thanks ;-)

@filmor
Copy link
MemberAuthor

There you go. There are still pending issues with the embedding tests that are being worked on in#2638, but I'd be fine with releasing a wheel if we get to the point that all Python tests run through without crashes on 3.14.

@andre-romano

This comment has been minimized.

@filmor
Copy link
MemberAuthor

@filmor
Copy link
MemberAuthor

@lostmsu Please have a look. It will require quite a bit more work to get everything green again (CI-wise, in particular around the embedding), but with these changes, we should be able to release a wheel for Python 3.14.

@filmorfilmor requested a review fromlostmsuDecember 7, 2025 14:09
@filmorfilmorforce-pushed thepython3.14 branch 2 times, most recently from027eb12 to7ca54ffCompareDecember 8, 2025 10:24
@filmorfilmor marked this pull request as ready for reviewDecember 8, 2025 10:29
Copy link
Member

@lostmsulostmsu left a comment
edited
Loading

Choose a reason for hiding this comment

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

LGTM, minor comments only.

I noticed a few files have been reformatted (whitespace only). Perhaps undo that. Technically all reformatting should be in separate commits mentioned in.git-blame-ignore-revs

filmor reacted with thumbs up emoji
-name:Embedding tests (.NET Core)
run:dotnet test --runtime any-${{ matrix.os.platform }} --framework net8.0 --logger "console;verbosity=detailed" src/embed_tests/
if:always()
if:false
Copy link
Member

Choose a reason for hiding this comment

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

Can't we limit the skip to 3.14?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is a leftover, will reactivate the tests today.

@filmorfilmorforce-pushed thepython3.14 branch 2 times, most recently from47378be to3af5779CompareDecember 8, 2025 19:36
Not at all sure why this helps, but when assigning `None` instead, theobject is gone at the time of garbage collection.
- The first two run into issues because our meta type's `tp_getattro` is  not overridden by its subclasses- The last runs into a `PyErrOccurred` when trying to access its  `__len__`, related to our sequence decoding logic
In Python 3.14, the objects __dict__ seems to already be halfdeconstructed, leading to crashes during garbage collection.Since gc in Python is single-threaded (I think :)), it shouldbe fine to have a single static for this. If that is not true,we can always use a thread-local instead.
Python 3.14 introduced a new assertion that prevents us from usingPyObject_GenericSetAttr directly in our meta type. To work aroundthis, we manipulate the type dict directly.This workaround is a simplified variant of Cython's workaround fromcython/cython#6325.The relevant Python change is inpython/cpython#118454
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lostmsulostmsulostmsu approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

3.1.0

Development

Successfully merging this pull request may close these issues.

6 participants

@filmor@kunom@guywithface@andre-romano@lostmsu

[8]ページ先頭

©2009-2025 Movatter.jp