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-125843: indicate which C function caused a `curses.error` by picnixz · Pull Request #125844 · python/cpython

Conversation

@picnixz

@picnixz picnixz commented Oct 22, 2024 •
edited by github-actions Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: Improve error messages of curses by indicating failed C function #125843

📚 Documentation preview 📚: https://cpython-previews--125844.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

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

All reactions
picnixz added 5 commits October 22, 2024 16:23
@picnixz
improve curses.error object
03fc9c5
@picnixz
update error messages
3436f9b
@picnixz
cosmetic changes!
73ce26c
@picnixz
blurb
cfe5468
@picnixz
update docs
a8845ee
@bedevere-app bedevere-app Bot added the awaiting review label Oct 22, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Oct 22, 2024
Improve error messages of curses by indicating failed C function #125843
Closed
@picnixz picnixz mentioned this pull request Oct 22, 2024
Cleaning up generating macros in _cursesmodule.c #125354
Closed
@picnixz
Merge remote-tracking branch 'upstream/main' into x-stale/feat/curses…
1b1230d
…/error-type-125843
@picnixz
picnixz marked this pull request as draft April 25, 2025 11:02
@bedevere-app bedevere-app Bot removed the awaiting review label Apr 25, 2025
picnixz added 7 commits April 25, 2025 13:11
@picnixz
reduce diff
55a491a
@picnixz
reduce diff even futher
758dfe5
@picnixz
simplify logic
3a3964b
@picnixz
simplify logic x2
92e62cf
@picnixz
reduce diff again!
4d8f47f
@picnixz
simplify logic x3
5b8ff99
@picnixz
lint
43d2e99
@picnixz picnixz changed the title gh-125843: store the name of the curses C function or macro in curses.error gh-125843: include which C function caused a curses.error Apr 25, 2025
@picnixz picnixz changed the title gh-125843: include which C function caused a curses.error gh-125843: indicate which C function caused a curses.error Apr 25, 2025
@picnixz
picnixz marked this pull request as ready for review April 25, 2025 19:35
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 25, 2025
picnixz
picnixz commented Apr 25, 2025
View reviewed changes
Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

picnixz
picnixz commented Apr 25, 2025
View reviewed changes
Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

@picnixz
reduce diff x4
12f0b30
picnixz
picnixz commented Apr 25, 2025
View reviewed changes
Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

@picnixz
reduce diff x5
eaaad71
picnixz
picnixz commented Apr 25, 2025
View reviewed changes

@picnixz picnixz left a comment

Copy link
Copy Markdown
Member 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.

Actually, there are some funcname that should be corrected but I need to see how they should really be corrected.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

@picnixz
picnixz marked this pull request as draft April 25, 2025 19:50
@bedevere-app bedevere-app Bot removed the awaiting core review label Apr 25, 2025
@picnixz

picnixz commented May 7, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

I've decided to keep the explicit calls to reduce the number of helper functions. When the python function name is the same, the caller needs to pass NULL. It also avoids the _from suffixes. I also updated the _curses_panel module that I totally forgot.

Note: I can actually delay the curses_panel changes for a follow-up PR btw.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz
picnixz requested a review from encukou May 7, 2025 12:35
@picnixz picnixz mentioned this pull request May 18, 2025
Exact reporting of curses C function failures #133579
Closed
picnixz added 2 commits May 19, 2025 12:26
@picnixz
raise curses.error in is_linetouched instead of TypeError
8188179
@picnixz
Revert "update error messages in _curses_panel"
9e6c83e
This reverts commit 236bea5.
@picnixz

picnixz commented May 19, 2025

Copy link
Copy Markdown
Member Author

I'll make a separate PR for _curses.panel as I want to merge the curses part now.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz picnixz added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 19, 2025
@bedevere-bot

This comment was marked as resolved.

Sign in to view
@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 19, 2025
@picnixz

This comment was marked as resolved.

Sign in to view
@picnixz
fix typo
3989ddd
@picnixz picnixz added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 19, 2025
@bedevere-bot

This comment was marked as resolved.

Sign in to view
@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 19, 2025
picnixz added 2 commits May 19, 2025 12:51
@picnixz
correctly check mouseinterval return value
bf54774
@picnixz
Merge remote-tracking branch 'upstream/main' into feat/curses/error-t…
34a1c31
…ype-125843
@picnixz picnixz added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 19, 2025
@bedevere-bot

bedevere-bot commented May 19, 2025

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @picnixz for commit 34a1c31 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F125844%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label May 19, 2025
encukou
encukou approved these changes May 19, 2025
View reviewed changes

@encukou encukou 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.

OK, let's do it!
Thank you!

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

Comment thread Modules/_cursesmodule.c Resolved

Uh oh!

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

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 19, 2025
@picnixz @encukou
reduce overall diff
6be3a15
Co-authored-by: Petr Viktorin <[email protected]>
@picnixz
picnixz merged commit ee36db5 into python:main May 19, 2025
@picnixz
picnixz deleted the curses/improve-error-type-125843 branch May 19, 2025 13:53
@bedevere-app bedevere-app Bot removed the awaiting merge label May 19, 2025
@picnixz

picnixz commented May 19, 2025

Copy link
Copy Markdown
Member Author

Ok, so actually I broke another build bot. However, it's good that it's broken because this means that either my function call is wrong or something else was wrong.

All reactions

Sorry, something went wrong.

Uh oh!

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

@picnixz picnixz mentioned this pull request May 24, 2025
gh-133579: correctly report C curses errors in _curses_panel #134629
Merged
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@picnixz @Pranjal095
pythongh-125843: indicate which C function caused a curses.error (p…
0b23603
…ython#125844)

- Rename error helpers with a `curses_set_error_*` prefix instead of `PyCurses*`.
- Cleanly report both NULL and ERR cases.
- Raise `curses.error` in `is_linetouched` instead of a `TypeError`.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@picnixz @taegyunkim
pythongh-125843: indicate which C function caused a curses.error (p…
ec53a92
…ython#125844)

- Rename error helpers with a `curses_set_error_*` prefix instead of `PyCurses*`.
- Cleanly report both NULL and ERR cases.
- Raise `curses.error` in `is_linetouched` instead of a `TypeError`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou approved these changes
@Yhg1s Yhg1s Awaiting requested review from Yhg1s

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.

3 participants

@picnixz @bedevere-bot @encukou
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.