[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell

showell  added the comment:

I am attaching a new patch that does not add a new element to PyListObject, 
roughly following a technique that Antoine Pitrou suggested on python-dev.  
When I want to lazily avoid a memmove under the new patch, I set the MSB on 
allocated and store the original ob_item pointer in the new ob_item[-1].

On the advice of Daniel, I ran the new patch against the Unladen benchmark 
suite.  The results were pretty neutral--never more than a 1% penalty but no 
significant gains either.  I did not expect to see gains, for the obvious 
reason that I am improving performance on an operation that folks have been 
encouraged to work around.  The new patch continues to do well on 
microbenchmarks. 

The new patch fails one test in test_sys related to the 12 byte garbage 
collection header.  The failure is definitely introduced by my patch, but I am 
not sure what it's doing wrong.  All other tests pass.

Because the new code piggybacks on top of of allocated instead of creating a 
new variable in PyListObject, the new code is a bit more complex than the 
original patch, which is unfortunate.  There are probably some opportunities 
for making the new code simpler.

--
Added file: http://bugs.python.org/file16033/DIFF_NO_EXTRA_MEM

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell

showell  added the comment:

Ok, found the offending line, now all tests pass.  

The use case where this patch will pay off the most is slicing your way through 
a list of tasks.  The toy program below gets about a 50x speedup.

import time

n = 80

lst = []
for i in range(n):
lst.append(i)

t = time.time()
for i in range(n):
x = lst[:10]
del lst[:10]

print('time = ' + str(time.time() - t))
print(len(lst))

--
Added file: http://bugs.python.org/file16034/no_mem_penalty.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell

Changes by showell :


Removed file: http://bugs.python.org/file16033/list_top_no_extra_mem.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7803] setup hangs on disk space requirements

2010-01-29 Thread Dan Simmons

New submission from Dan Simmons :

I tried to install windows binary and the setup hanged up on 'determining disk 
space requirements' I waited over two hours for this to finish, and the light 
blinked in a syncrinised pattern that led me to believe something was wrong. So 
I have since restarted it and the light is blinking differently this time. Hope 
it works.

--
messages: 98503
nosy: abilify
severity: normal
status: open
title: setup hangs on disk space requirements
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7437] OS X 2.6.4 installer fails on 10.3 with two corrupted file names, ignored on 10.4

2010-01-29 Thread TJ Sullivan

TJ Sullivan  added the comment:

Install was successful. PLease find the attachment with the test results you 
asked for. Thank you very much for making the fix to the package installer

--
Added file: http://bugs.python.org/file16035/install test results.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7803] setup hangs on disk space requirements

2010-01-29 Thread Dan Simmons

Dan Simmons  added the comment:

I think the beginers guide needs to be updated to let us know what type of 
download to use. x86-64 or binary. 64 bit works so is that the right one for 
me. I'm trying to get this graphics.py to work that came with a book. It stops 
working when I run a module with it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1681842] splitext of dotfiles, incl backwards compat and migration

2010-01-29 Thread Nick Coghlan

Nick Coghlan  added the comment:

If I ever clear all the other issues off my list, I may get a chance to have a 
closer look at this one :)

--
nosy: +ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

A couple of comments about issue7092_syntax_imports_v3.diff too:
1) in test_copy you remove (k,v), but left the name 'k' even if now it 
represent the item and not the key;
2) in test_fractions you should probably use self.fail() instead of an assert;
3) on test_ftp you can use two separate lines and remove the ';';
4) in test_pyclbr there's one extra 'f' in the comment in assertHaskey;
5) in test_xml_etree_c you can either leave callable() and catch the warning or 
use isinstance(x, collections.Callable) instead (there are also a few more 
places where callable was used too).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1559298] test_popen fails on Windows if installed to "Program Files"

2010-01-29 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7803] setup hangs on disk space requirements

2010-01-29 Thread Dan Simmons

Changes by Dan Simmons :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7804] test_readline failure

2010-01-29 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is a fresh py3k checkout on a fresh Debian Lenny install:

==
ERROR: testHistoryUpdates (test.test_readline.TestHistoryManipulation)
--
Traceback (most recent call last):
  File "/home/antoine/py3k/py3k/Lib/test/test_readline.py", line 16, in 
