[issue6705] '''3, 5'''.strip(r''', ''') does not strip comma, returns '3, 5'

2009-08-14 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: strip removes any of a set of characters from the beginning and end of a string, not the middle. Please refer questions such as this to python-list or python-tutor. There are many helpful people on those lists who will help you learn

[issue6705] '''3, 5'''.strip(r''', ''') does not strip comma, returns '3, 5'

2009-08-14 Thread Eric Smith
Eric Smith e...@trueblade.com added the comment: Good advice from R. David. In addition, you'll find the help command useful: help(''.strip) Help on built-in function strip: strip(...) S.strip([chars]) - string or unicode Return a copy of the string S with leading and trailing

[issue6681] email.parser clips trailing \n of multipart/mixed part if part ends in \r\n

2009-08-14 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: The only way I can think of to fix this that won't fail in the case where the body ends with just '\r' (rather than '\r\n' the way the test body does) is to have feedparser keep track of what the overall line endings for the stream being

[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: The error occurs in Py_Main(), on _PyUnicode_AsString(commandObj). The problem is that _PyUnicode_AsString() is not checked for error. Here is a patch fixing two errors: - display on error message instead of a crash on

[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2009-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: First, gzip should use its own errors: this issue depends on #6584. -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6669

[issue6669] TarFile.getmembers fails at struct.unpack: unpack requires a string argument of length 4

2009-08-14 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Since 6584 is deemed (correctly, IMO) a feature request, this one must be as well. -- dependencies: +gzip module has no custom exception keywords: +easy nosy: +r.david.murray priority: - normal stage: - test needed type:

[issue6706] asyncore's accept() is broken

2009-08-14 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' billiej...@users.sourceforge.net: An old bad design choice in asyncore is how it forces the user to override handle_accept() and then call self.accept() to obtain a socket pair. def handle_accept(self): conn, addr = self.accept() The

[issue6707] dir() on __new__'d module w/o dict crashes 2.6.2

2009-08-14 Thread Dino Viehland
New submission from Dino Viehland di...@microsoft.com: from types import ModuleType as M m = M.__new__(M) dir(m) In 2.5 this raises an exception about not having __dict__, 2.6.2 crashes out right. -- components: Interpreter Core messages: 91580 nosy: DinoV severity: normal status:

[issue6239] c_char_p return value returns string, not bytes

2009-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I agree that the C type 'char' is a byte, not a character. So Python3 should creates a Python bytes object for the ctypes c_char_p type. Since Python 3.1 is out, is it too late to change it in the 3.x branch? :-) Maybe for Python

[issue6673] Py3.1 hangs in coroutine and eats up all memory

2009-08-14 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Reopening - this should be rejected by the compiler as a SyntaxError, since it is the comprehension equivalent of writing return Value inside a generator function. Specifically, in 3.x, the equivalent written out code is: while True:

[issue6626] show Python mimetypes module some love

2009-08-14 Thread Jacob Rus
Jacob Rus jacobo...@gmail.com added the comment: Okay, here's a version of this patch which (a) adds deprecation warnings, and (b) doesn't bother with lazy init. It should still be nearly completely backwards compatible with the previous mimetypes module. -- Added file:

[issue6708] raw_input() calls generate compile errors.

2009-08-14 Thread starz
New submission from starz b_lyn...@yahoo.com: # -- SOURCE --- # cheerleading program word = raw_input(Who do you go for? ) for letter in word: call = Gimme a + letter + ! print (call) print (letter) + ! print( What does that spell?) print( word + !) # --- end source

[issue6626] show Python mimetypes module some love

2009-08-14 Thread Jacob Rus
Jacob Rus jacobo...@gmail.com added the comment: And at Rietveld, patch version 5: http://codereview.appspot.com/107042 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6626 ___

[issue6708] raw_input() calls generate compile errors.

2009-08-14 Thread Skip Montanaro
Skip Montanaro s...@pobox.com added the comment: Try it at the help prompt without the parens (you're not calling it here, just asking for the documentation on the name raw_input. help raw_input Help on built-in function raw_input in module __builtin__: raw_input(...) raw_input([prompt])

[issue6708] raw_input() calls generate compile errors.

2009-08-14 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: raw_input() has been renamed to input() in Python 3. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6708

[issue6709] It's possible to create TryExcept with no handlers

2009-08-14 Thread Benjamin Peterson
Changes by Benjamin Peterson benja...@python.org: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6709 ___ ___ Python-bugs-list

[issue6677] Place the term delete within the documentation for os.remove() and os.rmdir()

2009-08-14 Thread Terry J. Reedy
Terry J. Reedy tjre...@udel.edu added the comment: If a change is make, 'remove (delete)' would be sufficient. -- nosy: +tjreedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6677 ___

[issue6709] It's possible to create TryExcept with no handlers

2009-08-14 Thread Benjamin Peterson
New submission from Benjamin Peterson benja...@python.org: I think we might need to devise some way to add custom validation when AST is being compiled. For example, you can also pass a level to ImportFrom which is -1. x = ast.parse(try: x\nexcept y: pass) del x.body[0].handlers[:]

[issue1660179] functools.compose to chain functions together

2009-08-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I concur with Martin's reasons for closing the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1660179 ___

[issue1660179] functools.compose to chain functions together

2009-08-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: I concur with Martin's reasons for closing the patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1660179 ___

[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-14 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Does anyone here know why GC calls the free_xxx functions? ISTM, they cannot be involved in cycles. Free lists are kept by container objects to speed-up allocation. Having GC call the free_xxx just slows down the GC process

[issue2576] httplib read() very slow due to lack of socket buffer

2009-08-14 Thread Gregory P. Smith
Gregory P. Smith g...@krypto.org added the comment: Note that http://bugs.python.org/issue4879 may have already fixed this problem in trunk r68532. -- nosy: +gregory.p.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2576

<    1   2   3