[ python-Bugs-698706 ] imaplib: parsing INTERNALDATE

2005-11-26 Thread SourceForge.net
Bugs item #698706, was opened at 2003-03-06 14:45
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=698706&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.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Konrad Hinsen (hinsen)
Assigned to: Piers Lauder (pierslauder)
Summary: imaplib: parsing INTERNALDATE

Initial Comment:
The regular expression InternalDate in imaplib does not 
match dates in which the day number is two-digit with a 
leading zero.

>From a cursory glance at the IMAP definition, this is a 
legal format, and there is at least one IMAP server that 
uses it (courier-imap).

The attached patch is for Python 2.2.2, but the problem still 
exists in 2.3a2.


--

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-11-26 17:32

Message:
Logged In: YES 
user_id=1188172

Already corrected in the 2.5 branch. Corrected in the 2.4
branch in revision 41547.

--

Comment By: Facundo Batista (facundobatista)
Date: 2005-01-15 13:41

Message:
Logged In: YES 
user_id=752496

This patch is not yet applied in CVS.

Piers, I assign this to you because you know the module, but
the patch is pretty simple, it's just adding a 0 to a part
of the InternalDate's re:

From: (?P[ 123]
To: (?P[ 0123]



--

Comment By: Tony Meyer (anadelonbrin)
Date: 2004-04-23 03:43

Message:
Logged In: YES 
user_id=552329

This is correct, RFC 2060 allows for the date to be
"2digit", where digit includes 0.  There is no attached
patch, but I can't attach to this tracker, so I'm putting it
here in the comment (it's a one character change).  This
still exists in 2004-04-23 anon cvs.

*** imaplib.py  Fri Apr 23 13:40:32 2004
--- imaplib-fixed.pyFri Apr 23 13:42:31 2004
***
*** 79,85 
  Continuation = re.compile(r'\+( (?P.*))?')
  Flags = re.compile(r'.*FLAGS \((?P[^\)]*)\)')
  InternalDate = re.compile(r'.*INTERNALDATE "'
! r'(?P[
123][0-9])-(?P[A-Z][a-z][a-z])-(?P[0-9][0-9][0-
9][0-9])'
  r'
(?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'
  r'
(?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'
  r'"')
--- 79,85 
  Continuation = re.compile(r'\+( (?P.*))?')
  Flags = re.compile(r'.*FLAGS \((?P[^\)]*)\)')
  InternalDate = re.compile(r'.*INTERNALDATE "'
! r'(?P[
0123][0-9])-(?P[A-Z][a-z][a-z])-(?P[0-9][0-9][0
-9][0-9])'
  r'
(?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'
  r'
(?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'
  r'"')

--

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



[ python-Bugs-1366250 ] incorrect documentation for optparse

2005-11-26 Thread SourceForge.net
Bugs item #1366250, was opened at 2005-11-25 13:22
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1366250&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: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Dunn (popuptoaster)
>Assigned to: Greg Ward (gward)
Summary: incorrect documentation for optparse

Initial Comment:
The page
http://www.python.org/doc/current/lib/optparse-parsing-arguments.html
in the current documentation has text with an incorrect
example:

"""
6.21.3.7 Parsing arguments
The whole point of creating and populating an
OptionParser is to call its parse_args() method:
(options, args) = parser.parse_args(args=None,
options=None)
where the input parameters are
args
 the list of arguments to process (sys.argv[1:] by
default) 
options
 object to store option arguments in (a new instance of
optparse.Values by default)
"""

The example should be changed to:

(options, args) = parser.parse_args(args=None,
values=None)
^^

And then there should be a correstponding substition
below in the explanation of the keyword arguments:

values
^^
 object to store option arguments in (a new instance of
optparse.Values by default)

Cheers, Michael

--

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-11-26 17:37

Message:
Logged In: YES 
user_id=1188172

Assigning to Greg as he maintains the upstream Optik
distribution.

--

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



[ python-Bugs-1365984 ] urllib cannot open data: urls

2005-11-26 Thread SourceForge.net
Bugs item #1365984, was opened at 2005-11-25 02:20
Message generated for change (Settings changed) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1365984&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.4
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Warren Butler (grumpymole)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib cannot open data: urls

Initial Comment:
Python 2.4.2 cannot open data: urls using open_data().

Appears to be because of importing cStringIO and not
being able to reference fileno.

==
Example fail output:

Traceback (most recent call last):
  File "test_open_data.py", line 6, in ?
response = opener.open("data:,A%20brief%20note")
  File "/usr/lib/python2.4/urllib.py", line 185, in open
return getattr(self, name)(url)
  File "/usr/lib/python2.4/urllib.py", line 559, in
open_data
f.fileno = None # needed for addinfourl
AttributeError: 'cStringIO.StringI' object has no
attribute 'fileno'

==
Example code to generate failure:

import urllib

# data:,A%20brief%20note

opener = urllib.URLopener()
response = opener.open("data:,A%20brief%20note")

==
Note: works in 2.2 version of library.

Problem appears to be here in 2.4:

import mimetools
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO

whereas 2.2 reads:

import StringIO, mimetools, time


--

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-11-26 17:52

Message:
Logged In: YES 
user_id=1188172

Fixed in revision 41548 and 41549 (2.4).

--

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



[ python-Bugs-1346144 ] Segfaults from unaligned loads in floatobject.c

2005-11-26 Thread SourceForge.net
Bugs item #1346144, was opened at 2005-11-02 18:07
Message generated for change (Comment added) made by titanstar
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1346144&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: 7
Submitted By: Rune Holm (titanstar)
Assigned to: Michael Hudson (mwh)
Summary: Segfaults from unaligned loads in floatobject.c

Initial Comment:
Object/floatobject.c:_PyFloat_Unpack8 from svn head performs 
an unaligned load of a double, causing the cPickle unit test to fail 
on linux/mips and openbsd/sparc64. http://pxr.openlook.org/pxr/
diff/Objects/floatobject.c?v=release24-
maint;diffval=head;diffvar=v reveals that somebody has added a 
fast path in _PyFloat_Unpack8 since 2.4 that fails to check for 
unaligned accesses, and therefore performs an illegal operation on  
architectures that don't support unaligned accesses.

Here is the relevant traceback from linux/mips:

(gdb) run Lib/test/test_cpickle.py  
  
Starting program: /ping/wirth/home0/runehol/projects/python-mips/
python Lib/test/test_cpickle.py 
   
[Thread debugging using libthread_db enabled]   
  
[New Thread 16384 (LWP 4379)]   
  
test_callapi (__main__.cPickleTests) ... ok 
  
test_dict_chunking (__main__.cPickleTests) ... ok   
  
test_dump_closed_file (__main__.cPickleTests) ... ok
  
test_garyp (__main__.cPickleTests) ... ok   
  
test_getinitargs (__main__.cPickleTests) ... ok 
  
test_global_ext1 (__main__.cPickleTests) ... ok 
  
test_global_ext2 (__main__.cPickleTests) ... ok 
  
test_global_ext4 (__main__.cPickleTests) ... ok 
  
test_highest_protocol (__main__.cPickleTests) ... ok
  
test_insecure_strings (__main__.cPickleTests) ... ok
  
test_ints (__main__.cPickleTests) ... ok
  
test_list_chunking (__main__.cPickleTests) ... ok   
  
test_load_closed_file (__main__.cPickleTests) ... ok
  

  
Program received signal SIGBUS, Bus error.  
  
[Switching to Thread 16384 (LWP 4379)]  
  
0x004414e0 in _PyFloat_Unpack8 (p=0x2b05282f "@", le=0) 
  
at Objects/floatobject.c:1737   
  
1737return *(double*)p; 
  
(gdb) bt
  
#0  0x004414e0 in _PyFloat_Unpack8 (p=0x2b05282f "@", le=0) 
  
at Objects/floatobject.c:1737   
  
#1  0x2b10a750 in load_binfloat (self=0x2b0dc308)   
  
at /ping/wirth/home0/runehol/projects/python-mips/Modules/
cPickle.c:3361  
#2  0x2b113674 in load (self=0x2b0dc308)
  
at /ping/wirth/home0/runehol/projects/python-mips/Modules/
cPickle.c:4480  
#3  0x2b1186ac in cpm_loads (self=0x0, args=0x2b2c2c78) 
  
at /ping/wirth/home0/runehol/projects/python-mips/Modules/
cPickle.c:5476  
#4  0x005c45f4 in PyCFunction_Call (func=0x2b0d92b8, 
arg=0x2b2c2c78, kw=0x0)  
at Objects/methodobject.c:73
  
#5  0x0050f8f0 in call_function (pp_stack=0x7fff1e68, oparg=1)  
  
at Python/ceval.c:3565  
  
#6  0x0050710c in PyEval_EvalFrameEx (f=0x10080868, 
throw=0)  
at Python/ceval.c:2181  
  
#7  0x00510078 in fast_function (func=0x2b222da0, 
pp_stack=0x7fff2428, n=1,   
na=1, nk=0) at Python/ceval.c:3647  
  