testHistoryUpdates
readline.clear_history()
AttributeError: 'module' object has no attribute 'clear_history'

--

--
components: Library (Lib)
messages: 98508
nosy: pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: test_readline failure
type: behavior
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7805] test_multiprocessing failure

2010-01-29 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is a fresh py3k checkout on a fresh Debian Lenny install:

==
ERROR: test_pool_worker_lifetime 
(test.test_multiprocessing.WithProcessesTestPoolWorkerLifetime)
--
Traceback (most recent call last):
  File "/home/antoine/py3k/py3k/Lib/test/test_multiprocessing.py", line 1076, 
in test_pool_worker_lifetime
self.assertNotEqual(sorted(origworkerpids), sorted(finalworkerpids))
TypeError: unorderable types: NoneType() < int()

--

--
components: Library (Lib)
messages: 98509
nosy: jnoller, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: test_multiprocessing failure
type: behavior
versions: Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7805] test_multiprocessing failure

2010-01-29 Thread Florent Xicluna

Florent Xicluna  added the comment:

Confirmed.

I got a Py3k warning on 2.7 about "unorderable types".

--
nosy: +flox
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1926] NNTPS support in nntplib

2010-01-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Yes, a test could use Google or gmane (according to the FAQ, nntps is 
supported: http://gmane.org/faq.php ).
The test should skip gracefully (using the skipTest() API) if the connection 
fails, so that network errors or service unavailability don't make buildbots go 
red.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1559298] test_popen fails on Windows if installed to "Program Files"

2010-01-29 Thread Brian Curtin

Brian Curtin  added the comment:

Florent is correct. The patch seems to fix regular popen, but popen3 sees 
problems. I'll see if I can fit this in and have a look.

Also of note is that the other flavors of popen are not tested...at least not 
in Lib/test/test_popen.py or Lib/test/test_os.py

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1926] NNTPS support in nntplib

2010-01-29 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy: +brian.curtin

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7806] httplib.HTTPConnection.getresponse closes socket which destroys the response

2010-01-29 Thread Robert Buchholz

New submission from Robert Buchholz :

Calling getresponse() on an httplib.HTTPConnection object returns a response 
object. Internally, the self.sock is handed over to the HTTPResponse object 
which transforms it into a file-like object. The response object is returned to 
the caller. If one calls response.read() later on, no or incomplete content 
will be returned because the underlying socket has been closed.

The code path, simplified:

class HTTPConnection:

def getresponse(self):
response = self.response_class(self.sock, ...)
...
if response.will_close:
# this effectively passes the connection to the response
self.close()

def close(self):
if self.sock:
self.sock.close()
...

class HTTPResponse:
def __init__(self, sock, debuglevel=0, strict=0, method=None):
self.fp = sock.makefile('rb', 0)
...

--
components: Library (Lib)
messages: 98513
nosy: Robert.Buchholz
severity: normal
status: open
title: httplib.HTTPConnection.getresponse closes socket which destroys the 
response
versions: Python 2.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7803] setup hangs on disk space requirements

2010-01-29 Thread Brian Curtin

Brian Curtin  added the comment:

Dan, there seem to be a number of possible issues in your last two messages.

It's not clear to me what the blinking light is. What type of computer do you 
have and what is the specific installer and version you tried to run?

Also, what do you mean when you say that it stops working when you run a 
module? Does the interpreter crash or is there an unhandled exception which 
causes the application to exit?

--
nosy: +brian.curtin
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7803] setup hangs on disk space requirements

2010-01-29 Thread Dan Simmons

Dan Simmons  added the comment:

It seemed to work after I restarted it. It was stuck on the process of getting 
disk space requirements, the computer was processing something but the light on 
the console that tells you something is being processed was blinking once every 
second in a obvious loop, When I started over it just processed through it in 
less than a second. So there was something wrong. I don't know if it was my 
computer or not.

--- On Fri, 1/29/10, Brian Curtin  wrote:

From: Brian Curtin 
Subject: [issue7803] setup hangs on disk space requirements
To: sentai...@yahoo.com
Date: Friday, January 29, 2010, 3:37 PM

Brian Curtin  added the comment:

Dan, there seem to be a number of possible issues in your last two messages.

