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-139374: colorize `timeit` error traceback by yihong0618 · Pull Request #139375 · python/cpython

Conversation

@yihong0618

@yihong0618 yihong0618 commented Sep 27, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

after this patch
image

  • Issue: Colorize timeit error traceback #139374

Sorry, something went wrong.

Uh oh!

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

All reactions
@yihong0618
fix: make timeit traceback can with color
beed64f
Signed-off-by: yihong0618 <[email protected]>
@bedevere-app bedevere-app Bot mentioned this pull request Sep 27, 2025
Colorize timeit error traceback #139374
Closed
@yihong0618
yihong0618 marked this pull request as ready for review September 27, 2025 00:27
@bedevere-app bedevere-app Bot added the awaiting review label Sep 27, 2025
@yihong0618
yihong0618 marked this pull request as draft September 27, 2025 00:40
@bedevere-app bedevere-app Bot removed the awaiting review label Sep 27, 2025
@yihong0618
fix: test with color
0a90dc8
Signed-off-by: yihong0618 <[email protected]>
StanFromIreland
StanFromIreland reviewed Sep 27, 2025
View reviewed changes
Comment thread Lib/test/test_timeit.py Resolved

Uh oh!

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

Comment thread Misc/NEWS.d/next/Library/2025-09-27-08-26-31.gh-issue-139374.hfh-dl.rst Resolved

Uh oh!

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

@StanFromIreland
StanFromIreland requested a review from ambv September 27, 2025 08:13
@picnixz picnixz changed the title gh-139374: make timeit traceback can with color gh-139374: colorize timeit error traceback Sep 27, 2025
yihong0618 and others added 2 commits September 27, 2025 16:39
@yihong0618 @StanFromIreland
Update Misc/NEWS.d/next/Library/2025-09-27-08-26-31.gh-issue-139374.h…
74ae169
…fh-dl.rst

Co-authored-by: Stan Ulbrych <[email protected]>
@yihong0618
fix: address comments
f798c4e
Signed-off-by: yihong0618 <[email protected]>
@yihong0618
yihong0618 marked this pull request as ready for review September 27, 2025 08:44
@bedevere-app bedevere-app Bot added the awaiting review label Sep 27, 2025
@yihong0618
fix: make force color the right place
8553969
Signed-off-by: yihong0618 <[email protected]>
hugovk
hugovk reviewed Sep 27, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

@yihong0618 @hugovk
Update Lib/timeit.py
b670346
Co-authored-by: Hugo van Kemenade <[email protected]>
@yihong0618
yihong0618 requested a review from hugovk September 27, 2025 11:27
@Wulian233

Wulian233 commented Sep 27, 2025

Copy link
Copy Markdown
Contributor

Is this worth writing into what's new in 3.15? Maybe we can do it later

https://github.com/python/cpython/blob/main/Doc/whatsnew/3.14.rst#L97-L101

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz

picnixz commented Sep 27, 2025

Copy link
Copy Markdown
Member

Is this worth writing into what's new in 3.15? Maybe we can do it later

Yes. And we should add it in this PR not in a separate one.

All reactions

Sorry, something went wrong.

Uh oh!

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

ZeroIntensity
ZeroIntensity reviewed Sep 27, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

Comment thread Misc/NEWS.d/next/Library/2025-09-27-08-26-31.gh-issue-139374.hfh-dl.rst Resolved

Uh oh!

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

yihong0618 and others added 2 commits September 28, 2025 09:00
@yihong0618 @ZeroIntensity
Update Misc/NEWS.d/next/Library/2025-09-27-08-26-31.gh-issue-139374.h…
80097e8
…fh-dl.rst

Co-authored-by: Peter Bierma <[email protected]>
@yihong0618
fix: address comments
ad7dfe1
Signed-off-by: yihong0618 <[email protected]>
@yihong0618

yihong0618 commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

Is this worth writing into what's new in 3.15? Maybe we can do it later

Yes. And we should add it in this PR not in a separate one.

will try to learn how to add it...

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland

StanFromIreland commented Sep 28, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

You can look at existing entries for inspiration, e.g.:

Unraisable exceptions are now highlighted with color by default. This can be controlled by environment variables. (Contributed by Peter Bierma in gh-134170.)

In this case, under "timeit", something along the lines of:

Error tracebacks are now colourised by default. This can be controlled by environment variables. (Contributed by YOU in gh-PRNO.)

All reactions

Sorry, something went wrong.

Uh oh!

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

@yihong0618

yihong0618 commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

You can look at existing entries for inspiration, e.g.:

Unraisable exceptions are now highlighted with color by default. This can be controlled by environment variables. (Contributed by Peter Bierma in gh-134170.)

In this case, under "timeit", something along the lines of:

Error tracebacks are now colourised by default. This can be controlled by environment variables. (Contributed by YOU in gh-PRNO.)

Thank you very much!

All reactions

Sorry, something went wrong.

Uh oh!

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

picnixz
picnixz reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

@yihong0618
fix: address comments
0123a6a
Signed-off-by: yihong0618 <[email protected]>
@yihong0618
yihong0618 requested a review from AA-Turner as a code owner September 28, 2025 09:23
picnixz
picnixz reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

picnixz
picnixz reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

@yihong0618 @picnixz
Update Lib/timeit.py
ee2732f
Co-authored-by: Bénédikt Tran <[email protected]>
picnixz
picnixz reviewed Sep 28, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

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

Comment thread Lib/timeit.py Resolved

Uh oh!

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

@yihong0618 @picnixz
Apply suggestions from code review
b76c3ff
Co-authored-by: Bénédikt Tran <[email protected]>
StanFromIreland
StanFromIreland reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

