[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-23 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Commited: r80404 (py3k), r80405 (3.1).

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Attached patch fixes this issue: PyFile_WriteObject() doesn't call 
PyObject_Str() to avoid PyErr_CheckSignals(). I'm not sure that it's the right 
approch because it may change the behaviour of existing code when getting a 
signal.

--
keywords: +patch
Added file: http://bugs.python.org/file17044/pyfile_writeobject_nosignal.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Ok, forget my pyfile_writeobject_nosignal.patch, it's not the right approach.

New patch: mywrite() uses its own implementation PyFile_WriteString(), 
sys_pyfile_write(), which doesn't call PyErr_CheckSignals():


/* Implementation of PyFile_WriteString() no calling PyErr_CheckSignals():
 * mywrite() should not execute any Python signal handler to avoid raising an
 * error because mywrite() ignores all errors */

--
Added file: http://bugs.python.org/file17045/mywrite_nosignal.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


Removed file: http://bugs.python.org/file17044/pyfile_writeobject_nosignal.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-22 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The goal is this issue is also to catch SIGINT when starting Python. It now 
works in Python trunk and py3k, but not in verbose mode because mywrite() eats 
errors (especially the KeyboardInterrupt raised by the default SIGINT handler) 
and calls indirectly Python signal handlers.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-04-20 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Another solution: disable call to PyErr_CheckSignals() in mywrite().

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8124] mywrite() ignores PyFile_WriteString() errors

2010-03-12 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

PyFile_WriteString() calls PyObject_Str() which calls PyErr_CheckSignals(). If 
a signal was catched, the signal handler is called. If the signal handler 
raises an error, PyObject_Str() and then PyFile_WriteString() return NULL.

mywrite() ignores all PyFile_WriteString() errors. It should maybe only ignores 
errors from the file (except IOError: ...) and not any error.

Another problem: mywrite() is called from PySys_WriteStdout() and 
PySys_WriteStderr() which are procedures. 
PySys_WriteStdout()/PySys_WriteStderr() caller cannot detect the error. There 
are 65 calls to PySys_WriteStd...

--
components: Interpreter Core
messages: 100939
nosy: haypo
severity: normal
status: open
title: mywrite() ignores PyFile_WriteString() errors
type: behavior
versions: Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8124
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com