It's not clear to me what the blinking light is. What type of computer do you 
have and what is the specific installer and version you tried to run?

Also, what do you mean when you say that it stops working when you run a 
module? Does the interpreter crash or is there an unhandled exception which 
causes the application to exit?

--
nosy: +brian.curtin
status: closed -> open

___
Python tracker 

___

--
Added file: http://bugs.python.org/file16036/unnamed

___
Python tracker 

___It seemed to work after I restarted it. It was stuck on 
the process of getting disk space requirements, the computer was processing 
something but the light on the console that tells you something is being 
processed was blinking once every second in a obvious loop, When I started over 
it just processed through it in less than a second. So there was something 
wrong. I don't know if it was my computer or not.--- On Fri, 
1/29/10, Brian Curtin  wrote:
From: Brian Curtin 
Subject: [issue7803] setup hangs on disk 
space requirementsTo: sentai...@yahoo.comDate: Friday, January 29, 
2010, 3:37 PM
Brian Curtin cur...@acm.org> added the 
comment:Dan, there seem to be a number of possible issues in your last 
two messages.It's not clear to me what the blinking light is. What type 
of computer do you have and what is the specific installer and version you 
tried to run?Also, what do you mean when you say that it stops working 
when you run a module? Does the interpreter crash or is there an unhandled 
exception which causes the application to exit?--nosy: 
+brian.curtinstatus: closed -> 
open___Python tracker rep...@bugs.python.org>http://bugs.python.org/issue7803>___

  ___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Florent Xicluna

Florent Xicluna  added the comment:

Confirmed with all others "isinstance(..., collections.Hashable)" and similar.

According to the documentation, we might expect the same behavior as for 
new-style class.

--
priority:  -> normal
stage:  -> needs patch
type:  -> behavior
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well the fix is easy for old-style classes, since we just have to use 
hasattr(obj, '__call__') in that case.

