Skip to content

Update to Python 3.11 #15544

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

Merged
merged 33 commits into from
Oct 16, 2023
Merged

Update to Python 3.11 #15544

merged 33 commits into from
Oct 16, 2023

Conversation

seanbudd
Copy link
Member

@seanbudd seanbudd commented Sep 28, 2023

Link to issue number:

Closes #12064
Closes #12551
Closes #15577
Closes #15167

Summary of the issue:

Python needs to be updated to 3.11, as Python 3.7 is EOL.
Python pip dependencies need to be updated to match the python upgrade.
typing_extensions is no longer needed.

Description of user facing changes

Performance and security enhancements from dependency upgrades.

Description of development approach

  • Updates python in build scripts
  • Updates pip dependencies
  • Set Windows 8.1 (Blue) as minimum windows version
  • Update references to python and windows version in docs
  • nose is replaced by the unittest module with xmlrunner to generate XML test output
  • drop python optimization to level 0 from level 1. level 1 removes asserts.

Testing strategy:

Alpha testing required

Known issues with pull request:

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@seanbudd seanbudd mentioned this pull request Sep 28, 2023
5 tasks
@codeofdusk

This comment was marked as resolved.

@AppVeyorBot

This comment was marked as resolved.

@seanbudd

This comment was marked as resolved.

@seanbudd seanbudd marked this pull request as draft September 28, 2023 03:25
Copy link
Collaborator

@LeonarddeR LeonarddeR left a comment

Choose a reason for hiding this comment

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

Really love to see this flying!
Before this is merged, I'd like to suggest changing the launcher nsis script so that it has Windows 8.1 as the minimum required version as well.

@AppVeyorBot

This comment was marked as resolved.

@AppVeyorBot

This comment was marked as resolved.

@AppVeyorBot

This comment was marked as resolved.

@seanbudd
Copy link
Member Author

Hi all, this is still a draft PR

@seanbudd
Copy link
Member Author

seanbudd commented Oct 2, 2023

Before this is merged, I'd like to suggest changing the launcher nsis script so that it has Windows 8.1 as the minimum required version as well.

@LeonarddeR

As far as I am aware nvdaLauncher.nsi doesn't check Windows versions

@AppVeyorBot

This comment was marked as resolved.

@codeofdusk
Copy link
Contributor

codeofdusk commented Oct 10, 2023

I've been running this for a while with almost no issues!

Intermitantly, when copying text to the clipboard in Chrome, I get:

Traceback (most recent call last):
  File "api.pyc", line 394, in copyToClip
  File "api.pyc", line 415, in getClipData
  File "contextlib.pyc", line 137, in __enter__
  File "winUser.pyc", line 812, in openClipboard
PermissionError: [WinError 5] Access is denied.

@LeonarddeR
Copy link
Collaborator

@seanbudd Would it be possible to provide a signed try build?

@seanbudd seanbudd marked this pull request as draft October 12, 2023 02:26
Fix-up of #15513 #15514 .

Description of how this pull request fixes the issue:
Add @codeofdusk attributions for Python 3.11 upgrade
@seanbudd
Copy link
Member Author

@LeonarddeR
Copy link
Collaborator

LeonarddeR commented Oct 12, 2023

Thanks for the try build @seanbudd
From my first observations, all seems to work smoothly. That said, it looks like the garbage handler kicks in more often with errors like this:

Log snipped WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Garbage collector has found one or more unreachable objects. See further warnings for specific objects. Stack trace: File "nvda.pyw", line 399, in File "core.pyc", line 813, in main File "wx\core.pyc", line 2262, in MainLoop File "wx\core.pyc", line 3427, in File "core.pyc", line 746, in processRequest File "core.pyc", line 762, in Notify File "queueHandler.pyc", line 97, in pumpAll File "queueHandler.pyc", line 64, in flushQueue File "eventHandler.pyc", line 84, in _queueEventCallback File "eventHandler.pyc", line 322, in executeEvent File "eventHandler.pyc", line 355, in doPreGainFocus File "api.pyc", line 163, in setFocusObject File "treeInterceptorHandler.pyc", line 50, in update File "NVDAObjects\__init__.pyc", line 430, in _get_treeInterceptor File "treeInterceptorHandler.pyc", line 42, in getTreeInterceptor File "NVDAObjects\IAccessible\chromium.pyc", line 84, in __contains__ File "comtypes\_memberspec.pyc", line 482, in __call__ File "comtypes\client\__init__.pyc", line 47, in wrap_outparam File "comtypes\client\__init__.pyc", line 100, in GetBestInterface File "comtypes\client\dynamic.pyc", line 29, in Dispatch File "comtypes\automation.pyc", line 776, in GetTypeInfo File "monkeyPatches\comtypesMonkeyPatches.pyc", line 157, in newGetTypeInfo File "monkeyPatches\comtypesMonkeyPatches.pyc", line 31, in __call__ File "monkeyPatches\comtypesMonkeyPatches.pyc", line 128, in newCpbDel File "garbageHandler.pyc", line 67, in notifyObjectDeletion WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.115) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.116) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.117) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object WARNING - garbageHandler.notifyObjectDeletion (08:34:36.118) - MainThread (17080): Deleting unreachable object ERROR - garbageHandler._collectionCallback (08:34:36.119) - MainThread (17080): Found at least 40 unreachable objects in run

This was observed when arrowing through the list of chats in Teams 2.0.

I think we need to investigate what changes happend to garbage collection. It somehow looks like newer Python 3 is better in detecting abandoned objects itself.

@seanbudd
Copy link
Member Author

@LeonarddeR @codeofdusk - these minor issues will have to be handled in a separate issue/PR, once this has been merged

@seanbudd seanbudd marked this pull request as ready for review October 15, 2023 22:44
Copy link
Member

@michaelDCurran michaelDCurran left a comment

Choose a reason for hiding this comment

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

In order to get maximum testing, I would recommend merging this sooner than later, acknowledging though that brlTTY support is currently not functional and a fix may still be some time away. We should not however branch for beta until a new brlAPI module compatible with Python 3.11 is available of course.

@seanbudd seanbudd removed the blocked label Oct 16, 2023
@seanbudd seanbudd merged commit 01f3e1e into master Oct 16, 2023
@seanbudd seanbudd deleted the py311-min branch October 16, 2023 02:50
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Oct 16, 2023
@LeonarddeR LeonarddeR mentioned this pull request Oct 17, 2023