[issue14837] Better SSL errors

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I'd like to see this in 3.3.

--
nosy: +georg.brandl

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



[issue1757118] utilize 2.5 try/except/finally in contextlib

2012-06-19 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


Removed file: http://bugs.python.org/file25625/1.html

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



[issue12982] Document that importing .pyo files needs python -O

2012-06-19 Thread Eric O. LEBIGOT

Eric O. LEBIGOT eric.lebi...@normalesup.org added the comment:

Thank you for this lucid account of the situation, Terry.

As for where in the documentation something additional could be said about .pyo 
files and the -O option, I must say that it is already mentioned in some 
relevant places 
(http://docs.python.org/tutorial/modules.html#compiled-python-files),

However, I can see one other place where some additional information would be 
useful: in the documentation for the -O option itself 
(http://docs.python.org/using/cmdline.html#miscellaneous-options). The current 
documentation only mentions the .pyo-producing effect of -O. Mentioning there 
that -O is *required* for interpreting .pyo files would be useful.

Thanks!

--

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread anatoly techtonik

New submission from anatoly techtonik techto...@gmail.com:

http://docs.python.org/library/__main__.html

It is this environment in which the idiomatic “conditional script” stanza 
causes a script to run

?!?

--
assignee: docs@python
components: Documentation
messages: 163140
nosy: docs@python, techtonik
priority: normal
severity: normal
status: open
title: abusive language in __name__ description

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I’m no native speaker but I fail to see anything abusive here.

--
nosy: +hynek

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

It is abusive for those who don't get the meaning. Can you translate it to 
simple english?

--

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Maybe abusive language is not the right translation from Russian. It could be 
coarse language or foul language.

--

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Which specific word do you consider грубый or сквернословие? This is all 
polite, courteous wording, in my understanding of English. But maybe a native 
speaker should really comment here.

--
nosy: +loewis

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Ok, the language is not clear enough is the queasily polite, serious and 
corteous substitution for abusive language in the title of this issue.

Can you translate it to simple english?

--

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

The following fragment can be used to make a Python file both a library and a 
script.

--

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



[issue14684] zlib set dictionary support inflateSetDictionary

2012-06-19 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

 To restate my position: the need is for an immutable string of bytes, [...]

I disagree that we should require the dictionary to be immutable - if the
caller wishes to use a mutable buffer here, it is their responsibility to
ensure that it is not modified until the compressor is finished with it
(consenting adults and all that). The documentation can inform users of
this requirement.


 I believe the argument for aesthetics does not apply, as the constant
 dictionary constructor argument is a morally different kind of
 parameter, comparable to (say) the compression level.

Even so, the surrounding code sets a precedent for how it accepts binary
data buffers, and deviating from this existing convention should not be
taken lightly.


Nitpicking about the API aside, thanks for the patch :-)

--

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Or, actually 

When the script executes as this (i.e. __main__) module, the following 
conditional statement, which is in wide use and well-known, will cause the 
script to run.

--

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



[issue15104] abusive language in __name__ description

2012-06-19 Thread anatoly techtonik

anatoly techtonik techto...@gmail.com added the comment:

Now I get it. That's much better. Thanks. =)

After rereading the description with this new info I spot that __main__ is 
called a module, which is not true, because it is only a module name. It makes 
sense to enclose it in quotes in title as well.

I'd reword this:
{{{
This module represents the (otherwise anonymous) scope in which the 
interpreter’s main program executes — commands read either from standard input, 
from a script file, or from an interactive prompt. It is this environment in 
which the idiomatic “conditional script” stanza causes a script to run:
}}}

to this:
{{{
This __name__ value represents (otherwise anonymous) scope of the program’s 
main module in the interpreter. __name__ becomes equal to '__main__' when 
commands read either from standard input, from a script file, or from an 
interactive prompt. For example, a common way to add code to module that will 
only be executable when run as a script is to place it into the following if 
block:
}}}

Not academic, but practical.

--

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



[issue15068] fileinput requires two EOF when reading stdin

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Thanks Antoine.  I tested this in my virtualbox so something new must have 
happened...  Anyway, the GIL code should not have changed from before, only 
moved about slightly.  I´ll figure out what happened.

--
nosy: +kristjan.jonsson

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



[issue15068] fileinput requires two EOF when reading stdin

2012-06-19 Thread Kristján Valur Jónsson

Changes by Kristján Valur Jónsson krist...@ccpgames.com:


--
Removed message: http://bugs.python.org/msg163150

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Thanks Antoine.  I tested this in my virtualbox so something new must have 
happened...  Anyway, the GIL code should not have changed from before, only 
moved about slightly.  I´ll figure out what happened

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

You are right, Richard.  Thanks for pointing this out.  This is not a new 
problem, however, because this code has been in the New GIL since it was 
launched.

The purpose of the n_waiting member is to make signal a no-op when no one 
is there waiting.  Otherwise, we could increase the semaphore's internal count 
without bound, since the condition variable protocol allows signal to be 
called as often as one desires.
It is important that it doesn't fall out of sync with the actual semaphore 
count.  Normally what will happen when the race occurs is this:
n_waiting will be double decremented, and semaphore internal count will be 
increased by one (the wait timed out, yet we called signal).  Thus, for 
example, we could end up with the idle state of semaphore_count == 1 and 
n_waiting == -1.  (the invariant is semaphore_count + n_waiting - 
waiting_threads == 0)

When the next waiter comes along, with semaphore count==1, it will just pass 
though, having incremented n_waiting to 0.

The problem you describe is that if if 'signal' is ever hit with n_waiting0, 
it will continue to tip this balance.  What this will do is just cause the 
semaphore count to start growing.  And thus, we have defeated the purpose of 
n_waiting.  This oversight is my fault.  However rest assured that it is rare, 
having been in the new GIL implementation since its launch :)

