[Python-Dev] Weekly Python Patch/Bug Summary

2005-06-09 Thread Kurt B. Kaiser
Patch / Bug Summary
___

Patches :  339 open ( -5) /  2857 closed (+12) /  3196 total ( +7)
Bugs:  908 open ( -8) /  5036 closed (+22) /  5944 total (+14)
RFE :  189 open ( -2) /   168 closed ( +5) /   357 total ( +3)

New / Reopened Patches
__

Trivial typo in unicodedata._getcode  (2005-06-02)
   http://python.org/sf/1213831  opened by  Darek Suchojad

Support non-file source/dest in marshal  (2005-06-04)
   http://python.org/sf/1214879  opened by  Skip Montanaro

file.encoding support for file.write and file.writelines  (2005-06-04)
   http://python.org/sf/1214889  opened by  Reinhold Birkenfeld

two fileinput enhancements (fileno, openhook)  (2005-06-05)
   http://python.org/sf/1215184  opened by  Reinhold Birkenfeld

Suggested Additional Material for urllib2 docs  (2005-06-08)
   http://python.org/sf/1216942  opened by  Mike Foord

proposed patch for tls wrapped ssl support added to smtplib  (2005-06-08)
   http://python.org/sf/1217246  opened by  Pete G

Patches Closed
__

[ast] fix for 1183468: return/yield in class  (2005-04-16)
   http://python.org/sf/1184418  closed by  nascheme

[AST] throw SyntaxError in "from x import y,"  (2005-05-04)
   http://python.org/sf/1194895  closed by  nascheme

fix for trivial flatten bug in astgen  (2005-01-04)
   http://python.org/sf/1095541  closed by  nascheme

Add st_flags support to (l)stat function  (2005-06-01)
   http://python.org/sf/1212117  closed by  perky

buffer overflow in _cursesmodule.c  (2005-05-11)
   http://python.org/sf/1200134  closed by  akuchling

Typo in Curses-Function doc  (2005-04-20)
   http://python.org/sf/1186781  closed by  akuchling

binary formats for marshalling floats  (2005-04-11)
   http://python.org/sf/1180995  closed by  mwh

test_locale fix on modern linux  (2005-05-07)
   http://python.org/sf/1197218  closed by  anthonybaxter

An URL for UnicodeData File Format 3.2 has changed.  (2005-05-25)
   http://python.org/sf/1207985  closed by  perky

Patch for [ 1170331 ] Error in base64.b32decode  (2005-03-27)
   http://python.org/sf/1171487  closed by  akuchling

#1074261 gzip dies on gz files with many appended headers  (2004-11-27)
   http://python.org/sf/1074381  closed by  akuchling

asynchat does not accept 'long' terminator  (2004-08-03)
   http://python.org/sf/1002763  closed by  akuchling

New / Reopened Bugs
___

Queue.qsize() better info about unreliability  (2005-06-02)
   http://python.org/sf/1213475  opened by  Nikos Kouremenos

os.path.realpath() cannot handle symlinks  (2005-06-02)
CLOSED http://python.org/sf/1213894  opened by  Ilya Sandler

test_marshal.py discards marshal.load val  (2005-06-04)
CLOSED http://python.org/sf/1214662  opened by  Skip Montanaro

subprocess auto-reaps children  (2005-06-04)
   http://python.org/sf/1214859  opened by  Mattias EngdegÄrd

bsddb dbobj.DB.associate doesn't accept dbobj.DB param  (2005-06-04)
   http://python.org/sf/1215023  opened by  Gregory P. Smith

int('x',radix) puzzle  (2005-06-05)
CLOSED http://python.org/sf/1215146  opened by  elgordo

String and list methods deeply hidden  (2005-06-06)
   http://python.org/sf/1215887  opened by  Reinhold Birkenfeld

Large tarfiles cause overflow  (2005-06-06)
   http://python.org/sf/1215928  opened by  Tom Emerson

Replace MSVC memory allocator with ptmalloc2  (2005-06-07)
   http://python.org/sf/1216562  opened by  Niall Douglas

csv module sometimes raises _csv.Error  (2005-06-08)
CLOSED http://python.org/sf/1216831  opened by  Mary Gardiner

LINKCC->CXX, -ltermcap->-lncurses  (2005-06-08)
   http://python.org/sf/1216923  opened by  Niki W. Waibel

Info from man python not in docs  (2005-06-08)
   http://python.org/sf/1217152  opened by  Kent Johnson

Omission in docs for smtplib.SMTP.sendmail()  (2005-06-09)
   http://python.org/sf/1217513  opened by  Kent Johnson

make frameworkinstall fails for non-default location  (2005-06-09)
   http://python.org/sf/1217591  opened by  Mitch Chapman

pydoc includes unnecessary files for a package.  (2005-06-09)
   http://python.org/sf/1217881  opened by  Igor Belyi

Bugs Closed
___

check for return/yield outside function is wrong  (2005-04-15)
   http://python.org/sf/1183468  closed by  nascheme

Incorrect result for regular expression - "|(hello)|(world)"  (2005-06-01)
   http://python.org/sf/1212411  closed by  tim_one

doc bug in Lock.acquire  (2005-05-27)
   http://python.org/sf/1209880  closed by  akuchling

(?(id)yes|no) only works when referencing the first group  (2005-04-06)
   http://python.org/sf/1177831  closed by  akuchling

Notation  (2005-04-30)
   http://python.org/sf/1193001  closed by  akuchling

os.path.realpath() cannot handle symlinks  (2005-06-03)
   http://python.org/sf/1213894  closed by  birkenfeld

bz2.BZ2File doesn't handle modes correctly  (2005-0

Re: [Python-Dev] Example workaround classes for using Unicode with csv module...

2005-06-09 Thread kent sin
The suggestion Skip is indeed very useful, however it does not work
when some of the item is not string, here is another try:

class UnicodeReader:
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
self.reader = csv.reader(f, dialect=dialect, **kwds)
self.encoding = encoding

def next(self):
row = self.reader.next()
t = []
for s in row:
try:
t.append(unicode(s,self.encoding))
except:
t.append(s)
return t 
# [unicode(s, self.encoding) for s in row] This will not work
with non string type

def __iter__(self):
return self

class UnicodeWriter:
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
self.writer = csv.writer(f, dialect=dialect, **kwds)
self.encoding = encoding

def writerow(self, row):
t = []
for s in row:
try:
t.append(unicode(s,"utf-8"))
except:
t.append(s)
self.writer.writerow(t)   

#self.writer.writerow([s.encode("utf-8") for s in row]) #!
This is not working with non-string objects.


def writerows(self, rows):
for row in rows:
self.writerow(row)
-- 
Sin Hang Kin.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] b32encode and NUL bytes

2005-06-09 Thread Pavel Pergamenshchik
Hi.
Is this a feature? I do see b32encode padding the string with NULs first.

>>> b32decode(b32encode('\x00'))
Traceback (most recent call last):
  File "", line 1, in ?
  File "/usr/lib/python2.4/base64.py", line 228, in b32decode
last = binascii.unhexlify(hex(acc)[2:-1])
TypeError: Odd-length string
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com