GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-104399: Use newer libtommath APIs when necessary by chrstphrchvz · Pull Request #104407 · python/cpython

Conversation

@chrstphrchvz

@chrstphrchvz chrstphrchvz commented May 11, 2023 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Tkinter uses deprecated functions mp_to_unsigned_bin_n() and mp_unsigned_bin_size() #104399

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@chrstphrchvz
pythongh-104399: Use newer libtommath APIs if needed
6efacb1
@bedevere-bot bedevere-bot added the awaiting review label May 11, 2023
@bedevere-bot bedevere-bot mentioned this pull request May 11, 2023
Tkinter uses deprecated functions mp_to_unsigned_bin_n() and mp_unsigned_bin_size() #104399
Closed
@chrstphrchvz

chrstphrchvz commented May 11, 2023

Copy link
Copy Markdown
Contributor Author

As with #103842, this requires knowing whether Tcl was built with TCL_WITH_EXTERNAL_TOMMATH defined, which is something not currently available via pkg-config.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gpshead

gpshead commented May 13, 2023

Copy link
Copy Markdown
Member

general thought: We could use a buildbot with bleeding edge versions of tcl/tk

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chrstphrchvz added 2 commits May 17, 2023 15:18
@chrstphrchvz
Add missing newline at end of NEWS
813eff2
@chrstphrchvz
Merge branch 'main' into patch-104399
9fbf468
serhiy-storchaka
serhiy-storchaka reviewed May 31, 2023
View reviewed changes
Comment thread Modules/_tkinter.c Outdated
#endif
#include <tclTomMath.h>

#if defined(TCL_WITH_EXTERNAL_TOMMATH) || (TCL_MAJOR_VERSION >= 9)

@serhiy-storchaka serhiy-storchaka May 31, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The new API is available since 8.6.10. Would not be better to use it as soon as it is available? Potentially it can support larger integers.

Suggested change
#if defined(TCL_WITH_EXTERNAL_TOMMATH) || (TCL_MAJOR_VERSION >= 9)
#if defined(TCL_WITH_EXTERNAL_TOMMATH) || (TK_HEX_VERSION >= 0x0806020a)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@chrstphrchvz chrstphrchvz Jun 2, 2023

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I am not familiar with libtommath APIs nor aware what the exact limits are, but I would think that Tcl is more likely to be the limiting factor anyway, as even the deprecated libtommath functions can handle numbers exceeding what Tcl < 9 can usefully convert to and from (due to various 2**31-1 size limitations on strings, etc.).

Given how Tkinter requires the Tcl version but not the patchlevel to match at compile time and runtime (#104399 (comment)), it should be fine to enable the new functions on Tcl 8.7; this would also allow not having to check for TCL_WITH_EXTERNAL_TOMMATH in this case (although it still has to be checked for #103842).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@serhiy-storchaka serhiy-storchaka Jun 2, 2023

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Agree.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
serhiy-storchaka
serhiy-storchaka reviewed Jun 2, 2023
View reviewed changes
Comment thread Modules/_tkinter.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@serhiy-storchaka
Update Modules/_tkinter.c
ac9f00b
@serhiy-storchaka serhiy-storchaka added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jun 2, 2023
@serhiy-storchaka
serhiy-storchaka merged commit 00d73ca into python:main Jun 6, 2023
@bedevere-bot bedevere-bot removed the awaiting review label Jun 6, 2023
@miss-islington

miss-islington commented Jun 6, 2023

Copy link
Copy Markdown
Contributor

Thanks @chrstphrchvz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 6, 2023
@chrstphrchvz @miss-islington
pythongh-104399: Use newer libtommath APIs when necessary (pythonGH-1…
be66e5e
…04407)

(cherry picked from commit 00d73ca)

Co-authored-by: Christopher Chavez <[email protected]>
@bedevere-bot

bedevere-bot commented Jun 6, 2023

Copy link
Copy Markdown

GH-105343 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jun 6, 2023
@bedevere-bot

bedevere-bot commented Jun 6, 2023

Copy link
Copy Markdown

GH-105344 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jun 6, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 6, 2023
@chrstphrchvz @miss-islington
pythongh-104399: Use newer libtommath APIs when necessary (pythonGH-1…
6af5109
…04407)

(cherry picked from commit 00d73ca)

Co-authored-by: Christopher Chavez <[email protected]>
terryjreedy pushed a commit that referenced this pull request Jun 6, 2023
@miss-islington @chrstphrchvz
[3.12] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (
27cbeb0
#105343)

gh-104399: Use newer libtommath APIs when necessary (GH-104407)
(cherry picked from commit 00d73ca)

Co-authored-by: Christopher Chavez <[email protected]>
terryjreedy pushed a commit that referenced this pull request Jun 6, 2023
@miss-islington @chrstphrchvz
[3.11] gh-104399: Use newer libtommath APIs when necessary (GH-104407) (
c644fe4
#105344)

gh-104399: Use newer libtommath APIs when necessary (GH-104407)
(cherry picked from commit 00d73ca)

Co-authored-by: Christopher Chavez <[email protected]>
@chrstphrchvz
chrstphrchvz deleted the patch-104399 branch June 9, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@chrstphrchvz @gpshead @miss-islington @bedevere-bot @serhiy-storchaka
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.