There are two fixes:
1) As you describe, make a positive test in the signal.
2) Make the waiter the only one who updates n_waiting, whenever it wakes up.  
The side effect of this is a possible slight increase of spurious wakeups in 
some usage scenarios.  But it is simpler.

I'll implement number 1), and improve the documentation to that effect.

--

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



[issue15103] Solaris compiler chokes on importlib.h

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 What is the purpose of the comment at the end of Python/importlib.h?

The purpose is to include a NUL character in the source file so that Mercurial 
treats this (generated) file as a binary file, and so that the diffs are 
omitted in commit notification e-mails.
Since this does not seem to ve valid C (or is it?), we will have to find 
something else, I think.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

The old version was

 243 __inline static void _cond_signal(COND_T  *cond) { 
 244 /* NOTE: This must be called with the mutex held */
 245 if (cond-n_waiting  0) { 
 246 if (!ReleaseSemaphore(cond-sem, 1, NULL)) 
 247 Py_FatalError(ReleaseSemaphore() failed);
 248 --cond-n_waiting; 
 249 }  
 250 }  

So the test should be if (cv-waiting  0) not if (cv-waiting).

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Well spotted.  This probably fixes the failure we saw in the buildbots as well.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 110b38c36a31 by Kristjan Valur Jonsson in branch 'default':
Issue #15038:
http://hg.python.org/cpython/rev/110b38c36a31

--

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



[issue15104] Unclear language in __main__ description

2012-06-19 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Hmm.  I think that chapter could use a more extensive rewrite with some 
additional information provided.  For example, you actually can have a __main__ 
module in a package, and anything inside it will execute when the package is 
run via -m.

The otherwise anonymous is a bit misleading, I think.  The real distinction 
is that when a module is run as a script, __name__ is set to __main__, whereas 
when it is imported, __name__ is the module name.  This distinction allows a 
module to easily detect when it is being run as a script rather than imported, 
and the idiomatic 'conditional script' stanza is how to implement the 
behavior of a module conditionally acting as a script depending on how it is 
accessed.

--
nosy: +r.david.murray
stage:  - needs patch
title: abusive language in __name__ description - Unclear language in __main__ 
description
versions: +Python 2.7, Python 3.2, Python 3.3

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

Standard condition variables have the following guarantees:

* if there are any waiters then signal()/notify() will awaken at least one of 
them;
* if there are any waiters then broadcast()/notify_all() will awaken all of 
them.

The implementation in condvar.h does not have these guarantees since a future 
waiter (possibly the signalling thread) may steal the signal intended for a 
current waiter.

In many cases this does not matter, but in some it can cause a deadlock.  For 
instance, consider

from threading import Condition, Thread
import time

def set_to_value(value, cond, state):
while 1:
with cond:
while state.value == value:
   cond.wait()
state.value = value
print(set_to_value(%s) % value)
cond.notify_all()

class state:
value = False

c = Condition()

for i in (0, 1):
t = Thread(target=set_to_value, args=(i, c, state))
t.daemon = True
t.start()

time.sleep(5)

This *should* make state.value bounce back and forth between 0 and 1 
continually for five seconds.

But using a condition variable implemented like in condvar.h this program is 
liable to deadlock because the signalling thread steals the signal intended for 
the other thread.

