Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue6446] import_spam() in extending python can fail without setting the error.

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Jul 9, 2009, 4:31 AM

Post #1 of 2 (168 views)
Permalink
[issue6446] import_spam() in extending python can fail without setting the error.

New submission from Julian Andres Klode <jak [at] jak-linux>:

The given example function initspam fails if an

Based on some experience with my own code, I have found out that the
function import_spam() fails when the module is not importable. In this
case, it returns 0, although it should return -1 when an error occurs.

This causes a standalone program to crash if it has a main() function like:

Py_Initialize();
if (import_spam() < 0) {
Py_Finalize();
return 1;
}
Py_Finalize();

The function should return -1, so we can know there is an error and are
able to handle it.

----------
assignee: georg.brandl
components: Documentation
messages: 90325
nosy: georg.brandl, jak
severity: normal
status: open
title: import_spam() in extending python can fail without setting the error.
type: crash
versions: Python 2.6

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6446>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jul 11, 2009, 3:15 AM

Post #2 of 2 (155 views)
Permalink
[issue6446] import_spam() in extending python can fail without setting the error. [In reply to]

Georg Brandl <georg [at] python> added the comment:

Thanks, fixed in r73938.

----------
resolution: -> fixed
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue6446>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.