[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-18 Thread Jeff Bradberry
Jeff Bradberry added the comment: Ok, fixed. I am kind of vague, though, on the usefulness of str.encode and unicode.decode. -- Added file: http://bugs.python.org/file14925/python27.patch ___ Python tracker <http://bugs.python.org/issue6

[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-17 Thread Jeff Bradberry
Jeff Bradberry added the comment: Before: ~/python2.7$ ./python -mtimeit "u'Andr\202 x'.encode('ascii', 'replace')" 100 loops, best of 3: 1.8 usec per loop After: ~/python2.7-patched$ ./python -mtimeit "u'Andr\202 x'.encode('

[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-16 Thread Jeff Bradberry
Jeff Bradberry added the comment: As it turns out, someone had previously made this adjustment to str() and unicode(). My updated patch adds this behavior to unicode.decode and unicode.encode, adds a couple of tests to test_unicode.py, and updates the documentation to show that these functions

[issue6300] encode and decode should accept 'errors' as a keyword argument

2009-09-16 Thread Jeff Bradberry
Jeff Bradberry added the comment: This patch adds the requested behavior to the current 2.7 svn trunk. Both 'encoding' and 'errors' may be used as keyword arguments for encode() and decode(). -- keywords: +patch nosy: +jbradberry Added file: http://bugs.python.or