I think a note about this should be added to condvar.h.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

I've increased the priority to release blocker.

Reason:
We should come to an agreement how to handle the issue. In particular we must 
not pronounce something as secure that isn't secure.

Options:

1) Remove the function.

2) Rename the function to a more sensible name and provide a bytes only 
implementation. I like the Jon's proposal and suggest timingsafe_compare().

2b) optionally create a C implementation as it's much easier to check C code 
for timing issues.

--
priority: normal - release blocker

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



[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2012-06-19 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

It's not that simple as we currently use public functions for copying the files 
and the metadata. copyfile is explicitly _not_ supposed to copy any metadata so 
we can't patch it up to do so. Also that won't help for other stat  xattr data 
so this fix would be rather incomplete.

umask is ruled out too, because that isn't (if I'm not mistaken) thread safe 
thus wouldn't help against stat  xattr disclosures anyway.

Therefore we'll have to re-implement the whole metadata stack for copy and 
copy2 using fd-based functions. Taking into account #4489, I guess it's the 
best way (+ hoping someone implements safe versions for other platforms too).

The mode itself can also be copied pretty easily using a custom opener for open 
(os.open has a mode argument).

I doubt I will be able to do that till beta1 though. But I suppose we can 
commit this while in the betas?

--
keywords:  -patch
nosy: +loewis, pitrou
stage:  - needs patch
versions: +Python 3.3 -Python 2.7, Python 3.2

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



[issue15105] curses: wrong indentation

2012-06-19 Thread vjp

New submission from vjp volker.pil...@dectris.com:

Running the program below on Linux (CentOS 5 and 6) two lines are printed, of 
which the second one is not correctly indented:

Output is:
1234567012345670
   012345670
rather than 
1234567012345670
   012345670




import curses
import time

def display(screen):
while 1:
screen.erase()
screen.addstr(1234567012345670\n)
screen.addstr(   012345670\n)
screen.refresh()

time.sleep(100)

curses.wrapper(display)

--
messages: 163161
nosy: vjp
priority: normal
severity: normal
status: open
title: curses: wrong indentation
type: behavior
versions: Python 2.7

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



[issue15064] Use context manager protocol for more multiprocessing types

2012-06-19 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
title: multiprocessing should use more context manager - Use context manager 
protocol for more multiprocessing types

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Yes, another correct observation.  This can if a thread is interrupted in 
between releasing the mutex and waiting for the semaphore.
I see no way around this apart from manually creating event objects for every 
thread.

Personally I'm not sure it is a wise guarantee to make.  The shift has been 
away from handover semantics towards retry semantics for locking in general 
over the last few years, particularly with the rise of multiprocessing.  But 
this distinction should be made clear and I will make sure to document it.  
Thanks for pointing this out.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

I thought this is settled as of f36af3766a20 (option 2)?

--

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



[issue12774] Warning -- multiprocessing.process._dangling was modified by test_multiprocessing

2012-06-19 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
status: pending - closed

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



[issue12882] mmap crash on Windows

2012-06-19 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


--
status: pending - closed

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Personally I'm not sure it is a wise guarantee to make.

If you make sure internal users are immune to this issue, then fine (but make 
sure to document it somewhere).
However, if this lost wakeup problem can affect current users of the API, then 
it sounds unacceptable.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 However, if this lost wakeup problem can affect current users of the API, 
 then it sounds unacceptable.

Let me elaborate: the GIL can perhaps suffer lost wakeups from time to time. 
The Lock API certainly shouldn't.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

 Let me elaborate: the GIL can perhaps suffer lost wakeups from time to 
 time. The Lock API certainly shouldn't.

I think with FORCE_SWITCHING defined (the default?) it is not possible for the 
thread releasing the GIL to immediately reacquire it (unless there is a 
spurious wakeup when waiting on switch_cond).

If all threads which wait on a condition are testing the same predicate then 
the stolen wakeup issue probably won't cause any misbehaviour.

--

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



[issue15103] Solaris compiler chokes on importlib.h

2012-06-19 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

It looks as great disadvantage compared with Subversion.

There are several ways to solve this problem:

1. Python/freeze_importlib.py generates a raw binary file Python/importlib.dump 
(just marshal dump) and this file is placed in the repository. Then a small C 
program Python/unpack_importlib.c (or something of the sort) is compiled and 
converts the file Python/importlib.dump in the file Python/importlib.h.