#8  0x0050fc14 in call_function (pp_stack=0x7fff2428, oparg=

[ python-Bugs-1367183 ] inspect.getdoc fails on objs that use property for __doc__

2005-11-26 Thread SourceForge.net
Bugs item #1367183, was opened at 2005-11-26 12:42
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=1367183&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.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Drew Perttula (drewp)
Assigned to: Nobody/Anonymous (nobody)
Summary: inspect.getdoc fails on objs that use property for __doc__

Initial Comment:
inspect.getdoc has these lines:

 if not isinstance(doc, types.StringTypes):
 return None

which interfere with the case where __doc__ is some
other thing that has a good __str__. I wanted to make a
lazy __doc__ that did an expensive lookup of some
external documentation only when it was str()'d, but
since doc displayers often (correctly) use
inspect.getdoc, they were getting None.

I think the intention of the test in getdoc() is to
avoid trying string operations on a __doc__ that is
None. I think that a more lenient version would allow
me to do my fancy docstrings but still solve the
'__doc__ is None' problem. Please consider the
following patch:

if doc is None:
 return None
doc = str(doc)



--

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



[ python-Bugs-1337987 ] IDLE, F5 – wrong external file content. (on error!)

2005-11-26 Thread SourceForge.net
Bugs item #1337987, was opened at 2005-10-26 04:12
Message generated for change (Comment added) made by tyrell_rr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1337987&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: IDLE
Group: None
Status: Closed
Resolution: Duplicate
Priority: 5
Submitted By: MvGulik (tyrell_rr)
Assigned to: Kurt B. Kaiser (kbk)
Summary: IDLE, F5 – wrong external file content. (on error!)