--
keywords: +easy
nosy: +pitrou
priority: normal -> critical

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7788] segfault when deleting from a list using slice with very big `step' value

2010-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Perfect!  Applied in r77821 through r77824;  thank you.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7782] new test for test_iter.py

2010-01-29 Thread showell

showell  added the comment:

Per Ezio's suggestions, I added clearer comments and an assert, and now the 
attached diff applies to trunk.

--
keywords: +patch
Added file: http://bugs.python.org/file16037/extend_test.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7807] test_macostools fails on OS X 10.6: no attribute 'FSSpec'

2010-01-29 Thread Mark Dickinson

New submission from Mark Dickinson :

I've been seeing the following test failure for trunk and release26-maint for a 
while, on OS X 10.6, on a relatively recent Macbook Pro (clean installation of 
Snow Leopard).  This is from a non-framework debug build (i.e., a simple 
./configure && make).


Mark-Dickinsons-MacBook-Pro:trunk dickinsm$ ./python.exe 
Lib/test/test_macostools.py
test_copy (__main__.TestMacostools) ... ERROR
test_mkalias (__main__.TestMacostools) ... ERROR
test_mkalias_relative (__main__.TestMacostools) ... ERROR
test_touched (__main__.TestMacostools) ... ok

==
ERROR: test_copy (__main__.TestMacostools)
--
Traceback (most recent call last):
  File "Lib/test/test_macostools.py", line 67, in test_copy
macostools.copy(test_support.TESTFN, TESTFN2)
  File "/Users/dickinsm/python/svn/trunk/Lib/plat-mac/macostools.py", line 114, 
in copy
srcfss = File.FSSpec(src)
AttributeError: 'module' object has no attribute 'FSSpec'

==
ERROR: test_mkalias (__main__.TestMacostools)
--
Traceback (most recent call last):
  File "Lib/test/test_macostools.py", line 75, in test_mkalias
macostools.mkalias(test_support.TESTFN, TESTFN2)
  File "/Users/dickinsm/python/svn/trunk/Lib/plat-mac/macostools.py", line 46, 
in mkalias
dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname),
AttributeError: 'module' object has no attribute 'FSCreateResourceFile'

==
ERROR: test_mkalias_relative (__main__.TestMacostools)
--
Traceback (most recent call last):
  File "Lib/test/test_macostools.py", line 90, in test_mkalias_relative
macostools.mkalias(test_support.TESTFN, TESTFN2, sys.prefix)
  File "/Users/dickinsm/python/svn/trunk/Lib/plat-mac/macostools.py", line 46, 
in mkalias
dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname),
AttributeError: 'module' object has no attribute 'FSCreateResourceFile'

--
Ran 4 tests in 0.026s

FAILED (errors=3)
Traceback (most recent call last):
  File "Lib/test/test_macostools.py", line 103, in 
test_main()
  File "Lib/test/test_macostools.py", line 99, in test_main
test_support.run_unittest(TestMacostools)
  File "/Users/dickinsm/python/svn/trunk/Lib/test/test_support.py", line 901, 
in run_unittest
_run_suite(suite)
  File "/Users/dickinsm/python/svn/trunk/Lib/test/test_support.py", line 884, 
in _run_suite
raise TestFailed(err)
test.test_support.TestFailed: multiple errors occurred
[31769 refs]


There's nothing glaringly obviously wrong in the build log.

--
assignee: ronaldoussoren
components: Macintosh, Tests
messages: 98520
nosy: mark.dickinson, ronaldoussoren
severity: normal
status: open
title: test_macostools fails on OS X 10.6: no attribute 'FSSpec'
type: behavior
versions: Python 2.6, Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Florent Xicluna

Florent Xicluna  added the comment:

Wow, critical issue, are you sure?

Here is the patch, with tests.
IMO, the tests may be ported to 3.x.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file16038/issue7624_abc.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3892] bsddb: test01_basic_replication fails sometimes

2010-01-29 Thread R. David Murray

Changes by R. David Murray :


--
keywords: +buildbot -patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3892] bsddb: test01_basic_replication fails sometimes

2010-01-29 Thread R. David Murray

R. David Murray  added the comment:

Hmm.  That's not actually the same timeout.  What that means is that if the 
startup timeout triggers, then a subsequent test (one that is looking for the 
results of a client transaction) fails, which contradicts the earlier 
observation that even if the startup timeout fails then everything else still 
passes.

--
stage: patch review -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7808] test_bsddb3 leaks references

2010-01-29 Thread Florent Xicluna

New submission from Florent Xicluna :

Patch proposed to fix the refleaks.

--
keywords: +patch
stage:  -> patch review
Added file: http://bugs.python.org/file16039/issue7808_bsddb3_refleak.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

"subtype == _InstanceType" can probably be replaced with "subtype is 
_InstanceType". Otherwise, the patch looks good to me.

--
nosy: +benjamin.peterson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7782] new test for test_iter.py

2010-01-29 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7808] test_bsddb3 leaks references

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


--
components: Extension Modules
nosy: flox
priority: normal
severity: normal
status: open
title: test_bsddb3 leaks references
type: performance
versions: Python 2.6, Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16038/issue7624_abc.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7624] isinstance(... , collections.Callable) fails with oldstyle class i nstances

2010-01-29 Thread Florent Xicluna

Florent Xicluna  added the comment:

fixed

--
Added file: http://bugs.python.org/file16040/issue7624_abc.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

The updated patch looks good---thank you!  We're getting there... :)

I'm not sure about the extra 'Operand can be Decimal or int.' in the method 
docstrings;  this just looks like extra clutter to me.  Rather, I think it 
would be a surprise worthy of documentation if these methods *didn't* accept 
int or long;  since they now do (with your patch), I don't think it's really 
worth mentioning in the docstring.  And it's not quite accurate, either, since 
these methods should accepts longs as well as ints (and bools, and instances of 
other subclasses).

Would you be content to remove these from the docstrings?  Or do others 
monitoring this issue think they should stay?

The extra doctests and test_decimal tests are nice.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

> copy_sing fixed and documented to have the same behaibour.

Hmm.  Thanks for noticing this:  it looks like Decimal.copy_sign is missing a 
_convert_other call.  I think that should be fixed in the Decimal class rather 
than in the Context class (so Context.copy_sign and Decimal.copy_sign should 
make one _convert_other call each, instead of Context.copy_sign making two 
calls).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Florent Xicluna  added the comment:

Thank you for the review and your comments.
Here, the replies.


>
> Amaury review - msg98491
>
> Here is my review of issue7092_syntax_imports_v3.diff:
>
> - test_itertools.py: please replace
>   [tuple([arg[i] if i < len(arg) else None for arg in args])
>for i in range(max(map(len, args)))]
>   by something more readable (nested for loops for example)

It is the 3.x syntax.
--> No change

> - test_mailbox.py: why doesn't test_support.import_module('rfc822')
>   specify deprecated=True? maybe the module can be imported normally...

Added the "deprecated=True"

> - test_pyclbr.py:   replace self.assertTrue(key in obj) with assertIn()
> - test_wsgiref.py:  replace self.assertTrue(key in h.environ)
> - test_queue.py: test could be identical to the one in py3k.

Thanks
--> Done

> 
> Ezio review - msg98494
> 
> Here's mine about issue7092_check_warnings_v3.diff:
> 
> 1) test_callable should keep testing callable() and the warnings should be 
> caught;

Done

> 2) in test_bsddb3 the problems should be correct in the module if possible 
> and worth it (the module is deprecated);

Ok. I prepare a separate patch to fix bsddb3

> 3) next to the several '# Silence py3k warnings' it would be nice to have a 
> note about what warning you are exactly silencing;
> 4) def test_deprecated_builtin_map -> test_deprecated_builtin_map_with_None, 
> otherwise it seems that map is deprecated;

Done

> 5) in test[_deep]_copy I'm not entirely sure that the tests are equivalent 
> using in (and if they are you should use assertIn);

Will use assertSetEqual, no need to reinvent the wheel

> 6) in test_socket I would keep callable, also shouldn't the raise in the next 
> line raise a warning as well?;

Ok to keep callable. For the next line, I do not see the warning.

> 7)  the self.assertEqual(`u2`, `d2`) in test_userdict could just use repr() 
> instead;

Done

> 8) a few tests in test_weakref should use assert[Not]In instead of 
> assertTrue(x [not] in y).

Done

> 
> Ezio review - msg98507
> 
> A couple of comments about issue7092_syntax_imports_v3.diff too:
> 1) in test_copy you remove (k,v), but left the name 'k' even if now it 
> represent the item and not the key;

Changed 'k'-> 'pair' (like 3.x)

> 2) in test_fractions you should probably use self.fail() instead of an assert;

The surrounding methods use "assert "
--> No change

> 3) on test_ftp you can use two separate lines and remove the ';';

Done

> 4) in test_pyclbr there's one extra 'f' in the comment in assertHaskey;

It is not an extra f. 'iff' = "if and only if" (not obvious for non-English 
people)

> 5) in test_xml_etree_c you can either leave callable() and catch the warning 
> or use isinstance(x, collections.Callable) instead (there are also a few more 
> places where callable was used too).

It is done this way in 3.x.
I propose to fix it separately (if a fix is required).



Now I prepare the updated patches.
I follow the proposal of Amaury: create a specific 
"test_support.silence_py3k_warnings()" context manager.
It replaces the "check_warnings" and "filterwarnings" of the proposed patches.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6766] Cannot modify dictionaries inside dictionaries using Managers from multiprocessing

2010-01-29 Thread Kaushik Ghose

Kaushik Ghose  added the comment:

Even with the patch, I can not resolve this problem. I can reproduce the 
problem with the patched version with the following code. My system is:

Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32)
IPython 0.10
Platform is Mac OS X (10.5.8) Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 
PDT 2009

import multiprocessing as mp

def f(d):
  d['f'] = {}
  d['f']['msg'] = 'I am here'

manager = mp.Manager()
d = manager.dict()

p = mp.Process(target=f, args=(d,))

p.start()
p.join()

print d

d = {}
f(d)

print d

Output:

{'f': {}}
{'f': {'msg': 'I am here'}}

--
nosy: +kghose

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5712] tkinter - askopenfilenames returns string instead of tuple in windows 2.6.1 release

2010-01-29 Thread Clovis Fabricio

Clovis Fabricio  added the comment:

I've written a quick workaround for the issue, where I manually split the 
filenames and always return a tuple.

It might be useful to someone experiencing this problem, so I'm adding it to 
the issue here.

--
nosy: +nosklo
Added file: http://bugs.python.org/file16041/issue5712_workaround.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16042/issue7269_bsddb3.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16042/issue7269_bsddb3.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16043/issue7092_bsddb3.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7808] test_bsddb3 leaks references

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +jcea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1475523] patch fixing #1448060 (gettext.py bug)

2010-01-29 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +dmalcolm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7684] decimal.py: infinity coefficients in tuples

2010-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Issue 1: (passing coefficients to decimal constructor):  While I agree that 
passing a coefficient for an infinity doesn't make a lot of sense, there's a 
backwards compatibility problem here: it worked in 3.1, so making it raise an 
exception in 3.2 might break code.  However, it seems unlikely that there's any 
correct code out there that's passing a coefficient other than (0,) or () for 
an infinity, so I'd be prepared to make this an error for coefficients other 
than () and (0,).

Issue 2: (inf.as_tuple() returns () instead of (0,) for coefficient).  On 
balance I'd prefer to leave this as it is.  It's a minor inconsistency, but I 
don't think it really does any harm.  Unless there's a real bug, making a minor 
change like this to an established API seems more likely to do harm than good.  
(It could break docstrings in third-party packages, for example.)

--
nosy: +rhettinger
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7784] patch for making list/insert at the top of the list avoid memmoves

2010-01-29 Thread showell

showell  added the comment:

I am closing this due to mostly unanimous rejection on python-dev.

If folks reopen this in the future, the last patch that I submitted has been 
reasonably well tested, but it has not been code reviewed.

The 1% speed penalty could probably be driven down without too much effort, but 
not totally eliminated.

The constraint not to add a member to PyListObject complicates the code 
considerably.

In diving deep into listobject.c, I noticed a couple things unrelated to my 
patch:

  1) There might be a refactoring available for calls to list_resize, where 
callers just pass in the delta, instead of the new list size.  Lots of the 
callers do addition that could be pushed into list_resize.  Not sure it would 
lead to speed ups, but it would probably reduce code size.

  2) The optimistic realloc scheme is probably needlessly wasteful for really 
large lists.  If you have a million elements, I am not sure you need to 
allocate 12% extra space, and I think that's what the current algorithm does 
(untested).

  3) There might be some merit in splitting out list_resize into 
list_resize_bigger and list_resize_smaller.  I think the callers generally know 
when they are shrinking/expanding the list, so callers that are shrinking the 
list could call a leaner method that just shrinks the list without having to 
execute other instructions.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7684] decimal.py: infinity coefficients in tuples

2010-01-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I also prefer to leave as-is.  It's harmless.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16044/issue7092_test_support.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file15925/issue7092_json.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Stefan Krah

Stefan Krah  added the comment:

I also think that the added docstrings are not really necessary.

Another thing: I forgot to mention 'canonical' in the list of functions
that should only accept Decimals. As with the other two (number_class
and is_canonical), this is a matter of taste. Personally I would not
expect them to work for integers.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Re: canonical.  Yes, this made me pause for a second, too.  But I don't see the 
harm in allowing it to accept ints and longs.  Actually, it then provides a 
nice public version of _convert_other.

I'd probably also allow is_canonical and number_class to accept ints and longs, 
just on the basis that that gives fewer special cases.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7770] sin/cos function in decimal-docs

2010-01-29 Thread showell

showell  added the comment:

+1 on showing off remainder_near.  I recently wrote a program where I 
reinvented the logic (on a unit circle too), not knowing it was already 
implemented in Decimal.

--
nosy: +Steve Howell

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3892] bsddb: test01_basic_replication fails sometimes

2010-01-29 Thread R. David Murray

R. David Murray  added the comment:

Since this isn't likely to get fixed and it is causing buildbot instability, I 
propose the attached patch to just skip the remainder of the test method if 
this second timeout happens.

--
keywords: +patch
Added file: http://bugs.python.org/file16045/bsddb3-skip-random-failure.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7771] dict view comparison methods are not documented

2010-01-29 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The 3.2a doc is unchanged (similarly lacking).

The situation is that view have all of the special method (operator methods) 
that frozen sets do but none of the named methods (.copy to .union). I think it 
would be helpful if the doc said so. Perhaps change

"Then these set operations are available ..."

to

"For set-like view, all of the syntax operations on sets (but none of the named 
methods, like set.copy,) are available ..."

I think

dictview < / <= / >= / > other:
 same as corresponding operation with two sets

might be sufficient, but list all four is ok too.

--
nosy: +tjreedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

The proposed addition sounds entirely reasonable to me.

In your patch, is there a reason for leaving out the first PyInt_Check (compare 
with PyLong_AsLongAndOverflow)?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file15994/issue7092_syntax_imports_v3.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file15995/issue7092_check_warnings_v3.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file15996/issue7092_filterwarnings_v3.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16046/issue7092_test_exceptions.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16047/issue7092_Wd_warnings.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16048/issue7092_syntax_fixes.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7753] newgil backport

2010-01-29 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Ross Cohen wrote:
> 
> Ross Cohen  added the comment:
> 
> I am confused by this line of reasoning. Is it ok to ignore the
> deprecation process in py3k but not in 2.x? Is it only ok if a core
> developer does it?

It's normally not ok to ignore the deprecation process for 3.x,
since the 3.x branch is in a stable state, just like the 2.x
branch (3.0 and, after some discussions, 3.1 were allowed to
break things).

I don't know why this process wasn't followed for the new GIL
implementation.

It basically breaks compatibility with the other
thread implementations, but does so without actually removing
the support for them in the thread library we're using for
the _thread module.

Perhaps this was simply not known to other developers.

There's also no PEP for the new implementation, which you'd
normally require for any such major change to the internals.

> If the point of 2.7 is to make it easier for apps and packages to be
> ported to py3k, then what would be the point of these platforms moving
> to 2.7 in the first place? It seems perfectly reasonable not to support
> platforms which are never going to care the release. If the platforms
> are broken for 2.7, you'll get that much more warning before 3.2 is
> released so it can be fixed.

Breaking existing applications and ports of Python for 2.7
certainly won't make anything easier for anyone.

For 2.7 we will certainly not allow the above to happen,
since that's the version that's going to be used by most
people for a few years to come.

What we could do for 2.7, is add Py3k deprecation warnings
to the alternative thread implementations, mentioning their
removal in 3.2.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone :


--
nosy:  -exarkun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Stefan Krah

Stefan Krah  added the comment:

Yes, indeed 'canonical' can be justified to take an integer, if we interpret 
the spec as:

'canonical' takes an operand and returns the preferred _decimal_
encoding of that operand.

But then 'is_canonical' should return false for an integer, and
this would create another special case: Accept an operand and
return something meaningful _without_ converting it first.

I think this is why I have problems with those two. 'number_class'
is less of a problem.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7753] newgil backport

2010-01-29 Thread Ross Cohen

Ross Cohen  added the comment:

On Fri, 29 Jan 2010 21:15:14 +
Marc-Andre Lemburg  wrote:

> Breaking existing applications and ports of Python for 2.7
> certainly won't make anything easier for anyone.
> 
> For 2.7 we will certainly not allow the above to happen,
> since that's the version that's going to be used by most
> people for a few years to come.
> 
> What we could do for 2.7, is add Py3k deprecation warnings
> to the alternative thread implementations, mentioning their
> removal in 3.2.

What if, as you proposed earlier, the patch were to leave the old
behavior if the threading model on the given platform were not
supported?

Ross

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16049/issue7092_silence_imports.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16050/issue7092_py3k_warnings_args.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Changes by Florent Xicluna :


Added file: http://bugs.python.org/file16051/issue7092_py3k_warnings_noargs.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Florent Xicluna

Florent Xicluna  added the comment:

Each patch can be reviewed and committed separately (except the last 2).

[patch 1] bsddb3.diff – related to Bsddb3
[patch 2] test_support.diff – new helper "silence_py3k_warnings()"
[patch 3] test_exceptions.diff – "test_pep352" and "test_exceptions"
[patch 4] Wd_warnings.diff – fix few "-Wd" warnings
[patch 5] syntax_fixes.diff – fix syntax only (2to3-like)
[patch 6] silence_imports.diff – import deprecated modukes


Patches below require the new helper "silence_py3k_warnings" (patch 2)

[patch 7] py3k_warnings_args.diff – 26 files
[patch 8] py3k_warnings_noargs.diff – 28 files

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5504] ctypes should work with systems where mmap can't be PROT_WRITE and PROT_EXEC

2010-01-29 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +dmalcolm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7633] decimal.py: type conversion in context methods

2010-01-29 Thread Juan José Conti

Juan José Conti  added the comment:

Yeah... I did't like that docstring either :) Removed!
Also fixed Decimal.copy_sign, changed Context.copy_sign and added tests.

--
Added file: http://bugs.python.org/file16052/issue7633_jjconti4.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7801] xmlrpc.client binary object examples needs to use binary mode

2010-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed in trunk by r77836 (r77837) and py3k by r77838 (r77839), thanks.

--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7801] xmlrpc.client binary object examples needs to use binary mode

2010-01-29 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7801] xmlrpc.client binary object examples needs to use binary mode

2010-01-29 Thread STINNER Victor

STINNER Victor  added the comment:

Note: The python3 example closed the file after the return instruction :-( I 
fixed that by using the with syntax, as does Python trunk example.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-29 Thread Case Van Horsen

Case Van Horsen  added the comment:

The missing PyInt_Check is a mistake. I probably thought I was working on a 
py3k version.

Let me know if I should create a new patch or if I should create one for py3k.

Thanks for the review.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6766] Cannot modify dictionaries inside dictionaries using Managers from multiprocessing

2010-01-29 Thread Terrence Cole

Terrence Cole  added the comment:

Kaushik, in your example, d is a dict proxy, so assignment to d['f'] correctly 
ferries the assignment (a new normal dict) to the d['f'] in the original 
process.  The new dict, however, is not a dict proxy, it's just a dict, so 
assignment of d['f']['msg'] goes nowhere.  All hope is not lost, however, 
because the Manager can be forked to new processes.  The slightly modified 
example below shows how this works:

from multiprocessing import Process, Manager
def f(m, d):
d['f'] = m.dict()
d['f']['msg'] = 'I am here'

m = Manager()
d = m.dict()
p = Process(target=f, args=(m,d))
p.start()
p.join()
print d
{'f': }
print d['f']
{'msg': 'I am here'}

With the attached patch, the above works as shown, without, it gives the same 
output as your original example.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1562308] uninitialized memory read in parsetok()

2010-01-29 Thread Meador Inge

Meador Inge  added the comment:

This is the same as 3367, which Benjamin just closed out.

--
nosy: +benjamin.peterson, minge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1562308] uninitialized memory read in parsetok()

2010-01-29 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6978] compiler.transformer dict key bug d[1,] = 1

2010-01-29 Thread Meador Inge

Meador Inge  added the comment:

I think this should be closed out, since the compiler package was deprecated in 
2.6.

--
nosy: +minge

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7809] Documentation for random module should indicate that a call to seed() is not required

2010-01-29 Thread Justin Lebar

New submission from Justin Lebar :

Many programmers are used to languages where the RNG is deterministic unless 
it's explicitly seeded.  This does not appear to be the case in Python.

The documentation for random should indicate that Random objects are seeded on 
construction, and that the global random object is seeded when the random 
package is first imported.

http://docs.python.org/3.1/library/random.html

--
assignee: georg.brandl
components: Documentation
messages: 98551
nosy: Justin.Lebar, georg.brandl
severity: normal
status: open
title: Documentation for random module should indicate that a call to seed() is 
not required

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7809] Documentation for random module should indicate that a call to seed() is not required

2010-01-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

It's already indicated in the documentation for random.seed([x]):
"If x is omitted or None, current system time is used; current system time is 
also used to initialize the generator when the module is first imported."

--
nosy: +ezio.melotti
priority:  -> normal
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7809] Documentation for random module should indicate that a call to seed() is not required

2010-01-29 Thread Justin Lebar

Justin Lebar  added the comment:

Ack.  I read it twice looking for that line!

Perhaps it should still indicate that new Random objects are automatically 
seeded.  And perhaps the line I missed should be a little bit louder?

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-29 Thread Ezio Melotti

Ezio Melotti  added the comment:

Warnings for imports of deprecated modules are now silenced in r77841 (patch 6 
/ silence_imports.diff).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-29 Thread Sridhar Ratnakumar

Sridhar Ratnakumar  added the comment:

For more discussion on this, see http://stackoverflow.com/questions/2166818

--
components: +Library (Lib)
nosy: +srid

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com