2. Python/freeze_importlib.py generates a header file Python/importlib.h.in 
with binary marker as now and this binary file is placed in the repository. 
Then on Posix systems Python/importlib.h.in is converted to Python/importlib.h 
by deleting binary marker (tr -d '\0') or whole line with binary marker 
(head/tail/sed/grep/awk). On Windows Python/importlib.h.in is just copied to 
Python/importlib.h.

--
nosy: +storchaka

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

Oh, I totally missed Nick's checkin. Sorry for the noise.

Should we add the encode('unicode-internal') trick from #14955 as the next best 
way to compare to unicode strings?

--
stage: needs patch - commit review

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



[issue14955] hmac.secure_compare() is not time-independent for unicode strings

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

Nick has pushed a patch in rf36af3766a20 that disables the comparison of 
unicode strings. See #15061

--
dependencies: +hmac.secure_compare() leaks information about length of strings

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Should we add the encode('unicode-internal') trick from #14955 as the next 
 best way to compare to unicode strings?

I don't think so.

--

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



[issue15103] Solaris compiler chokes on importlib.h

2012-06-19 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 7d86e207598f by Antoine Pitrou in branch 'default':
Issue #15103: remove the NUL character (serving as a Mercurial binary marker) 
from Python/importlib.h.
http://hg.python.org/cpython/rev/7d86e207598f

--
nosy: +python-dev

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



[issue15103] Solaris compiler chokes on importlib.h

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This should be fixed now.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Alex Gaynor

Changes by Alex Gaynor alex.gay...@gmail.com:


--
nosy: +alex

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

The implementation in condvar.h is basically the same as one of the attempts 
mentioned in

http://birrell.org/andrew/papers/ImplementingCVs.pdf

(Listing 2 fixed to use non-binary semaphores.)

The implementation for multiprocessing.Condition is virtually the same as 
Listing 3 which the author says he thinks is formally correct but with a 
fundamental performance problem.

--

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



[issue15103] Solaris compiler chokes on importlib.h

2012-06-19 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

As a general rule, generated files should not be included in the repository.

Recent mercurial versions include a --large parameter for hg add that 
threat files as binary. In particular, precludes hg diff, that I guess it is 
the point here.

--

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



[issue15103] Solaris compiler chokes on importlib.h

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 As a general rule, generated files should not be included in the
 repository.

We already include generated files such as configure. This is either for
convenience or for bootstrap purposes.

 Recent mercurial versions include a --large parameter for hg add
 that threat files as binary.

No, it has nothing to do. --large is added by the largefiles
extension.

--

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



[issue14772] Return destination values in some shutil functions

2012-06-19 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset e8ea27ab9fa6 by Brian Curtin in branch 'default':
Add versionchanged tags for #14772 changes
http://hg.python.org/cpython/rev/e8ea27ab9fa6

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 The implementation for multiprocessing.Condition is virtually the same
 as Listing 3 which the author says he thinks is formally correct but
 with a fundamental performance problem.

To me, it seems similar to the last listing (under The Sequel—NT and
PThreads): there's a separate semaphore per waiter, used to wake it up
when signal() or broadcast() is called.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 The problem Richard describes isn´t a lost wakeup.  PyCOND_SIGNAL
 _will_ wake up _at least_ one thread.  It just isn't guaranteed to be
 one of those who previously called PyCOND_WAIT(): It could be a
 latecomer to the game, including the one who called Signal himself.
 If no such thread comes in to steal it, then one of the waiting
 threads _will_ wake up.

Ok, thanks for clearing up.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

The problem Richard describes isn´t a lost wakeup.  PyCOND_SIGNAL _will_ wake 
up _at least_ one thread.  It just isn't guaranteed to be one of those who 
previously called PyCOND_WAIT(): It could be a latecomer to the game, including 
the one who called Signal himself.  If no such thread comes in to steal it, 
then one of the waiting threads _will_ wake up.

None of the internal usages of condition variables makes this assumption about 
the order of wakeup from PyCOND_WAIT().

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

  The implementation for multiprocessing.Condition is virtually the same
  as Listing 3 which the author says he thinks is formally correct but
  with a fundamental performance problem.
 
 To me, it seems similar to the last listing (under The Sequel—NT and
 PThreads): there's a separate semaphore per waiter, used to wake it up
 when signal() or broadcast() is called.

Ah, you said multiprocessing.Condition. Sorry. I was thinking about
threading.Condition.

--

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



[issue15106] Potential Bug in errors.c

2012-06-19 Thread Ken Cheung

New submission from Ken Cheung msrbugzi...@gmail.com:

I observed a code clone from the following files.

