Skip to content

Conversation

yihong0618
Copy link
Contributor

@yihong0618 yihong0618 commented Sep 27, 2025

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618 yihong0618 marked this pull request as ready for review September 27, 2025 00:27
@yihong0618 yihong0618 marked this pull request as draft September 27, 2025 00:40
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@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
…fh-dl.rst

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618 yihong0618 marked this pull request as ready for review September 27, 2025 08:44
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@yihong0618 yihong0618 requested a review from hugovk September 27, 2025 11:27
@Wulian233
Copy link
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

@picnixz
Copy link
Member

picnixz commented Sep 27, 2025

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.

yihong0618 and others added 2 commits September 28, 2025 09:00
…fh-dl.rst

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
@yihong0618
Copy link
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...

@StanFromIreland
Copy link
Member

StanFromIreland commented Sep 28, 2025

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.)

@yihong0618
Copy link
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!

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Copy link
Member

@picnixz picnixz left a 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.

@yihong0618
Copy link
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

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong0618 and others added 2 commits September 28, 2025 19:19
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Copy link
Member

@picnixz picnixz left a 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!

Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

LGTM

@picnixz picnixz enabled auto-merge (squash) September 28, 2025 11:21
@picnixz picnixz merged commit e18dda9 into python:main Sep 28, 2025
45 checks passed
@bedevere-bot
Copy link

⚠️⚠️⚠️ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants