[issue11697] Unsigned type in mmap_move_method

2011-04-24 Thread Rafael Zanella
Rafael Zanella rafael.zane...@yahoo.com.br added the comment: Seems like it should use size_t since it deals with memory location/obj size, but Python doesn't have size_t only ssize_t, and ssize_t is signed... m.move(2**32, 10, 4) # Should throw a ValueError - Won't it wrap around

[issue1490929] urllib.retrieve's reporthook called with non-helpful value

2011-04-24 Thread Rafael Zanella
Rafael Zanella azraellzane...@gmail.com added the comment: Simple (lazy) test case added. It just replicates one test case of reporthook to work with progresshook. The testcases assume the hard-coded value of blocksize on urllib, maybe it should become a public property. Also commented

[issue4608] urllib.request.urlopen does not return an iterable object

2011-04-23 Thread Rafael Zanella
Rafael Zanella rafael.zane...@yahoo.com.br added the comment: The patch that makes addinfourl() iterable was not commited due to the change to HTTP request see: msg86365 (http://bugs.python.org/issue4608#msg86365). Since urllib is protocol agnostic it should behave the same with FTP, right

[issue3826] BaseHTTPRequestHandler depends on GC to close connections

2008-09-24 Thread Rafael Zanella
Changes by Rafael Zanella [EMAIL PROTECTED]: -- nosy: +zanella ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3826 ___ ___ Python-bugs-list mailing list

[issue2683] subprocess.Popen.communicate takes bytes, not str

2008-07-01 Thread Rafael Zanella
Rafael Zanella [EMAIL PROTECTED] added the comment: _communicate still encodes the string under the hood ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2683

[issue2683] subprocess.Popen.communicate takes bytes, not str

2008-06-29 Thread Rafael Zanella
Rafael Zanella [EMAIL PROTECTED] added the comment: On subprocess.py the new method communicate() doesn't encode the string: _communicate(self, input): ... if isinstance(input, str): input = input.encode() ... I've attached a patch that adds the str.encode() call on communicate

[issue2325] isinstance(anything, MetaclassThatDefinesInstancecheck) raises instead of returning False

2008-06-29 Thread Rafael Zanella
Rafael Zanella [EMAIL PROTECTED] added the comment: So..., could this issue be closed ? -- nosy: +zanella ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2325

[issue3194] Demo/loop.c passing char * instead of wchar_t *

2008-06-24 Thread Rafael Zanella
New submission from Rafael Zanella [EMAIL PROTECTED]: The Demo/loop.c passes a char pointer (argv[0]) while Py_SetProgramName() now expects a wchar_t pointer. I've attached a patch, the solution on the patch was borrowed, ok stolen, from Python/frozenmain.c -- files: loop_c.diff

[issue2791] subprocess.py leaks fd in communicate

2008-05-19 Thread Rafael Zanella
Rafael Zanella [EMAIL PROTECTED] added the comment: I don't know a lot about the matter at hand, that's why I'm not gonna append a patch. On _communicate() after a pipe is read it's closed, doing the same on communicate() seems to solve the issue of the extra pipe: if [self.stdin

[issue2302] Uses of SocketServer.BaseServer.shutdown have a race

2008-05-07 Thread Rafael Zanella
Rafael Zanella [EMAIL PROTECTED] added the comment: With the code as it stands, calls to shutdown that happen before serve_forever enters its loop will deadlock, and there's no simple way for the user to avoid this. The attached patch prevents the deadlock and allows multiple serve_forever

[issue2650] re.escape should not escape underscore

2008-05-07 Thread Rafael Zanella
Rafael Zanella [EMAIL PROTECTED] added the comment: AFAIK the lookup on dictionaries is faster than on lists. Patch added, mainly a compilation of the previous patches with an expanded test. -- nosy: +zanella Added file: http://bugs.python.org/file10215/re_patch.diff

[issue1193577] add server.shutdown() method and daemon arg to SocketServer

2008-02-25 Thread Rafael Zanella
Changes by Rafael Zanella: -- nosy: +zanella _ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1193577 _ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1533] Bug in range() function for large values

2008-02-24 Thread Rafael Zanella
Rafael Zanella added the comment: According to the documentation (http://docs.python.org/dev/library/functions.html) The arguments must be plain integers, so I think the wrong thing here is to run the object's __int__() under the range()'s hood. I think the right thing to do would

[issue1524] os.system() fails for commands with multiple quoted file names

2008-02-24 Thread Rafael Zanella
Rafael Zanella added the comment: I don't have access to a Windows machine, but is it really necessary to quote the command part? I mean, on GNU/Linux if you pass a command wich has spaces , say e.g.: ls -lah, quoted it fails too, but if passed without quotes it runs just fine. -- nosy

[issue1986] io.StringIO allows any parameter

2008-02-24 Thread Rafael Zanella
Rafael Zanella added the comment: oops, stupid me, this a 3.0 issue..., well seems the str() conversion is done as well on the 3.0 io module: class StringIO(TextIOWrapper): def __init__(self, initial_value=, encoding=utf-8, errors=strict, newline=\n): super(StringIO

[issue1986] io.StringIO allows any parameter

2008-02-24 Thread Rafael Zanella
Rafael Zanella added the comment: I believe you're referring to StringIO, if so, it changes the parameter received to a string: class StringIO: def __init__(self, buf = ''): # Force self.buf to be a string or unicode if not isinstance(buf, basestring): buf = str

[issue2118] smtplib.SMTP() raises socket.error rather than SMTPConnectError

2008-02-23 Thread Rafael Zanella
Changes by Rafael Zanella: -- nosy: +zanella __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2118 __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-23 Thread Rafael Zanella
Rafael Zanella added the comment: Just to exemplify: from threading import Thread import time import Queue class C: def __int__(self): return 3 #def __del__(self): print collected... # won't happen since q holds a reference to it c = C() q = Queue.Queue(c) # Not dynamic print

[issue2143] smtplib.SSLFakeFile hangs forever if \n is not encountered

2008-02-23 Thread Rafael Zanella
Rafael Zanella added the comment: As of 2.6 the smtplib uses the ssl module, until 2.5 it uses _ssl, I *think* that this issue would bring an Exception on 2.5 while on 2.6 would return a zero length string: def read(self, len=1024): Read up to LEN bytes and return them. Return

[issue1533] Bug in range() function for large values

2008-02-21 Thread Rafael Zanella
Rafael Zanella added the comment: FWIW, using xrange() it seems to give the proper error message: Traceback (most recent call last): File bad_range.py, line 12, in module print xrange(MyInt(2**64), MyInt(2**64+10)) OverflowError: long int too large to convert to int -- nosy

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-21 Thread Rafael Zanella
Rafael Zanella added the comment: @gutworth: Since one of the main uses of Queue is with threads, I think it *really* should acquire the mutex before changing the maxsize; @amaury.forgeotdarc: Your patch makes the point of allowing the size to be changed at some other place (e.g.: an attribute

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-21 Thread Rafael Zanella
Rafael Zanella added the comment: Mine patch doesn't address the hold the mutex before changing the maxsize guess it would then force a get()? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2149

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-20 Thread Rafael Zanella
Changes by Rafael Zanella: -- components: Library (Lib) nosy: zanella severity: minor status: open title: Queue.maxsize, __init__() accepts any value as maxsize type: security versions: Python 2.4, Python 2.5 __ Tracker [EMAIL PROTECTED] http

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-20 Thread Rafael Zanella
New submission from Rafael Zanella: Queue.Queue(), accepts any value as the maxsize, example: foo = Queue.Queue('j'); l = []; foo = Queue.Queue(l); ... Shouldn't the value passed be checked on init : isinstance(maxsize, int) ? __ Tracker [EMAIL PROTECTED] http

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-20 Thread Rafael Zanella
Rafael Zanella added the comment: Firts: the security type was my error. The method wich uses the maxsize: # Check whether the queue is full def _full(self): return self.maxsize 0 and len(self.queue) == self.maxsize @rhettinger: As per the documentation, negative values result