function : PyErr_Restore @ (file: Python-3.3.0a4/Python/errors.c, line: 27)~49
function : PyErr_SetExcInfo @ (file: Python-3.3.0a4/Python/errors.c, line: 
341)~353

The function PyErr_Restore performs some checking on traceback while 
PyErr_SetExcInfo does not. I wonder if this is necessary in the function 
PyErr_SetExcInfo. The source code is included in the attachment. Hope it helps.

--
components: None
files: errors_clone.txt
messages: 163181
nosy: Ken.Cheung
priority: normal
severity: normal
status: open
title: Potential Bug in errors.c
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26049/errors_clone.txt

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



[issue14913] tokenize the source to manage Pdb breakpoints

2012-06-19 Thread Xavier de Gaye

Xavier de Gaye xdeg...@gmail.com added the comment:

Uploaded pdb_default_2.patch.
This new patch fixes the previous patch that fails to stop at
breakpoints set in nested functions, and extends the previous patch in
allowing breakpoints outside function and method definitions.

 When a breakpoint is set at the line number of a function definition,
 the algorithm used to find the first statement of the function (the
 actual breakpoint) is not robust, so that when another breakpoint is
 also set at this fuction using the function name instead of the line
 number, then this last breakpoint hides the first one.

This is not correct. One should read instead:

When a breakpoint is set at the first statement of a function and
another breakpoint is set using the function name, then the first
breakpoint hides the other one.

This is fixed as well in both patches.

--
Added file: http://bugs.python.org/file26050/pdb_default_2.patch

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

It's an interesting article Richard, but I don't see how their 2nd attempt 
solves the probvlem.  All it does is block the thread doing the Signal(), not 
other threads, from stealing the wakeup.

I think I know how to fix this correctly, using a separate internal locking 
condition variable.  I will make some offline experiments with that, to see if 
it makes sense, given the added complexity.  In the mean time, I will document 
this issue and add the link to the article you mentioned.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

The notes should also mention that PyCOND_SIGNAL() and PyCOND_BROADCAST() must 
be called while holding the mutex.  (pthreads does not have that restriction.)

--

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



[issue15107] Potential Bug in mpdecimal.c

2012-06-19 Thread Ken Cheung

New submission from Ken Cheung msrbugzi...@gmail.com:

I observed a code clone from the following files.

function : mpd_qexp @ (file: 
Python-3.3.0a4/Modules/_decimal/libmpdec/mpdecimal.c, line: 4092)~4165
function : mpd_qln @ (file: 
Python-3.3.0a4/Modules/_decimal/libmpdec/mpdecimal.c, line: 4525)~4612

In the first few lines of this clone, the function mpd_qexp only calls 
mpd_setspecial when mpd_isnegative is false while the function mpd_qln calls 
mpd_setspecial independent of the value of mpd_isnegative. I wonder the 
checking is necessary in the function mpd_qln. The source code is included in 
the attachment. Hope it helps.

--
components: Library (Lib)
files: mpdecimal_clone.txt
messages: 163185
nosy: Ken.Cheung
priority: normal
severity: normal
status: open
title: Potential Bug in mpdecimal.c
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26051/mpdecimal_clone.txt

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Unicode string timing depends on the string implementation which depends on the 
maximum character code in the string. Strings 'A'*+'$' 'A'*+'€'  have 
different timings for almost all operations (inluding 
encode('unicode-internal')).

--
nosy: +storchaka

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Right.
Without holding the mutex, the definition of already blocked is of course 
meaningless, since only the holding the mutex can define any ordering.
pthread standard indeed says however, if predictable scheduling behaviour is 
required, then that mutex is locked by the thread calling pthread_cond_signal() 
or pthread_cond_broadcast().

There are a number of implementations that are subjects to serious problems if 
the mutex isn't held when doing pthread_cond_signal(), including the notorious 
'lost wakeup' bug, eg:  
http://docs.oracle.com/cd/E19963-01/html/821-1601/sync-21067.html, so it is 
certainly recommended practice to use pthread_cond_signal() with the mutex held 
regardless.

But you are right, the emulation implementation depends on the mutex not only 
for predicable scheduling but for synchronizing access to the internal state, 
and this should be documented.

--

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



[issue15107] Potential Bug in mpdecimal.c

2012-06-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

The code looks fine to me.

 In the first few lines of this clone, the function mpd_qexp only calls 
 mpd_setspecial when mpd_isnegative is false while the function mpd_qln 
 calls mpd_setspecial independent of the value of mpd_isnegative.