yihong0618 added 2 commits September 28, 2025 19:02
@yihong0618
fix: apply suggestions
89fed11
Signed-off-by: yihong0618 <[email protected]>
@yihong0618
fix: drop useless code
b797dbb
Signed-off-by: yihong0618 <[email protected]>
picnixz
picnixz approved these changes Sep 28, 2025
View reviewed changes

@picnixz picnixz left a comment

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.

Sorry for my back-and-forth suggestions but it's to ease future maintenance.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/timeit.py Resolved

Uh oh!

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

Comment thread Lib/timeit.py Resolved

Uh oh!

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

Comment thread Lib/timeit.py Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Sep 28, 2025
@yihong0618

yihong0618 commented Sep 28, 2025

Copy link
Copy Markdown
Contributor Author

Sorry for my back-and-forth suggestions but it's to ease future maintenance.

I enjoyed learning, thank you very much for the hint. really, changing now

All reactions

Sorry, something went wrong.

Uh oh!

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

@yihong0618 @picnixz
Apply suggestions from code review
7409fc4
Co-authored-by: Bénédikt Tran <[email protected]>
StanFromIreland
StanFromIreland reviewed Sep 28, 2025
View reviewed changes
Comment thread Doc/whatsnew/3.15.rst Resolved

Uh oh!

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

picnixz
picnixz reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/test/test_timeit.py Resolved

Uh oh!

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

@yihong0618
fix: move import
ec2cead
Signed-off-by: yihong0618 <[email protected]>
picnixz
picnixz reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/test/test_timeit.py Resolved

Uh oh!

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

yihong0618 and others added 2 commits September 28, 2025 19:19
@yihong0618 @StanFromIreland @picnixz
Apply suggestions from code review
7d2d2da
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Bénédikt Tran <[email protected]>
@yihong0618 @picnixz
Update Lib/test/test_timeit.py
f6d9da2
Co-authored-by: Bénédikt Tran <[email protected]>
picnixz
picnixz approved these changes Sep 28, 2025
View reviewed changes

@picnixz picnixz left a comment

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.

Now this is good. Thanks for the patch!

Sorry, something went wrong.

Uh oh!

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

yihong0618 reacted with heart emoji
All reactions
  • ❤️ 1 reaction
StanFromIreland
StanFromIreland approved these changes Sep 28, 2025
View reviewed changes

@StanFromIreland StanFromIreland left a comment

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.

LGTM

Sorry, something went wrong.

Uh oh!

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

yihong0618 reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@picnixz
picnixz enabled auto-merge (squash) September 28, 2025 11:21
@picnixz
picnixz merged commit e18dda9 into python:main Sep 28, 2025
4 checks passed

Uh oh!

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

@bedevere-app bedevere-app Bot removed the awaiting merge label Sep 28, 2025
@bedevere-bot

bedevere-bot commented Sep 28, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 CentOS9 NoGIL Refleaks 3.x (tier-1) has failed when building commit e18dda9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1610/builds/2134) and take a look at the build logs.
  4. Check if the failure is related to this commit (e18dda9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1610/builds/2134

Failed tests:

  • test_free_threading

Test leaking resources:

  • test_free_threading: file descriptors

Summary of the results of the build (if available):

==

Click to see traceback logs
remote: Enumerating objects: 15, done.        
remote: Counting objects:   8% (1/12)        
remote: Counting objects:  16% (2/12)        
remote: Counting objects:  25% (3/12)        
remote: Counting objects:  33% (4/12)        
remote: Counting objects:  41% (5/12)        
remote: Counting objects:  50% (6/12)        
remote: Counting objects:  58% (7/12)        
remote: Counting objects:  66% (8/12)        
remote: Counting objects:  75% (9/12)        
remote: Counting objects:  83% (10/12)        
remote: Counting objects:  91% (11/12)        
remote: Counting objects: 100% (12/12)        
remote: Counting objects: 100% (12/12), done.        
remote: Compressing objects:  11% (1/9)        
remote: Compressing objects:  22% (2/9)        
remote: Compressing objects:  33% (3/9)        
remote: Compressing objects:  44% (4/9)        
remote: Compressing objects:  55% (5/9)        
remote: Compressing objects:  66% (6/9)        
remote: Compressing objects:  77% (7/9)        
remote: Compressing objects:  88% (8/9)        
remote: Compressing objects: 100% (9/9)        
remote: Compressing objects: 100% (9/9), done.        
remote: Total 15 (delta 3), reused 3 (delta 3), pack-reused 3 (from 2)        
From https://github.com/python/cpython
 * branch                    main       -> FETCH_HEAD
Note: switching to 'e18dda96c967911fe387ed93c7efe105e7cc1274'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at e18dda96c96 gh-139374: colorize traceback when using `timeit` command-line interface (#139375)
Switched to and reset branch 'main'

configure: WARNING: no system libmpdec found; falling back to pure-Python version for the decimal module

make: *** [Makefile:2487: buildbottest] Error 2
All reactions

Sorry, something went wrong.

Uh oh!

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

mpkocher
mpkocher reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/traceback.py Resolved

Uh oh!

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

mpkocher
mpkocher reviewed Sep 28, 2025
View reviewed changes
Comment thread Lib/timeit.py Resolved

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@picnixz picnixz picnixz approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity left review comments
@StanFromIreland StanFromIreland StanFromIreland approved these changes
@ambv ambv Awaiting requested review from ambv
@hugovk hugovk Awaiting requested review from hugovk
@AA-Turner AA-Turner Awaiting requested review from AA-Turner AA-Turner is a code owner
+1 more reviewer
@mpkocher mpkocher mpkocher left review comments
Reviewers whose approvals may not affect merge requirements

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.

8 participants

@yihong0618 @Wulian233 @picnixz @StanFromIreland @bedevere-bot @mpkocher @hugovk @ZeroIntensity
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.