Initial Comment:
IDLE, F5 – wrong external file content on error.

using:
Python 2.3.5 (#62, Feb  8 2005, 16:23:02) [MSC v.1200
32 bit (Intel)] on win32
IDLE 1.0.5 , TK: 8.4

The basic problem is that when a external file is
reloaded, by using F5, and that file contains a error.
IDLE will tell about the error, and highlight the
error, but its still using the old file content in its
GUI window and not the newly reloaded file content.

when: (IDLE GUI)
- using F5 to reload and restart a external script.
- new and changed script file containing a error.

what:
- display is showing previous script content.
- error highlight is pointing at the wrong code. (bad!)

how:
first file: (create, load and execute)
---
a = 1
print a
---
change to:
---
a = 1
print a :
print a
---
use F5 to auto reload and execute.



Anything I'm doing wrong, or I can do locally to fix
this?.  just let me know.

ps: upgrade to 2.4.x is not really a option in my case.
(not yet at leased)

Cheers
M.v.Gulik

--

>Comment By: MvGulik (tyrell_rr)
Date: 2005-11-27 02:50

Message:
Logged In: YES 
user_id=779309

wow ... nevermind ... Bye bye.


--

Comment By: Kurt B. Kaiser (kbk)
Date: 2005-11-15 06:54

Message:
Logged In: YES 
user_id=149084

Duplicate of RFE 1175686.  Please read the comments
on that Tracker item.

IDLE is intended to edit its own code.  Apparently you are
using an external editor.  It's not a high priority for me
to support that, since IDLE has one-keystroke save, load
and run.  The guy who submitted the RFE never came back
with a use case; what's your use for this feature?

IDLE would have to detect that the file
had changed on disk.  Not difficult, just not done right
now.

--

Comment By: MvGulik (tyrell_rr)
Date: 2005-10-28 11:46

Message:
Logged In: YES 
user_id=779309

> Save with Control-S before pressing F5.
Don't think that a good idee.
This will save the initially loaded old file content inside
IDLE over the new file content (external edited -> not using
IDLE for editing)
Effectingly undoing all the changes done with the external
editor.
M.v.Gulik.

--

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-10-26 04:45

Message:
Logged In: YES 
user_id=80475

Save with Control-S before pressing F5.

--

Comment By: MvGulik (tyrell_rr)
Date: 2005-10-26 04:37

Message:
Logged In: YES 
user_id=779309

huu, little update.
the error itself is not part of the real (code)problem.
( it is of course when its leading to misleading debug info )
but the display of the external file in just not updated
after using F5.
with or without a error being triggerd.
M.v.Gulik

--

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