[ python-Bugs-1754453 ] Docstring for codecs.lookup is incorrect

2007-07-15 Thread SourceForge.net
Bugs item #1754453, was opened at 2007-07-15 17:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1754453&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Omari Norman (massysett)
Assigned to: Nobody/Anonymous (nobody)
Summary: Docstring for codecs.lookup is incorrect

Initial Comment:
The docstring for codecs.lookup states that this function returns a tuple of 
functions. I understand this was correct in Python 2.4, but in Python 2.5 this 
function returns a CodecInfo object, as described in the docs:

http://docs.python.org/lib/module-codecs.html

I've got Python 2.5.1.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1754453&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1754456 ] "yield" causes strange behaviour

2007-07-15 Thread SourceForge.net
Bugs item #1754456, was opened at 2007-07-16 00:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1754456&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: "yield" causes strange behaviour

Initial Comment:
Running the attached files produces:
ONE PASS

However if you uncomment line 46 and run the file again, you don't get any 
output.

A pdb session of the file produces:
[EMAIL PROTECTED]:python-bug - 14:14] $pdb yield.py 
> /home/mtebeka/work/python-bug/yield.py(3)()
-> from imaplib import IMAP4
(Pdb) b 72
Breakpoint 1 at /home/mtebeka/work/python-bug/yield.py:72
(Pdb) c
> /home/mtebeka/work/python-bug/yield.py(72)main()
-> one_pass()
(Pdb) s
--Call--
/usr/local/lib/python2.5/bdb.py:318: RuntimeWarning: tp_compare didn't return 
-1 or -2 for exception
  i = max(0, len(stack) - 1)
The program finished and will be restarted
> /home/mtebeka/work/python-bug/yield.py(3)()
-> from imaplib import IMAP4
(Pdb) q
[EMAIL PROTECTED]:python-bug - 14:15] $

(Sorry for the length of the example, this is the smaller version that still 
reproduces the bug)

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1754456&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1752539 ] RotatingFileHandler.doRollover behave wrong vs. log4j's

2007-07-15 Thread SourceForge.net
Bugs item #1752539, was opened at 2007-07-12 18:34
Message generated for change (Comment added) made by jinq0123
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1752539&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jin Qing (jinq0123)
Assigned to: Vinay Sajip (vsajip)
Summary: RotatingFileHandler.doRollover behave wrong vs. log4j's

Initial Comment:
RotatingFileHandler.doRollover() will raise exception on rename() and cause all 
the subsequent log messages lost.

But log4j is better. It ignore the rename() error and reset the log file.

I read "[ 979252 ] Trap OSError when calling RotatingFileHandler.doRollover ( 
https://sourceforge.net/tracker/index.php?func=detail&aid=979252&group_id=5470&atid=105470
 )", and think David London (groodude)'s solution is closer to log4j.

At least, python logging implementation should follow log4j's behavior, or 
improve it, such as only discard the current one message. 

logging should be easy to use.

--

>Comment By: Jin Qing (jinq0123)
Date: 2007-07-16 11:05

Message:
Logged In: YES 
user_id=692544
Originator: YES

Calling handleError is a workaround, not the correct way of log4j.  This
is Python, and should be easy to use. Subclass & override is a little hard
to use. If it is required for every users to subclass or patch
RotatingFileHandler to use it, so why not patch it in the released version?
Everybody expect logging module has a behavior in common with log4j.

The exception of rename() is real. rename() fails if the source file is
locked. I found UltraEdit will lock file. Others say tail -f will lock file
too. 

In C++ or java, rename() just returns error, but Python raises exception
and causes different logging behavior. Why not just ignore the exception of
rename()? Or try rename() and finally open the log file?

By the way, log4j is much more robust on opening the log file. It will
create the parent directories and retry if open failed. Python logging
should learn from log4j.

--

Comment By: Vinay Sajip (vsajip)
Date: 2007-07-14 01:51

Message:
Logged In: YES 
user_id=308438
Originator: NO

The system was modified in the fix for #979252 to call handleError when an
error occurred during the emit() processing.

I am travelling and do not have access to my systems at the moment, so
cannot commit to look at this just yet.

For now, users are free to subclass the RotatingFileHandler and override
handleError however they want, including implementing groodude's solution,
which (as he says in his comments) is a band-aid to cover unknown error
conditions. Since there is no good reason for the rename to fail, I would
suggest to the poster to see if he can find out why he is getting exception
on rename; and I will give this some thought when I next have time, but
that will not be just yet, and until then I suggest using the
subclass/override approach.

I'll leave it open to remind me to look at it, but I believe the
workarounds I have suggested are not unreasonable for now.

--

Comment By: Neal Norwitz (nnorwitz)
Date: 2007-07-13 11:47

Message:
Logged In: YES 
user_id=33168
Originator: NO

Vinay, could you take a look?  Thanks.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1752539&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com