That would probably be because exp(-infinity) is 0, which isn't a 
floating-point special value, and ln(-infinity) is NaN, which is.

In general, I don't think this kind of report is terribly helpful unless you've 
also examined *and understood* the code, and based on that understanding you've 
established that there's a high likelihood of a real bug.

--
nosy: +mark.dickinson, skrah
resolution:  - invalid
status: open - closed

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



[issue15104] Unclear language in __main__ description

2012-06-19 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti
type:  - enhancement

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



[issue14973] restore python2 unicode literals in ur strings

2012-06-19 Thread Vinay Sajip

Changes by Vinay Sajip vinay_sa...@yahoo.co.uk:


--
superseder:  - Drop support for the ur string prefix

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



[issue15107] Potential Bug in mpdecimal.c

2012-06-19 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 That would probably be because exp(-infinity) is 0, which isn't a
 floating-point special value, and ln(-infinity) is NaN, which is.

Actually, looking at the code, mpd_setspecial is called under exactly the same 
circumstances (namely for +inf) in *both* cases; for -inf, the exp code calls 
_settriple, while the ln code calls mpd_seterror.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Oh, I see, Antoine said the same thing (msg162771).

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset d7a72fdcc168 by Kristjan Valur Jonsson in branch 'default':
Issue #15038: Document caveats with the emulated condition variables.
http://hg.python.org/cpython/rev/d7a72fdcc168

--

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



[issue14187] add function annotation entry to Glossary

2012-06-19 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +zach.ware

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



[issue15102] Fix 64-bit building for buildbot scripts

2012-06-19 Thread Zachary Ware

Changes by Zachary Ware zachary.w...@gmail.com:


--
nosy: +zach.ware

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

I'm well aware of the fact that they have different timings. That's why I 
argued against including a unicode aware variant of the timing safe compare 
function.

I've used Guido's time machine and seen requests for a unicode function in the 
future. ;) I think (educated guess) that s.encode('unicode-internal') discloses 
the least amount of information. That way I argued that we suggest it in the 
documentation.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 I'm well aware of the fact that they have different timings. That's
 why I argued against including a unicode aware variant of the timing
 safe compare function.

I would not want to repeat myself, but the compare function can be made
safe if it restricts itself to a given kind of unicode string (say,
all-ASCII).

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

 It's an interesting article Richard, but I don't see how their 2nd attempt 
 solves the problem.  All it does is block the thread doing the Signal(), 
 not other threads, from stealing the wakeup.

Do you mean the listing on page 5?  (The earlier attempts were failures.)  The 
signalling thread holds the lock x while issuing the signal s.V() and 
waiting for notification of wakeup h.P().  A new thread cannot steal the 
wakeup because it needs to acquire the lock x before it can start its wait.

Of course, if the main mutex is always held when doing signal()/broadcast() 
then the lock x is unnecessary.

I don't think trying to do a full emulation is necessary.  Better to just 
document the limitations.

--

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

Ah, right, the lock x, I forgot about that.

--

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

Alright, Antoine.

Shall explore option 2b) optionally create a C implementation as it's much 
easier to check C code for timing issues as I suggested in 
http://bugs.python.org/issue15061#msg162893 ?

--

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



[issue15008] PEP 362 Signature Objects reference implementation

2012-06-19 Thread Yury Selivanov

Yury Selivanov yseliva...@gmail.com added the comment:

New patch (pep362.5.patch)

Fixed a bug in BoundArguments.args  BoundArguments.kwargs

--
Added file: http://bugs.python.org/file26052/pep362.5.patch

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



[issue15038] Optimize python Locks on Windows

2012-06-19 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

1.41 Generic emulations of the pthread_cond_* API using
1.42 earlier Win32 functions can be found on the Web.
1.43 The following read can be edificating (or not):
1.44 http://www.cse.wustl.edu/~schmidt/win32-cv-1.html
1.45 +
1.46 +   See also 
1.47  */

1.45 and 1.46 should be removed?

Also I would not recommend the win32-cv-1.html page as edificating 
(edifying?).  The implementations all either suffer from the same stolen wakeup 
issue or are broken.*


* win32-cv-1.html assumes that SignalObjectAndWait() is atomic and that 
PulseEvent() is guaranteed to wake a waiting thread if there is one -- but 
Microsoft's documentation now admits that both these assumptions are false.

--

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



[issue14684] zlib set dictionary support inflateSetDictionary

2012-06-19 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

So my question is easy: could we apply this patch as is and defer any 
improvement to 3.4?. The risk of not doing so would be to miss 3.3 completely.

--

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



