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
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
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
Changes by Rafael Zanella [EMAIL PROTECTED]:
--
nosy: +zanella
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3826
___
___
Python-bugs-list mailing list
Rafael Zanella [EMAIL PROTECTED] added the comment:
_communicate still encodes the string under the hood
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2683
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
Rafael Zanella [EMAIL PROTECTED] added the comment:
So..., could this issue be closed ?
--
nosy: +zanella
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2325
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
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
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
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
Changes by Rafael Zanella:
--
nosy: +zanella
_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1193577
_
___
Python-bugs-list mailing list
Unsubscribe:
http
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
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
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
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
Changes by Rafael Zanella:
--
nosy: +zanella
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2118
__
___
Python-bugs-list mailing list
Unsubscribe:
http
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
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
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
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
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
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
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
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
25 matches
Mail list logo