[issue24594] msilib.OpenDatabase Type Confusion

2015-07-09 Thread Mark Lawrence

Changes by Mark Lawrence :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Nick Coghlan

Nick Coghlan added the comment:

The problems with using concurrent.futures directly for running synchronous 
tasks in the background are:

1. You have to manage the lifecycle of the executor yourself, rather than 
letting asyncio do it for you
2. There's no easy process wide way to modify the size of the background task 
thread pool (or switch to using processes instead)
3. There's no easy way for background tasks themselves to use asynchronous IO

With the switch to "background_call" as the name, I'd modify the implementation 
to detect coroutines and schedule them as tasks rather than running them in the 
executor.

However, I think it's clear that the idea and its potential benefits are 
sufficiently unclear that making the case effectively may require a PEP. That's 
probably worth doing anyway in order to thrash out more precise semantics.

--
title: [RFE] Add asyncio.call_async API -> [RFE] Add asyncio.background_call API
versions:  -Python 3.5

___
Python tracker 

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



[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-07-09 Thread David Beazley

David Beazley added the comment:

Frivolity aside, I really wish this issue would get more traction and a fix.

Indentation is an important part of the Python language (obviously).  A pretty 
standard way to indent is to hit "tab" in whatever environment you're using to 
edit Python code.

Yet, at the interactive prompt, tab doesn't actually indent on a blank line. 
Instead, it autocompletes the builtins.  Aside from it being highly annoying 
(as previously mentioned), it is also an embarrassment.

Newcomers to Python will very often try things out using the stock interpreter 
before moving on to more sophisticated environments.  The fact that tab is 
broken from the get-go leaves a pretty sour impression when not even the most 
basic tutorial examples work at the interactive console (and keep in mind that 
whitespace sensitivity is probably already an issue on their minds).

Experienced Python users coming from Python 2 to Python 3 are going to find 
that tab is busted in Python 3.  Well, of course it's busted because everything 
is busted in Python 3.  "Wow, this really sucks as bad as everyone says" 
they'll say. 

So, with that as context, I'm really hoping I don't have to watch people use a 
busted tab key for another entire release cycle of Python 3 as I did for 
Python-3.4. 

I have no particular thoughts about the specifics (tabs vs. spaces) or the 
amount of indentation.   It's the autocomplete on empty line that's the issue.

--

___
Python tracker 

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



[issue24166] ArgumentParser behavior does not match generated help

2015-07-09 Thread Benjamin Schubert

Benjamin Schubert added the comment:

Ok, sorry for the delay.

I see your point and understand the difficulty of having done right.

Should I close the issue, or propose something else ?

Thanks

--

___
Python tracker 

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



[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-07-09 Thread David Beazley

David Beazley added the comment:

Wanted to add:  I see this as being about the same as having a broken window 
pane on the front of Python 3.  Maybe there are awesome things inside, but it 
makes a bad first impression on anyone who dares to use the interactive console.

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Stefan Krah

Stefan Krah added the comment:

Qt had a similar initiative regarding -msse2 -mfpmath:

http://lists.qt-project.org/pipermail/development/2013-December/014530.html


They say that also Visual Studio 2012 has switched to sse2 by default.

The only problem are the Linux distributions that are stuck in i386 land
and who would probably disable the flags in their builds.

--

___
Python tracker 

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



[issue24136] document PEP 448: unpacking generalization

2015-07-09 Thread Neil Girdhar

Neil Girdhar added the comment:

Copied from closed issue 24240:

Since Grammar/Grammar relies on semantic postprocessing in ast.c,
it would be nice to have an update of the (human readable) Grammar
in the language reference docs.

--

___
Python tracker 

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



[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

> 1. You have to manage the lifecycle of the executor yourself, rather than 
> letting asyncio do it for you
> 2. There's no easy process wide way to modify the size of the background task 
> thread pool (or switch to using processes instead)

But if that's what you want, adding a helper or helpers to concurrent.futures 
makes more sense than adding it to asyncio, which is primarily about using an 
event loop, *not* threads.

> 3. There's no easy way for background tasks themselves to use asynchronous IO

But how does your proposal help for that? The function passed to 
background_call() is in no way enabled to do async I/O -- it has no event loop 
and it is not a coroutine, and it's running in a separate thread.

> With the switch to "background_call" as the name, I'd modify the 
> implementation to detect coroutines and schedule them as tasks rather than 
> running them in the executor.

Honestly, I think that convenience routines that fuzz the difference between 
synchronous functions (to be run in a thread) and coroutines don't do anyone a 
service -- an API should educate its users about proper use and the right 
concepts, and this sounds like it is encouraging staying ignorant.

> However, I think it's clear that the idea and its potential benefits are 
> sufficiently unclear that making the case effectively may require a PEP. 
> That's probably worth doing anyway in order to thrash out more precise 
> semantics.

Or you could just give up. Honestly, I am liking this less and less the more 
you defend it. That's a classic sign that you should give up. :-)

--

___
Python tracker 

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



[issue24595] InteractiveInterpreter always prints to stdout

2015-07-09 Thread Anton Astafiev

New submission from Anton Astafiev:

I have a use-case when I need to forward InteractiveConsole through Unix/TCP 
socket. Expected implementation:

class InteractiveSocket(InteractiveConsole):
  def __init__(self, socket):
self._socket = socket
...

  def raw_input(...):
# read from socket

  def write(...):
# write to socket

However, only syntax errors and tracebacks are written into a socket, while 
actual output still appears on servers stdout. Digging through it I realized, 
that the output happens inside exec call in InteractiveInterpreter.runcode and 
here is why:

>>> c=compile('42', '', 'single')
>>> dis.dis(c)
<<< 1   0 LOAD_CONST   0 (42)
3 PRINT_EXPR  
4 LOAD_CONST   1 (None)
7 RETURN_VALUE

where PRINT_EXPR uses _Py_IDENTIFIER(displayhook);

I ended up with the following dirty hack in my derived class:

def runcode(self, code):
  class OutWriter:
pass
  writer = OutWriter()
  writer.write = self.write
  old = sys.stdout
  sys.stdout = writer
  try:
exec(code, self.locals)
  except SystemExit:
raise
  except:
self.showtraceback()
  sys.stdout = old

I think it would be nice to make InteractiveInterpreter extendable out of the 
box, though I don't have exact solution here.

--
components: Library (Lib)
messages: 246487
nosy: Anton Astafiev
priority: normal
severity: normal
status: open
title: InteractiveInterpreter always prints to stdout
type: behavior

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Martin Richard

Martin Richard added the comment:

Hi,

I would like to update this patch so it can finally land in cpython, hopefully 
3.6.

tl;dr of the thread:
In a nutshell, the latest patch from Kristján Valur Jónsson updates
SSLContext.load_cert_chain(certfile, keyfile=None, password=None) and
SSLContext.load_verify_locations(cafile=None, capath=None)

so certfile, keyfile and cafile can be either a string representing a path to a 
file or a file-like object.

The discussion seems to favor this API (pass file-like objects) rather than 
using new arguments (certdata, keydata) to pass string or bytes objects.

However, Christian Heimes proposed a patch (which landed in 3.4) which adds a 
cadata argument to load_verify_locations().


So, what should we do?
- allow certfile, keyfile and cafile to be paths or file-like objects,
- add certdata and keydata to load_cert_chain() to be consistent with 
load_verify_locations(), 
- do both.

I'd go the the 2nd solution to be consistent with the API and keep things 
simple.

--
nosy: +martius
versions: +Python 3.6

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I thing adding "keydata" and "certdata" makes things more complicated, on the 
contrary. You start having an API with many optional arguments but some of them 
are exclusive with each other (because you can only specify a single key and 
cert chain).

The "cafile", "capath", "cadata" in load_verify_locations() are cumulative, but 
they would be exclusive in load_cert_chain(): there's not much symmetry.

--

___
Python tracker 

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



[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Nick Coghlan

Nick Coghlan added the comment:

I'll at least write a new python-ideas post, as I realised my original idea 
*is* wrong (and you're right not to like it). The focus needs to be on Sven's 
original question (How do you kick off a coroutine from otherwise synchronous 
code, and then later wait for the result?), and then asking whether or not it 
might make sense to provide a convenience API for such an interface between the 
worlds of imperative programming and event-driven programming.

Sven's far from the only one confused by that particular boundary, so even if a 
convenience API doesn't make it into the module itself, an example in the docs 
explaining how to implement it may be helpful.

--

___
Python tracker 

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



[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Petr Viktorin

New submission from Petr Viktorin:

When this program is invoked as a script (`python reproducer.py`), the __del__ 
is never called:

---

class ClassWithDel:
def __del__(self):
print('__del__ called')

a = ClassWithDel()
a.link = a

raise SystemExit(0)

---


Raising a different exception, moving the code to a function, importing the 
module, or invoking with -m (or even -c), causes __del__ to be called normally.

--
components: Interpreter Core
messages: 246491
nosy: encukou
priority: normal
severity: normal
status: open
title: Script globals in a GC cycle not finalized when exiting with SystemExit
versions: Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Martin Richard

Martin Richard added the comment:

You are right.

And if certfile and keyfile (args of load_cert_chain()) accept file-like 
objects, we agree that cafile (load_verify_location()) should accept them too?

--

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou

New submission from Antoine Pitrou:

singledispatch currently doesn't defend against unwanted redefinition of an 
existing specialization, e.g.:

>>> def f(x): return "default"
... 
>>> f = functools.singledispatch(f)
>>> @f.register(int)
... def _(x): return "1"
... 
>>> @f.register(int)
... def _(x): return "2"
... 
>>> f(42)
'2'

This can be annoying when used as an extension mechanism. It would be nice if 
at least an option in the singledispatch() constructor could prevent this.

--
components: Library (Lib)
messages: 246493
nosy: lukasz.langa, ncoghlan, pitrou, rhettinger
priority: normal
severity: normal
status: open
title: forbid redefinition of specializations in singledispatch
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 09/07/2015 15:40, Martin Richard a écrit :
> 
> And if certfile and keyfile (args of load_cert_chain()) accept
file-like objects, we agree that cafile (load_verify_location()) should
accept them too?

It could, but that's a separate issue. Let's stay focused on what is
necessary to solve this use case, IMO (i.e. specify non-file-backed data
as a certification chain or private key).

--

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I didn't take time to read the whole discussion. For me, it's a good 
idea to accept a filename or a file object in the same parameter. Having two 
exclusive parameters for the same thing (ex: CA) doesn't smell like a great API.

--

___
Python tracker 

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



[issue16487] Allow ssl certificates to be specified from memory rather than files.

2015-07-09 Thread Christian Heimes

Christian Heimes added the comment:

I'd rather introduce new types and have the function accept either a string 
(for path to fiel) or a X509 object and a PKey object. It's more flexible and 
secure. With a private key type we can properly support crypto ENGINEs and wipe 
memory when the object gets deallocated.

--

___
Python tracker 

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



[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Yeah, we should strongly consider writing more documentation before adding more 
convenience APIs. Esp. tutorial-style docs, which neither Victor nor I can 
supply because we've already moved beyond wizard level ourselves so it's hard 
for us to imagine the beginner's perspective. :-(

--

___
Python tracker 

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



[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

It's likely that your global variable gets caught in the traceback attached to 
the SystemExit, and that either never gets deallocated, or gets deallocated too 
late.

--
nosy: +pitrou

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor

New submission from STINNER Victor:

When storing an exception in an asyncio Future object, there is a high risk of 
creating a reference cycle. In Python 3, exception objects store a traceback 
object which store frame objects. The problem is that a frame can also have a 
reference to the exception: we have a reference cycle (exception -> traceback 
-> frame -> same exception).

In debug mode, Future.set_exception() can schedule a task (ex: using 
loop.call_soon) to check that there is no reference cycle.

See also the issue #23587: "asyncio: use the new traceback.TracebackException 
class".

--
components: asyncio
messages: 246499
nosy: gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: add background task detecting reference cycles
versions: Python 3.6

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Doesn't the cycle-detecting GC handle these?

--

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor

STINNER Victor added the comment:

> Doesn't the cycle-detecting GC handle these?

Maybe you are lucky and the GC is able to break the cycle. Maybe you are 
unlucky and all objects part of the cycle will never be deleted. Python 3.4 is 
better to handle these cases, but Python 3.3 is worse to handle reference 
cycles.

Being aware of the cycles help the developer to control when objects are 
deleted. It mean breaking the cycles help to delete objects sooner.

See other asyncio issues about "reference cycles" for some examples.

--

___
Python tracker 

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



[issue24596] Script globals in a GC cycle not finalized when exiting with SystemExit

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Actually, the problem is in PyRun_SimpleFileExFlags(). The executed module is 
decref'ed after calling PyErr_Print(), but the latter never returns when the 
exception is a SystemExit.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Hm. If the problem is most prominent with 3.3, why mark the issue as 3.6? Do 
you have an implementation already? Maybe it can be a 3rd party package rather 
than integrated in asyncio debug mode?

--

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor

STINNER Victor added the comment:

> Hm. If the problem is most prominent with 3.3, why mark the issue as 3.6?

Well, I plan to implement this feature in "asyncio", so for 3.3-3.6 in fact.

> Do you have an implementation already?

Nope, it's more a TODO task for myself :-)

> Maybe it can be a 3rd party package rather than integrated in asyncio debug 
> mode?

Hum, I'm not sure. My idea is to add code in Future.set_exception() because I 
will probably need a reference to the exception object (and maybe to the Future 
object). Currently, it's not possible to replace the Future class (whereas we 
have BaseEventLoop.set_task_factory and BaseEventLoop.create_task). I don't 
think that it's worth to make it possible to replace/hook this class. I don't 
expect a huge complex code to detect reference cycles.

Please give me some weeks to investigate this issue. It will be easier to 
discuss with a working patch.

I opened the issue as a reminder for myself, but also to colaborate on it.

--

___
Python tracker 

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



[issue15014] smtplib: add support for arbitrary auth methods

2015-07-09 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 97a29b86a2dc by Barry Warsaw in branch '3.5':
- Issue #15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional
https://hg.python.org/cpython/rev/97a29b86a2dc

New changeset 2d9003d44694 by Barry Warsaw in branch 'default':
- Issue #15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional
https://hg.python.org/cpython/rev/2d9003d44694

--

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Ethan Furman

Ethan Furman added the comment:

Is it too late to have the default for that option be to not allow the 
replacement?  That would be the safer course.

--
nosy: +ethan.furman

___
Python tracker 

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



[issue15014] smtplib: add support for arbitrary auth methods

2015-07-09 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
assignee:  -> barry
status: open -> closed

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

OK, no problem. (Side comment: Future is being subclassed a lot, so
parametrizing its construction may not be so easy.)

--

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Martin Panter

Changes by Martin Panter :


--
nosy: +vadmium

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't know. I'm assuming some people actually want to redefine existing 
specializations.

--

___
Python tracker 

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



[issue23319] Missing SWAP_INT in I_set_sw

2015-07-09 Thread Meador Inge

Meador Inge added the comment:

I will review this today.

--
assignee:  -> meador.inge
stage:  -> patch review

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Ethan Furman

Ethan Furman added the comment:

Sure.  I just saying that

@f.register(int, replace=True)

requires opt-in to replacing, whilst

@f.register(int, replace=False) # don't replace if one already exists

is still prone to bugs.

--

___
Python tracker 

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



[issue24595] InteractiveInterpreter always prints to stdout

2015-07-09 Thread R. David Murray

R. David Murray added the comment:

Does it not work to create an unbuffered makefile object from the socket and 
assign that to stdout?  Regardless, if you need to set it and restore it around 
runcode you can use super() to call the base class method.

I think providing an easier API to change stdin/stdout/stderr is a reasonable 
RFE, though.

--
nosy: +r.david.murray
type: behavior -> enhancement
versions: +Python 3.6

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread R. David Murray

R. David Murray added the comment:

Yes it is too late.  You'd have to do a couple of deprecation cycles to change 
the default.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue24583] set.update(): Crash when source set is changed during merging

2015-07-09 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Perhaps the incref/decref pair ought to be moved into 
> PyObject_RichCompareBool().

This wouldn't help because key can be used after PyObject_RichCompareBool().

--

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ah, but I wasn't suggesting to add an argument to the .register() call, but to 
the singledispatch() call; i.e. it would be a function-wide parameter.

--

___
Python tracker 

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



[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread Stefano Mazzucco

New submission from Stefano Mazzucco:

Hello,

at work, I am behind a proxy (squid) that is only available over http. So, I 
have to configure both the http_proxy and https_proxy environment variables to 
be something like "http://proxy.corp.com:8181";

Now, when I try and use urllib to open an "https" url, the proxy returns "501 
Not Implemented".


The quick and dirty script below is a minimal demonstration of the problem that 
appears on both python 2.7 (tested on 2.7.6, 2.7.9, 2.7.10) and 3.4 (tested on 
3.4.0 and 3.4.4)

try:
import urllib
opener = urllib.URLopener()
except AttributeError:
# Python 3
import urllib.request
opener = urllib.request.URLopener()

url = 'https://www.python.org'

print("Trying to open", url)

opener.open(url)


Changing the url to "http://"; works OK.

Thanks,

-- Stefano

--
components: Library (Lib)
messages: 246515
nosy: stefano-m
priority: normal
severity: normal
status: open
title: urllib URLopener().open  https url returns 501 Not Implemented when 
https_proxy env var is http://
type: behavior
versions: Python 2.7, Python 3.4

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Ethan Furman

Ethan Furman added the comment:

Ah, I see.

So you say up-front if you are willing to have redefinition occur later.

That doesn't feel like a consenting-adults attitude, and could also make 
testing harder.

I prefer adding an option to the register method, and move towards making the 
default be "don't allow".

If we don't want to go that route, would having singledispatch issue a warning 
on redefinition be sufficient?

--

___
Python tracker 

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



[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread R. David Murray

R. David Murray added the comment:

It is not clear from your description if you actually tested it with python3.  
In python2, I believe urllib does not support this (see issue 1424152) while 
urllib2 does.

Assuming you have, I wonder if the not implemented error is your squid saying 
it doesn't support CONNECT (which would be a bit surprising, granted).  Have 
you looked at the error text or the squid logs?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Sven R. Kunze

Sven R. Kunze added the comment:

> ... this sounds like it is encouraging staying ignorant.

True. However, I being ignorant about the complexity eventually led to the 
development of high-level languages like Python. Each time, a next generation 
simply asks the question: 'does it really need to be that complicated?' And 
each time, there is a solution. We will get there.

I have to admit, I do not stay ignorant because of convenience APIs but because 
I feel things made overly complicated.


I am not sure if we talk about asyncio anymore. I would say everything in 
Python regarding concurrency/parallelism needs to be put into perspective:

Modules I know MIGHT be interesting for me:
 - concurrent
 - threading
 - asyncio
 - multiprocessing

But I have no idea why/when to use which one.

AND more importantly, statements like "This class is almost compatible with 
concurrent.futures.Future." 
(https://docs.python.org/3/library/asyncio-task.html#asyncio.Future) do not 
help. If it they are that compatible, why do we need both and when do I need 
which one? Or is this just another internal detail of implementation I can 
really be ignorant of?


>From what I can tell right now (I read deeper into the topic, but always 
>correct me if I am wrong), my perspective of the modules are now:


API of your application
   ^
   ^
1) either asynchronous/event loop/asyncio
2) or synchronous/single event = start of program
   ^
   ^
the logic of the application
   ^
   ^
usage of other components
   ^
   ^
1) either 1 thread/imperative/line by line
2) or multithread/concurrent/parallel
3) or multiprocess/concurrent/parallel



My understanding is that asyncio is a way to implement the API of your 
application whereas concurrent/threading/multiprocessing provide means for more 
efficient execution of the underlying logic.


However, that cannot be entirely true, as I have already seen modules using 
asyncio to communication asynchronously with databases (to be honest that is 
what its name suggests async IO).

So, what? Seems like we can use asyncio also for communication with other 
components as well which my intuition held true as well. That is why I have 
trouble to understand why it is considered wrong to do the same with 'normal' 
functions (to me they are just other components).


AND it can also be the other way round: using 
concurrent/threading/multiprocessing for implementing the API of your 
application.

--

___
Python tracker 

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



[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread Stefano Mazzucco

Stefano Mazzucco added the comment:

I have run the minimal example provided on both Python2 and Python3 with the 
same results. Sorry if that was not clear.

I did look at issue 1424152 but it seemed to me that I was experiencing a 
different problem.

When I try and open the page, I get a squid error page with a somewhat vague 
error saying that "the method is not supported" (even though it's a simple GET 
and I can get the same page with other tools like wget or a web browser). 
Unfortunately, I don't have access to the proxied environment right now, and I 
will need to ask for the squid logs anyway since I can't access them.

I have to say that I have experienced this problem while using buildout as 
zc.buildout.download uses urllib.urlretrieve. Surprisingly, it succeeds on 
Python3, but it fails with Python2 which is our supported version (so there's 
currently no way that I can use Python3 at work).

--

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Mark Shannon

Mark Shannon added the comment:

I still think that this is a good idea, but I would like to see a small speed 
test for large objects. Just to be sure that it is no slower.

--

___
Python tracker 

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



[issue24571] [RFE] Add asyncio.background_call API

2015-07-09 Thread Guido van Rossum

Guido van Rossum added the comment:

Please move the philosophical discussion to python-ideas.

Regarding the phrasing about the two Future classes being almost compatible, 
that is unfortunate wording. Two things can have a similar API (merely having 
the same methods etc.) without being compatible (not having the same behavior 
or semantics).

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

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Julian Taylor

Julian Taylor added the comment:

Large objects are just if size > 512: return malloc(size) there is no reason it 
should be slower.
Also for large objects allocation speed does not matter as much.

--

___
Python tracker 

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



[issue21148] avoid needless pointers initialization in small tuple creation

2015-07-09 Thread Julian Taylor

Julian Taylor added the comment:

right at best its probably too insignificant to really be worthwhile, closing.

--
status: open -> closed

___
Python tracker 

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



[issue23530] os and multiprocessing.cpu_count do not respect cpuset/affinity

2015-07-09 Thread Julian Taylor

Julian Taylor added the comment:

any comments on the doc changes?

--

___
Python tracker 

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



[issue24600] function(**dict) does not accept comma after dict (inside parenthese)

2015-07-09 Thread Grégory Starck

New submission from Grégory Starck:

Consider following:

Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
[GCC 4.8.2] on linux

>>> def f(**kw): pass

>>> f(a=1 , )
>>> # ok

>>> f(**{'a': 1} )
>>> # ok

>>> # but :

>>> f(**{'a': 1} , )
SyntaxError: invalid syntax
>>> 

shouldn't the last form be also allowed as is the first one ??

if it is: Could I personnaly handle this fix ? I'd be very proud to bring (even 
such a low impact problem) my own stone to Python :)

Kind regards.

--
messages: 246525
nosy: g.sta...@gmail.com
priority: normal
severity: normal
status: open
title: function(**dict) does not accept comma after dict (inside parenthese)
versions: Python 3.4

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Mark Shannon

Mark Shannon added the comment:

Indeed there is no *obvious* reason why they should be slower. 
But when it comes to optimisation, *never* trust your (or anyone else's) 
intuition.

Running a simple check is always worth the effort.

--

___
Python tracker 

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



[issue24600] function(**dict) does not accept comma after dict (inside parenthese)

2015-07-09 Thread R. David Murray

R. David Murray added the comment:

This is a duplicate of issue 9232, which has a patch.  The question is getting 
agreement to apply it...it sounds like your service in this regard could be 
bringing it up on python-ideas; please read that issue through and see if you 
agree.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Allow trailing comma in any function argument list.

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le 09/07/2015 20:30, Ethan Furman a écrit :
> 
> That doesn't feel like a consenting-adults attitude, and could also
make testing harder.

Testing of what? The point is that it's the authority providing the
generic function which decides how lenient extending the generic
function is. That sounds rather reasonable to me...

> I prefer adding an option to the register method, and move towards
> making the default be "don't allow".

But that default won't happen, for the compatibility reasons already
explained.

--

___
Python tracker 

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



[issue24597] forbid redefinition of specializations in singledispatch

2015-07-09 Thread Eric Snow

Eric Snow added the comment:

I agree with Antoine.

--
nosy: +eric.snow

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> I suppose the simplest "fix" would be to replace relevant instances of
> 
> int(random() * N)
> 
> with
> 
> min(int(random() * N), N-1)

That sounds simple and generic. It skews the distribution a tiny little bit, 
but it doesn't sound significant (perhaps Mark would disagree).

--
nosy: +pitrou

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Tim Peters

Tim Peters added the comment:

> It skews the distribution a tiny little bit, ...

But it doesn't - that's the point ;-)

If double-rounding doesn't occur at all (which appears to be the case on most 
platforms), absolutely nothing changes (because min(int(random() * N), N-1) == 
int(random() * N) on such boxes).

If double-rounding does occur, double-rounding itself may change results "all 
over the place", and I haven't tried to analyze what effects that has on the 
distribution.  In the comparative handful of cases where int(random() * N) == N 
on such boxes, clamping that back to N-1 just yields the same result we would 
have gotten on a box that didn't do double-rounding.

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread STINNER Victor

STINNER Victor added the comment:

Again, why not using only integers?

Pseudo-code to only use integers:

def randint(a, b):
num = b - a
if not num:
return a
nbits = (num + 1).bit_length()
while True:
x = random.getrandbits(nbits)
if x <= num:
break
return a + x

(It doesn't handle negative numbers nor empty ranges.)

--

___
Python tracker 

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



[issue1424152] urllib/urllib2: HTTPS over (Squid) Proxy fails

2015-07-09 Thread Martin Panter

Martin Panter added the comment:

In the meantime, Issue 24599 has been opened about URLopener(), which I 
understand is related to the Python 2 “urllib” half of this bug. Since this 
issue has been closed, perhaps it is best to continue discussion of 
issue1424152-py27-urllib.diff there instead.

--
dependencies: +urllib URLopener().open  https url returns 501 Not Implemented 
when https_proxy env var is http://
nosy: +vadmium

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Tim Peters

Tim Peters added the comment:

Victor, if people want to use getrandbits(), we should backport the Python3 
code, not reinvent it from scratch.

Note too Mark's comment:  "There are several places in the source where 
something of the form `int(i * random.random())` is used".  The `min()` trick 
is relatively easy to apply via simple, local editing of such places.  

Your "It doesn't handle negative numbers nor empty ranges" should be a hint 
about what a pain it is to rewrite everything wholesale to use a 
_fundamentally_ different method.

--

___
Python tracker 

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



[issue24599] urllib URLopener().open https url returns 501 Not Implemented when https_proxy env var is http://

2015-07-09 Thread Martin Panter

Martin Panter added the comment:

David: the original patch made in Issue 1424152 fixed Python 2’s 
urllib.request.urlopen() and Python 2’s urllib2.urlopen(). But Stefano is using 
URLopener, which I understand comes from Python 2’s older “urllib” module.

When I run the demonstration, the request to the proxy looks like this:

GET https://www.python.org HTTP/1.1
Host: www.python.org
Accept-Encoding: identity
Connection: close
User-Agent: Python-urllib/3.4

I think Stefano requires a “CONNECT www.python.org:443” request instead. There 
is apparently a patch which sounds like it does this. See 
issue1424152-py27-urllib.diff and the messages beginning with 
. I suggest any further work 
(e.g. tests and documentation) continue here, since the other issue has been 
closed and mainly discusses “urllib2”.

--
nosy: +vadmium

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread STINNER Victor

STINNER Victor added the comment:

> Victor, if people want to use getrandbits(), we should backport the Python3 
> code, not reinvent it from scratch.

Sorry, I don't understand your comment. Backport what? getrandbits() is 
available on Python 2 and Python 3, for Random and SystemRandom.

I propose to rewrite Random.randint() in random.py.

> Your "It doesn't handle negative numbers nor empty ranges" should be a hint 
> about what a pain it is to rewrite everything wholesale to use a 
> _fundamentally_ different method.

In fact, I didn't check if the my code works for negative numbers. A few more 
lines should be enough to handle them. I just wanted to show a short 
pseudo-code to discuss the idea.

I don't understand your point on the pain. It's easy to replace int(i * 
random.random()) with randint(0, i) (sorry, I'm too lazy to check if it should 
be i, i-1 or i+1 :-)).

The Glib library used floats in their g_rand_int_range() method, but the 
function now uses only integers. The GSL library also uses integers. I'm 
surprised that Python uses floats to generate random numbers. For me, they are 
less reliable than integers, I always fear a bias caused by complex rounding 
and corner cases.

Do other libraries and/or programming languages use float to generate a random 
integer?

--

___
Python tracker 

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



[issue24567] random.choice IndexError due to double-rounding

2015-07-09 Thread Tim Peters

Tim Peters added the comment:

Victor, don't ask me, look at the code:  the random.choice() implementations in 
Python 2 and Python 3 have approximately nothing in common, and "the bug" here 
should already be impossible in Python 3 (but I can't check that, because I 
don't have a platform that does double-rounding).  I already pointed out (in my 
2015-07-05 15:42 note) that Python 3 uses "only integers" in most cases.

"It's easy to replace int(i * random.random()) with randint(0, i)".  You didn't 
say that was your _intent_, and I didn't guess it.  In that case you also have 
to weigh in the considerable extra expense of adding another Python-level 
function call.  The speed of these things is important, and it's annoying 
enough just to add the expense of calling the C-level `min()`.

--

___
Python tracker 

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



[issue24601] bytes and unicode splitlines() methods differ on what is a line break

2015-07-09 Thread Gregory P. Smith

New submission from Gregory P. Smith:

for bytes, \v (0x0b) is not considered a line break.  for unicode, it is.

this traces back to the Objects/stringlib/ code where unicode defers to the 
decision made by Objects/unicodeobject.c's ascii_linebreak table which contains 
7 line breaks in the 0..127 character range:

static unsigned char ascii_linebreak[] = {
0, 0, 0, 0, 0, 0, 0, 0,
/* 0x000A, * LINE FEED */
/* 0x000B, * LINE TABULATION */
/* 0x000C, * FORM FEED */
/* 0x000D, * CARRIAGE RETURN */
0, 0, 1, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
/* 0x001C, * FILE SEPARATOR */
/* 0x001D, * GROUP SEPARATOR */
/* 0x001E, * RECORD SEPARATOR */
0, 0, 0, 0, 1, 1, 1, 0,


Whereas Objects/stringlib/stringdefs.h used by only considers \r and \n.

I think these should be consistent.  But making this change likely breaks 
existing code in weird ways.

This does come up when porting from 2 to 3 as a str '' type with one of those 
other characters in it was not broken by splitlines in 2.x but is broken by 
splitlines in 3.x.

--
messages: 246538
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: bytes and unicode splitlines() methods differ on what is a line break

___
Python tracker 

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



[issue24601] bytes and unicode splitlines() methods differ on what is a line break

2015-07-09 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Fri, Jul 10, 2015 at 02:18:33AM +, Gregory P. Smith wrote:

> for bytes, \v (0x0b) is not considered a line break.  for unicode, it is.
[...]
> I think these should be consistent.

I'm not sure that they should. Unicode includes other line breaks which 
bytes should not consider line breaks, such as NEL (Next Line), U+0085. 
Why should bytes be consistent with only the subset of line breaks that 
are in ASCII?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread JohnLeitch

New submission from JohnLeitch:

The Python 2.7 regular expression module suffers from an integer underflow in 
the SRE_SEARCH function of _sre.c, which leads to a buffer over-read condition. 
The issue is caused by unchecked subtraction performed while handling 
SR_OP_INFO blocks:

if (pattern[0] == SRE_OP_INFO) {
/* optimization info block */
/*  <1=skip> <2=flags> <3=min> <4=max> <5=prefix info>  */

flags = pattern[2];

if (pattern[3] > 1) {
/* adjust end point (but make sure we leave at least one
   character in there, so literal search will work) */
end -= pattern[3]-1;  Pattern[3] is a potentially untrusted 
value
  controllable via regex.
if (end <= ptr)  A check is performed end is less than or equal 
to
 ptr (which is still start at this point), but 
no
 check is performed to determine if end has been
 underflowed to a value greater than ptr.
end = ptr+1;
}

[...]
}

A script that demonstrates control of Pattern[3] is as follows:

import re
re.search(r"\b((A){304665458})",u"A")

When the script is executed, the min quantifier value ends up in pattern[3] of 
an SRE_OP_INFO block. The value underflows end, resulting in a large number 
that satisfies the existing validation. In cases where the regular expression 
is exposed as attack surface, it may be possible to exploit this vulnerability 
to scan and read arbitrary memory. This could then potentially be used to 
disclose secrets and/or bypass mitigations such as ASLR/DEP.

An exception produced by this condition is as follows:

0:000> !analyze -v -nodb
***
* *
*Exception Analysis   *
* *
***


FAULTING_IP: 
python27!sre_uat+b7 [c:\build27\cpython\modules\_sre.c @ 369]
1e010dd7 0fb746femovzx   eax,word ptr [esi-2]

EXCEPTION_RECORD:   -- (.exr 0x)
ExceptionAddress: 1e010dd7 (python27!sre_uat+0x00b7)
   ExceptionCode: c005 (Access violation)
  ExceptionFlags: 
NumberParameters: 2
   Parameter[0]: 
   Parameter[1]: 01e0f000
Attempt to read from address 01e0f000

CONTEXT:   -- (.cxr 0x0;r)
eax=01d38518 ebx=0027f8b0 ecx=0027f8b0 edx=01d23eb4 esi=01e0f002 edi=01d3851a
eip=1e010dd7 esp=0027f82c ebp=01f2b010 iopl=0 nv up ei pl nz ac po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010212
python27!sre_uat+0xb7:
1e010dd7 0fb746femovzx   eax,word ptr [esi-2] ds:002b:01e0f000=

FAULTING_THREAD:  0518

DEFAULT_BUCKET_ID:  INVALID_POINTER_READ

PROCESS_NAME:  python.exe

ERROR_CODE: (NTSTATUS) 0xc005 - The instruction at 0x%08lx referenced 
memory at 0x%08lx. The memory could not be %s.

EXCEPTION_CODE: (NTSTATUS) 0xc005 - The instruction at 0x%08lx referenced 
memory at 0x%08lx. The memory could not be %s.

EXCEPTION_PARAMETER1:  

EXCEPTION_PARAMETER2:  01e0f000

READ_ADDRESS:  01e0f000 

FOLLOWUP_IP: 
python27!sre_uat+b7 [c:\build27\cpython\modules\_sre.c @ 369]
1e010dd7 0fb746femovzx   eax,word ptr [esi-2]

NTGLOBALFLAG:  70

APPLICATION_VERIFIER_FLAGS:  0

APP:  python.exe

ANALYSIS_VERSION: 6.3.9600.17029 (debuggers(dbg).140219-1702) x86fre

PRIMARY_PROBLEM_CLASS:  INVALID_POINTER_READ

BUGCHECK_STR:  APPLICATION_FAULT_INVALID_POINTER_READ

LAST_CONTROL_TRANSFER:  from 1e0115e8 to 1e010dd7

STACK_TEXT:  
0027f834 1e0115e8 01d23eb4 0027f8b0 01e0f004 python27!sre_uat+0xb7
0027f85c 1e012882 01d23e78 01ddb9f0  python27!sre_umatch+0x178
0027f888 1e014995 01d23eb4 1e0148b0 01f3ea08 python27!sre_usearch+0x212
0027fc08 1e0aafeb 01d23e78 01ddb9f0  python27!pattern_search+0xe5
0027fc24 1e0edd10 01f3ea08 01ddb9f0  python27!PyCFunction_Call+0x5b
0027fc50 1e0f017a 0027fca8 01d9df98 0001 python27!call_function+0x2b0
0027fcc0 1e0f1150 01f49198  01dce030 python27!PyEval_EvalFrameEx+0x239a
0027fcf4 1e0ec862 01d9df98 01f49198  python27!PyEval_EvalCodeEx+0x690
0027fd30 1e0edd87 0027fdb4 0002  python27!fast_function+0xe2
0027fd5c 1e0f017a 0027fdb4 01d46b18 01d46b18 python27!call_function+0x327
0027fdcc 1e0f1150 01d74030  01d46b18 python27!PyEval_EvalFrameEx+0x239a
0027fe00 1e0f11b2 01d46b18 01d74030 01d4aa50 python27!PyEval_EvalCodeEx+0x690
0027fe2c 1e11707a 01d46b18 01d4aa50 01d4aa50 python27!PyEval_EvalCode+0x22
0027fe44 1e1181c5 01e0a3b0 01d4aa50 01d4aa50 python27!run_mod+0x2a
0027fe64 1e118760 68e87408 01f02e63 0101 python27!PyRun_FileExFlags+0x75
0027f

[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread JohnLeitch

JohnLeitch added the comment:

Attaching proposed patch for unit tests to cover this issue.

--
Added file: http://bugs.python.org/file39888/test_re.py.patch

___
Python tracker 

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



[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread JohnLeitch

JohnLeitch added the comment:

Attaching repro.

--
Added file: http://bugs.python.org/file39889/SRE_SEARCH_Integer_Underflow.py

___
Python tracker 

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



[issue24602] SRE_SEARCH Integer Underflow

2015-07-09 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +pitrou, serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue24583] set.update(): Crash when source set is changed during merging

2015-07-09 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file39890/intermediary.diff

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread Joshua Harlow

Joshua Harlow added the comment:

Out of curiosity what reference cycles can't be broken in various python 
versions? Is it documented/explained anywhere?

--
nosy: +Joshua.Harlow

___
Python tracker 

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



[issue23601] use small object allocator for dict key storage

2015-07-09 Thread Stefan Behnel

Stefan Behnel added the comment:

It's generally worth running the benchmark suite for this kind of optimisation. 
Being mostly Python code, it should benefit quite clearly from dictionary 
improvements, but it should also give an idea of how much of an improvement 
actual Python code (and not just micro-benchmarks) can show. And it can help 
detecting unexpected regressions that would not necessarily be revealed by 
micro-benchmarks.

https://hg.python.org/benchmarks/

And I'm with Mark: when it comes to performance optimisations, repeating even a 
firm intuition doesn't save us from validating that this intuition actually 
matches reality. Anything that seems obvious at first sight may still be proven 
wrong by benchmarks, and has often enough been so in the past.

--
nosy: +scoder

___
Python tracker 

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



[issue24598] asyncio: add background task detecting reference cycles

2015-07-09 Thread STINNER Victor

STINNER Victor added the comment:

Python 3.4 is able to break reference cycles even if an object part of the
cycle has a destructor. See the PEP 442.

--

___
Python tracker 

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