[issue15008] PEP 362 Signature Objects reference implementation

2012-06-19 Thread Yury Selivanov

Yury Selivanov yseliva...@gmail.com added the comment:

New patch (pep362.6.patch)

Fixed a bug in BoundArguments.args when positional arguments were partially 
mapped by functools.partial

--
Added file: http://bugs.python.org/file26053/pep362.6.patch

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



[issue444582] Finding programs in PATH, adding shutil.which

2012-06-19 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

Before we miss yet another beta freeze, how does something like this look? 

It moves `which` into one function which always yields paths. I don't think 
anyone will approve of adding a dual-function API to solve this problem. I 
originally tried an approach where the function returned one value and had an 
option to return an iterator, but nearly everyone I asked found it unacceptable 
and potentially confusing.

This patch removes the custom pathext stuff seen in other patches. It doesn't 
seem like it would be that useful to have it, and I'm not sure why you would 
want to.

Unless anyone is violently opposed, I think we should just go on with it. If we 
want to add to it, we can add to it in 3.4, but I think something should go in 
for 3.3. The issue has been open with various patches for over 10 years...

--
assignee: tarek - brian.curtin
Added file: http://bugs.python.org/file26054/issue444582.diff

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



[issue15008] PEP 362 Signature Objects reference implementation

2012-06-19 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

I left a few comments on rietveld.
The '\' is sometimes used where not necessary and the preferred way to write 
conditions on multiple lines is:
(foo == bar and
 bar == baz and
 baz == asd)
rather than
foo == bar \
and bar == baz \
and baz == asd

Have you measured the coverage of the tests?

--
nosy: +ezio.melotti

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



[issue15008] PEP 362 Signature Objects reference implementation

2012-06-19 Thread Yury Selivanov

Yury Selivanov yseliva...@gmail.com added the comment:

New patch - pep362.6.patch

Ezio,

I've eliminated almost all '\'.
Test coverage is now almost 100%.

--
Added file: http://bugs.python.org/file26055/pep362.6.patch

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



[issue13463] Fix parsing of package_data

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

This has Python 3.3 set as Version.  Does it really block the 3.3 release?

--
nosy: +georg.brandl

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Is this issue still valid?

--
nosy: +georg.brandl

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



[issue15061] hmac.secure_compare() leaks information about length of strings

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

So it's not a blocker anymore, right?

--
nosy: +georg.brandl
priority: release blocker - normal

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



[issue5302] Allow package_data specs/globs to match directories

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Does this block 3.3b1?

--
nosy: +georg.brandl

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



[issue14340] Update embedded copy of expat - fix security crash issues

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Greg, are you still going to update expat in time for 3.3?  Otherwise this 
doesn't block 3.3 anymore.

--

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



[issue14578] importlib doesn't check Windows registry for paths

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Brett (and/or Brian?), this sounds like it should be tackled soon, to give 
Windows users enough time of testing 3.3.

--
nosy: +georg.brandl

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



[issue14790] use packaging in setup.py

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I'm not willing to hold up 3.3 for this.  On the other hand, it should not be 
done in the beta stage.  And I don't assume it's a trivial matter (Éric?), so 
I'm inclined to move it to 3.4.

--
nosy: +georg.brandl

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



[issue12779] Update packaging documentation

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Ping.  Does this block 3.3?

--
nosy: +georg.brandl

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



[issue13959] Re-implement parts of imp in pure Python

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Which parts are still missing here?

--
nosy: +georg.brandl

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



[issue14928] Fix importlib bootstrapping issues

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Is this ready to go in before beta1?

--
nosy: +georg.brandl

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



[issue15096] Drop support for the ur string prefix

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

If you commit this, please do so before beta1.

--
nosy: +georg.brandl

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



[issue12046] Windows build identification incomplete

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

I guess this is not an issue anymore.

--
resolution:  - out of date
status: open - pending

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Ping?

--

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



[issue14940] Usage documentation for pysetup

2012-06-19 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Ping.  This isn't necessary for beta1, but would be nice to have once the final 
release draws near.

--
nosy: +georg.brandl

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-06-19 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

In progress; fixes for this and the other Xcode4-related issues will be in for 
3.3.0b1.

--

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



[issue14928] Fix importlib bootstrapping issues

2012-06-19 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset c3616595dada by Antoine Pitrou in branch 'default':
Issue #14928: Fix importlib bootstrap issues by using a custom executable 
(Modules/_freeze_importlib) to build Python/importlib.h.
http://hg.python.org/cpython/rev/c3616595dada

--
nosy: +python-dev

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



