Skip to content
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

Py_DisplaySourceLine is not documented #47593

Closed
amauryfa opened this issue Jul 11, 2008 · 3 comments
Closed

Py_DisplaySourceLine is not documented #47593

amauryfa opened this issue Jul 11, 2008 · 3 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@amauryfa
Copy link
Member

BPO 3343
Nosy @brettcannon, @amauryfa

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/brettcannon'
closed_at = <Date 2008-07-11.21:46:14.186>
created_at = <Date 2008-07-11.12:20:46.174>
labels = ['interpreter-core', 'type-bug']
title = 'Py_DisplaySourceLine is not documented'
updated_at = <Date 2008-07-11.21:46:14.184>
user = 'https://github.com/amauryfa'

bugs.python.org fields:

activity = <Date 2008-07-11.21:46:14.184>
actor = 'amaury.forgeotdarc'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2008-07-11.21:46:14.186>
closer = 'amaury.forgeotdarc'
components = ['Interpreter Core']
creation = <Date 2008-07-11.12:20:46.174>
creator = 'amaury.forgeotdarc'
dependencies = []
files = []
hgrepos = []
issue_num = 3343
keywords = []
message_count = 3.0
messages = ['69548', '69556', '69565']
nosy_count = 2.0
nosy_names = ['brett.cannon', 'amaury.forgeotdarc']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3343'
versions = ['Python 2.6']

@amauryfa
Copy link
Member Author

This new function is not documented at all.
And I find the error handling not consistent: when filename is NULL, -1
is returned, but no exception is set.

IMO the return code should be as follow:

  • return 1 if a line was printed
  • return 0 if the line cannot be found
  • return -1 in case of error (when calling PyFile_WriteString); an
    exception is set.

@amauryfa amauryfa added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Jul 11, 2008
@brettcannon
Copy link
Member

The function should be made private as it is not expected to be called
by anyone else but the core.

@brettcannon brettcannon self-assigned this Jul 11, 2008
@amauryfa
Copy link
Member Author

r64881: Py_DisplaySourceLine is renamed to _Py_DisplaySourceLine

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants