[PyKDE] [eric3] redirect stdin/out/err

Guest007 trash4 at yandex.ru
Wed Jul 13 09:51:58 BST 2005


hi!
> If your program throws an exception, that should be shown by eric3. If it
> isn't please try to create a test script, that shows the observed behaviour
> and send it to me.
small test script
==============
from sqlobject import *
import datetime
conn = 'sqlite:/:memory:'
__connection__ = conn
class test1(SQLObject):
    date=DateTimeCol()
test1.createTable()
t = test1(date=datetime.datetime(1800,1,1))
print t.date
==============

1) If in datetime.datetime(1800,1,1) I'll set a correct date (>1900), than I 
can see output in _Shell_ window if 
Settings->Preferences->Debugger->Python->Redirect stdin/stdout/stderr is set. 
If this check box not set -- I don't see my stdout anywere in GUI (only in 
text console, if I start eric3 by hand). Log-Viewer always empty.

2) If I run provided script as-is -- it trows an exception. This exception 
trown by SQLObject due to incorrect date.
	2.1) stdout and stderr in Log-Viewer are still empty.
	2.2) No one place in system, where I can find full content of trown exception
	2.3) I receive window (look at picture). I'm send screenshot because I can't 
select this text! This window don't show me a real place of mistake, don't 
give me a full text of exception, don't give me a chance to select, which 
file/line I want to see after press button.
	2.4) Automatically opens a pointed file (converters.py) and cursor placed in 
line 180. I must return to my script by hand and try to nick, where is 
problem.

3) I'm propose:
	3.1) Return functionality of Log-Viewer
	3.2) remake error window to be 
		3.2.1) optional
		3.2.2) contained full text of exception with interaction (selectable, 
clickable) and with ability to decide, which file/line will opens after press 
button.

Thank you, Detlev, for your great job! Hope eric3 will be better and better.

>
> Detlev

-- 
WBR Guest007
JID: guest007 at jabber.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: error.png
Type: image/png
Size: 16787 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20050713/30e5555a/error.png
-------------- next part --------------
Traceback (most recent call last):
  File "1.py", line 13, in ?
    t = test1(date=datetime.datetime(1800,1,1))
  File "/home/guest007/lib/python/sqlobject/main.py", line 1067, in __init__
    self._create(id, **kw)
  File "/home/guest007/lib/python/sqlobject/main.py", line 1100, in _create
    self._SO_finishCreate(id)
  File "/home/guest007/lib/python/sqlobject/main.py", line 1124, in _SO_finishCreate
    id, names, values)
  File "/home/guest007/lib/python/sqlobject/dbconnection.py", line 355, in queryInsertID
    return self._runWithConnection(self._queryInsertID, soInstance, id, names, values)
  File "/home/guest007/lib/python/sqlobject/dbconnection.py", line 217, in _runWithConnection
    val = meth(conn, *args)
  File "/home/guest007/lib/python/sqlobject/sqlite/sqliteconnection.py", line 84, in _queryInsertID
    q = self._insertSQL(table, names, values)
  File "/home/guest007/lib/python/sqlobject/sqlite/sqliteconnection.py", line 102, in _insertSQL
    return DBAPI._insertSQL(self, table, names, values)
  File "/home/guest007/lib/python/sqlobject/dbconnection.py", line 347, in _insertSQL
    return ("INSERT INTO %s (%s) VALUES (%s)" %
  File "/home/guest007/lib/python/sqlobject/dbconnection.py", line 639, in sqlrepr
    return sqlrepr(v, self.dbName)
  File "/home/guest007/lib/python/sqlobject/converters.py", line 202, in sqlrepr
    return converter(obj, db)
  File "/home/guest007/lib/python/sqlobject/converters.py", line 180, in DateTimeConverter
    return value.strftime("'%Y-%m-%d %H:%M:%S'")
ValueError: year=1800 is before 1900; the datetime strftime() methods require year >= 1900


More information about the PyQt mailing list