[issue14225] _cursesmodule compile error in OS X 32-bit-only installer build

2012-06-19 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

It was still valid as of 3.3.0a4.

--

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



[issue15096] Drop support for the ur string prefix

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

I'll submit an updated patch tomorrow.

--
assignee:  - christian.heimes

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



[issue14928] Fix importlib bootstrapping issues

2012-06-19 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Should be ok now.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue15096] Drop support for the ur string prefix

2012-06-19 Thread Christian Heimes

Christian Heimes li...@cheimes.de added the comment:

New patch:

* corrected comment in Parser/tokenizer.c

* added test for ub and bu raising SyntaxError

* removed handling of ur from tokenize module

Serhiy, could you please review my changed to the tokenize module? I think I 
found all relevant places but I'm not absolutely sure.

--
keywords: +needs review
stage: needs patch - patch review
Added file: http://bugs.python.org/file26056/issue15096-2.patch

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2012-06-19 Thread Pankaj D

New submission from Pankaj D p...@comcast.net:

Hi,

Sporadically, while running an sqlite3 query, the above error is seen.
In order to debug, I modified Objects/tupleobject.c, PyTuple_SetItem() as 
follows:

if (!PyTuple_Check(op) || op-ob_refcnt != 1) {
Py_XDECREF(newitem);
/*
 * Temp: Bug XYZ Generate core so that we can debug
 *  
 * PyErr_BadInternalCall();
 * return -1;
*/
char errmsg[200];
sprintf(errmsg, Bug XYZ: PyTuple_Check(op) = %d 
op-ob_refcnt = %d; see core\n, PyTuple_Check(op),
op-ob_refcnt);
Py_FatalError(errmsg); 
}

This generates a core with the following bt.  Showing the top few frames only:
(gdb) bt
#0  0x000800acd3fc in thr_kill () at thr_kill.S:3
#1  0x000800b5e283 in abort () at /build/mnt/src/lib/libc/stdlib/abort.c:65
#2  0x00494acf in Py_FatalError (msg=Variable msg is not available.
) at ./../Python/pythonrun.c:1646
#3  0x0044e740 in PyTuple_SetItem (op=0x80c6e6308, i=16, 
newitem=0x80a80d780) at ./../Objects/tupleobject.c:128
#4  0x000807298866 in _pysqlite_fetch_one_row (self=0x80b846e48) at 
_sqlite/cursor.c:402
#5  0x000807298bf5 in pysqlite_cursor_iternext (self=0x80b846e48) at 
_sqlite/cursor.c:898
#6  0x00476943 in PyEval_EvalFrameEx (f=0x80a94d420, throwflag=Variable 
throwflag is not available.
) at ./../Python/ceval.c:2237
#7  0x0047acbf in PyEval_EvalFrameEx (f=0x80a94b820, throwflag=Variable 
throwflag is not available.
) at ./../Python/ceval.c:3765
#8  0x0047bf09 in PyEval_EvalCodeEx (co=0x808d2ac60, globals=Variable 
globals is not available.
) at ./../Python/ceval.c:2942
...
(gdb) fr 4
#4  0x000807298866 in _pysqlite_fetch_one_row (self=0x80b846e48) at 
_sqlite/cursor.c:402
402 PyTuple_SetItem(row, i, converted);
Current language:  auto; currently c
(gdb) l
397 converted = buffer;
398 }

(gdb) p *(PyTupleObject *)row
$11 = {ob_refcnt = 2, ob_type = 0x60fee0, ob_size = 22, ob_item = {0x80a534030}}

'row' was allocated via PyTuple_New()
but, somehow its  refcount has become 2 while setting the 16th item!!!

Is this a known issue?  If not, what can I do to debug.

Thanks,
Pankaj

--
messages: 163224
nosy: pxd
priority: normal
severity: normal
status: open
title: ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to 
internal function
type: behavior
versions: Python 2.6

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2012-06-19 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Could you possibly reproduce this in 2.7, 3.2 and/or default (future 3.3)?.

Python 2.6 support is over.

--
components: +Cross-Build
nosy: +jcea

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2012-06-19 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
components:  -Cross-Build

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



[issue15108] ERROR: SystemError: ./../Objects/tupleobject.c:118: bad argument to internal function

2012-06-19 Thread Pankaj D

Pankaj D p...@comcast.net added the comment:

sorry, 2.7, 3.2 is not an option currently but I am hoping someone can
provide enough info to help probe this more efficiently.  There seem to be 
references to this issue on the web but no root-cause.

--

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



  1   2   >