[issue23509] Speed up Counter operators

2015-02-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue9985] difflib.SequenceMatcher has slightly buggy and undocumented caching behavior

2015-02-26 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue23507] Tuple creation is too slow

2015-02-26 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I had done something like this for zip() long ago and had gotten a nice speed 
boost.  I remember looking at whether it should be applied elsewhere but don't 
remember why I decided against it.

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue23509] Speed up Counter operators

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Applied optimizations:

1) Used cached get() method instead of indexing. This optimization already was 
used in update() and subtract().
2) _keep_positive() is optimized for the case when most counts are not positive 
(common case for substraction and intersection).
3) __add__ and __or__ are defined via inplace operations which are faster (due 
to fast copying and _keep_positive()).
4) Inlined and simplified the code for __pos__ and __neg__.

May be following optimization can be made by implementing _keep_positive() in C.

--

___
Python tracker 

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



[issue23507] Tuple creation is too slow

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note the check for Py_REFCNT() == 1. Whithout it the code would be incorrect.

--

___
Python tracker 

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



[issue23526] Silence resource warnings in test_httplib

2015-02-26 Thread Martin Panter

Martin Panter added the comment:

+1 from me. These three fixes are practically the same as the ones I snuck into 
my patch for a Issue 23377.

--
nosy: +vadmium

___
Python tracker 

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



[issue23527] test_smtpnet uses incorrect port for STARTTLS

2015-02-26 Thread Alex Shkop

New submission from Alex Shkop:

test_smtpnet uses port 25 for STARTTLS, whereas gmail exposes STARTTLS SMTP 
over port 587.

--
components: Tests
files: test_smtpnet_starttls_port.patch
keywords: patch
messages: 236658
nosy: ashkop
priority: normal
severity: normal
status: open
title: test_smtpnet uses incorrect port for STARTTLS
versions: Python 3.5
Added file: http://bugs.python.org/file38242/test_smtpnet_starttls_port.patch

___
Python tracker 

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



[issue23528] Limit decompressed data when reading from GzipFile

2015-02-26 Thread Martin Panter

New submission from Martin Panter:

This is a patch I originally posted at Issue 15955, but am moving it to a 
separate issue so there is less confusion. GzipFile.read() etc is 
susceptible to decompression bombing. My patch tests and fixes that, making use 
of the existing “max_length” parameter in the “zlib” module.

The rest of Issue 15955 is about enhancing the bzip and LZMA modules to support 
limited decompression, but since the zlib module can already limit the 
decompressed data, I think this gzip patch should be considered as a bug fix 
rather than enhancement, e.g. the fix for Issue 16043 (gzip decoding for XML 
RPC module) assumed GzipFile.read() is limited.

--
components: Library (Lib)
files: gzip-bomb.patch
keywords: patch
messages: 236659
nosy: nikratio, vadmium
priority: normal
severity: normal
status: open
title: Limit decompressed data when reading from GzipFile
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file38243/gzip-bomb.patch

___
Python tracker 

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



[issue23528] Limit decompressed data when reading from GzipFile

2015-02-26 Thread Martin Panter

Changes by Martin Panter :


--
type: behavior -> resource usage

___
Python tracker 

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



[issue23519] using asyncio.iscoroutinefunction() on a functools.partial object

2015-02-26 Thread STINNER Victor

STINNER Victor added the comment:

> Plus there is no use case.

Mathieu: can you maybe give some examples? How are you using functools.partial 
with coroutines?

--

___
Python tracker 

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



[issue23507] Tuple creation is too slow

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Fixed bugs found by Victor. Thank you Victor.

Yes, zip() already uses similar approach.

--
Added file: http://bugs.python.org/file38244/reuse_argtuples_2.patch

___
Python tracker 

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



[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-02-26 Thread Martin Panter

New submission from Martin Panter:

This is a follow-on from Issue 15955, which has added low-level support for 
limiting the amount of data from the LZMA and bzip decompressors. The 
high-level LZMAFile and BZ2File reader APIs need to make use of the new low 
level max_length parameter.

I am starting off with a patch for LZMAFile, based on a patch I posted to Issue 
15955. I split out a _RawReader class that does the actual decompress() calls, 
and then wrapped that in a BufferedReader. The LZMAFile then just delegates the 
read methods to the BufferedReader. This avoids needing any special code to 
implement buffering, readline(), etc. This involved some changes in the API 
though:

* LZMAFile now uses BufferedReader.peek(). The current implementation seems 
appropriate, but I am not comfortable with the current specification in the 
documentation, which says it is allowed to not return any useful data. See 
Issue 5811.
* read() now accepts size=None, because BufferedReader does. I had to change a 
test case for this.
* BufferedReader.seek() raises a different exception for invalid “whence”

Once the LZMAFile patch sees a bit of review and looks like it might be 
acceptable, I plan to change the BZ2File class in a similar manner.

--
components: Library (Lib)
files: LZMAFile.v2.patch
keywords: patch
messages: 236663
nosy: nikratio, vadmium
priority: normal
severity: normal
status: open
title: Limit decompressed data when reading from LZMAFile and BZ2File
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file38245/LZMAFile.v2.patch

___
Python tracker 

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



[issue20703] RuntimeError caused by lazy imports in pdb

2015-02-26 Thread Xavier de Gaye

Xavier de Gaye added the comment:

> I can reproduce this on Windows 8.1 with 3.4.3 but cannot do so with 3.5.0a1.

I can still reproduce this on linux on today's tip:
'3.5.0a1+ (default:7185a35fb293, Feb 26 2015, 11:27:11) \n[GCC 4.9.2 20150204 
(prerelease)]'.

Maybe you tried reproducing it with the interactive interpreter. When this code
is run from the interactive interpreter and not as a script as suggested in the
initial post, then readline is already imported by the interpreter at startup
and the RuntimeError is not raised.

Also interestingly, the bdb module takes lot of steps to ensure that linecache
and reprlib are lazyly imported, but pdb and bdb cannot do anything interesting
without these modules.

--

___
Python tracker 

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



[issue23528] Limit decompressed data when reading from GzipFile

2015-02-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-02-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2015-02-26 Thread Martin Panter

Martin Panter added the comment:

Yes I think that is a good idea:

* Moved gzip-bomb.patch to Issue 23528
* Opened Issue 23529 with a new version of the LZMAFile patch, and plan to post 
a BZ2File patch there as well when it is ready

--

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2015-02-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10dab1b596d4 by Antoine Pitrou in branch 'default':
Issue #15955: Add an option to limit the output size in bz2.decompress().
https://hg.python.org/cpython/rev/10dab1b596d4

--

___
Python tracker 

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



[issue15955] bz2, lzma: add option to limit output size

2015-02-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thank you, Nikolaus, and thank you Martin for the reviews.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: gzip, bz2, lzma: add option to limit output size -> bz2, lzma: add 
option to limit output size

___
Python tracker 

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



[issue23528] Limit decompressed data when reading from GzipFile

2015-02-26 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage:  -> patch review
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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-26 Thread Cyd Haselton

Cyd Haselton added the comment:

Thanks Ryan.
Should I create a branch off the master at github and patch there or just clone 
the master and patch?

--

___
Python tracker 

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



[issue1539925] warnings in interactive sessions

2015-02-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue23519] using asyncio.iscoroutinefunction() on a functools.partial object

2015-02-26 Thread Mathieu Pasquet

Mathieu Pasquet added the comment:

Using functools.partial with coroutines would be mostly out of convenience, in 
order to avoid having factories in that return parametrized coroutine 
functions. I guess in such cases it might be better to create a two-lines 
wrapper around partial() to make it return a coroutine rather than change the 
stdlib for that.

In the attached file is an example of such use, where EventNotifier is a 
Protocol which receives external events and triggers event handlers based on 
that, and where the add_event_handler function checks if the handler is a 
coroutine function. In which case it uses asyncio.async to schedule the handler 
call; otherwise it uses loop.call_soon.

You can close this, I guess.

--
Added file: http://bugs.python.org/file38246/example_partial.py

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Daniel Holth

Daniel Holth added the comment:

Create and open executable file respecting the Unix user's umask:

os.fdopen(os.open(filename, os.O_CREAT|os.O_RDWR), "rw")

On Tue, Feb 24, 2015, at 02:34 PM, Paul Moore wrote:
> 
> Paul Moore added the comment:
> 
> Thanks, I'll fix for the next iteration of the patch.
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

I don't follow (and I don't really want to do things this low level without a 
compelling reason...)

--

___
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-02-26 Thread Julian Taylor

New submission from Julian Taylor:

multiprocessing.cpu_count and os.cpu_count which are often used to determine 
how many processes one can run in parallel do not respect the cpuset which may 
limit the process to only a subset of online cpus leading to heavy 
oversubscription in e.g. containerized environments:

$ taskset -c 0 python3.4 -c 'import multiprocessing; 
print(multiprocessing.cpu_count())'
32
$ taskset -c 0 python3.4 -c 'import os; print(os.cpu_count())'
32

While the correct result here should be 1.

This requires programs to have to use less portable methods like forking to gnu 
nproc or having to read the /proc filesystem.

Having a keyword argument to switch between online and available cpus would be 
fine too.

--
components: Library (Lib)
messages: 236671
nosy: jtaylor
priority: normal
severity: normal
status: open
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



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

2015-02-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +neologix

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

Following on from that, the code to make an archive executable is currently

os.chmod(new_archive, os.stat(new_archive).st_mode | stat.S_IEXEC)

Should I use "... | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH"? If so, do I 
need to protect that with an "if not Windows" test? (I've tested the existing 
code and it does nothing on Windows, so I omitted the test at the moment). Is 
there any *other* way I should be making a file executable on Unix?

(Side note: Maybe there should be an os.make_executable(pathname) or similar 
that does the right thing in a cross-platform way?)

--

___
Python tracker 

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



[issue20703] RuntimeError caused by lazy imports in pdb

2015-02-26 Thread Mark Lawrence

Mark Lawrence added the comment:

My tests were done with a script from the command line, not an interactive 
prompt.

--

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Jim Jewett

Jim Jewett added the comment:

I think that instead of application/zip, you want application/zipped-python (or 
whatever the precise term was).  This was one reason to register the MIME type. 
 That said, application/zip is probably not harmful; the worst it should do it 
hand the archive to a zip program.

What is pxzw for, other than amusing mispronunciations?

--
nosy: +Jim.Jewett

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Steve Dower

Steve Dower added the comment:

The .px* extensions are for testing builds without messing up your actual file 
associations. I ported them forward from the old installer, but most people 
will never see them.

--

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

If I understand Steve's comments, the mime type is used by Windows, so 
application/zip lets Windows know that this filetype is fundamentally a zip 
file (and so it'll offer to open it with your zip program if you right click, 
stuff like that).

pxzw - the "w" on the end marks it as a GUI script, to be run by pythonw.exe. 
The x is a "test mode" thing for development builds of Python. You wouldn't see 
it in a production build (the production filetypes are pyz and pyzw).

--

___
Python tracker 

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



[issue20703] RuntimeError caused by lazy imports in pdb

2015-02-26 Thread Eric Snow

Eric Snow added the comment:

I haven't looked to closely but I'm guessing that pdb.set_trace() causes 
something to get imported (i.e. there's an import statement in a function body 
somewhere).  Consequently sys.modules is updated (by that "distant" import 
statement) while you are iterating over it here.

In that case the behavior you are seeing is correct, even if not obvious or 
even desirable.  It will happen any time you are looping over sys.modules and 
call a function/method which has a function-scoped import statement for a 
module that hasn't been imported yet (or calls another function that does so, 
etc.).

--
nosy: +eric.snow

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Steve Dower

Steve Dower added the comment:

There's also a PerceivedType property which we could set to make sure that 
archivers correctly light up. I think that'll get you the built-in Extract 
command. Most tools appear on every file and will try and read it to see what 
commands make sense, which will work fine for a zip file.

--

___
Python tracker 

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



[issue23526] Silence resource warnings in test_httplib

2015-02-26 Thread Demian Brecht

Changes by Demian Brecht :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue23526] Silence resource warnings in test_httplib

2015-02-26 Thread Demian Brecht

Demian Brecht added the comment:

LGTM

--
nosy: +demian.brecht
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Daniel Holth

Daniel Holth added the comment:

On Thu, Feb 26, 2015, at 09:41 AM, Paul Moore wrote:
> 
> Paul Moore added the comment:
> 
> Following on from that, the code to make an archive executable is
> currently
> 
> os.chmod(new_archive, os.stat(new_archive).st_mode | stat.S_IEXEC)
> 
> Should I use "... | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH"? If so,
> do I need to protect that with an "if not Windows" test? (I've tested the
> existing code and it does nothing on Windows, so I omitted the test at
> the moment). Is there any *other* way I should be making a file
> executable on Unix?
> 
> (Side note: Maybe there should be an os.make_executable(pathname) or
> similar that does the right thing in a cross-platform way?)

The chmod + umask analog that will work not just on a newly created file
is

umask = os.umask(0) # must change umask to get umask

os.umask(umask) # restore previous umask

os.chmod(new_archive, os.stat(new_archive).st_mode |
((stat.stat.S_IXUSR|stat.S_IXGRP|stat.S_IXOTH) & ~umask))

If I understand the man page correctly, "chmod +x filename" does exactly
the above. Depending on the umask the command may or may not create a
world / group / user executable file.

--

___
Python tracker 

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



[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I addressed review comments and fixed the case of negative divisor.  There  may 
be a better solution than calling the function recursively, but I wanted an 
easy to understand code.

--
Added file: http://bugs.python.org/file38247/issue23521-5.patch

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

OK, thanks. I don't propose to go there with the initial implementation. If 
it's a problem in practice, someone can raise a bug and we'll fix it then. 
(I've never seen actual Python code in the wild that does all of that...)

--

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-26 Thread Cyd Haselton

Cyd Haselton added the comment:

...or, should I fork the 3.4 branch?  If so, which one...3.4 or origin/3.4?

--

___
Python tracker 

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



[issue23526] Silence resource warnings in test_httplib

2015-02-26 Thread STINNER Victor

STINNER Victor added the comment:

I was going to commit the fix, but currently the 3.4 is not merged into 
default. I will wait until 3.4 is merged into default to apply the fix.

I attach my pending commit.

(Python 3.4 is also afffected.)

--
nosy: +haypo
versions: +Python 3.4
Added file: http://bugs.python.org/file38248/httplib.patch

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-26 Thread STINNER Victor

STINNER Victor added the comment:

I don't think that Android support should be added to a stable branche
(2.7 or 3.4), only in the development branch.

You may maintain your own 2.7 or 3.4 fork if you want.

--

___
Python tracker 

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



[issue14721] httplib doesn't specify content-length header for POST requests without data

2015-02-26 Thread Demian Brecht

Demian Brecht added the comment:

> I'm happy to produce a patch if there's any chance it would be merged.

If the patch adheres to the RFC, then I see no reason why it shouldn't be 
merged. What makes this a little more tricky than the snippet that you included 
in your post though (which would include the Content-Length header for all HTTP 
methods) is the following from RFC 7230:

   A user agent SHOULD send a Content-Length in a request message when
   no Transfer-Encoding is sent and the request method defines a meaning
   for an enclosed payload body.  For example, a Content-Length header
   field is normally sent in a POST request even when the value is 0
   (indicating an empty payload body).  A user agent SHOULD NOT send a
   Content-Length header field when the request message does not contain
   a payload body and the method semantics do not anticipate such a
   body.

Currently, there is nothing in the http package that defines whether or not a 
given HTTP method expects a body (as far as I'm aware at any rate), although 
this would be a simple addition. I'd imagine that the result might look like 
this:

_METHODS_EXPECTING_BODIES = {'OPTIONS', 'POST', 'PUT', 'PATCH'}

if method.upper() in _METHODS_EXPECTING_BODIES and \
'content-length' not in header_names:
self._set_content_length(body)

I'd prefer to have the conversion from None to empty string done in the body of 
_set_content_length in order to ensure consistency should the call be made from 
elsewhere.

--
nosy: +demian.brecht
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



[issue14855] IPv6 support for logging.handlers

2015-02-26 Thread Thomas Bartelmess

Thomas Bartelmess added the comment:

The datagram handler seems still not useable with IPv6 in Python 3.4. Is this 
patch still under consideration ?

--
nosy: +Thomas Bartelmess

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Changes by Paul Moore :


Removed file: http://bugs.python.org/file38249/pep-441.patch

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

Sorry - typo. Try again...

--
Added file: http://bugs.python.org/file38250/pep-441.patch

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

OK, here is an updated patch based on the python-dev discussions

--
Added file: http://bugs.python.org/file38249/pep-441.patch

___
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-02-26 Thread Davin Potts

Davin Potts added the comment:

Detecting the number of processors available to a process is a distinct concept 
from reporting the number of processors present on a system.  cpu_count is 
currently focused on the latter.

Functionality to report the number of effectively-available processors is 
indeed valuable information to have in certain situations but it is also 
something very OS-dependent (I mean the support for it is not present in all 
OSes, let alone the complication of how to access such information differing 
across OSes).

I think a strong case can be made that cpu_count's current functionality should 
not change -- the information it provides is very important to have access to.

Cool tools like psutil (https://pypi.python.org/pypi/psutil) help cover a great 
range of genuine needs when making use of processor affinity.

--
nosy: +davin

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue23507] Tuple creation is too slow

2015-02-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

How many functions can benefit from this approach, though?

--

___
Python tracker 

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



[issue23507] Tuple creation is too slow

2015-02-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Maybe we want a facility to create on-stack static-size tuples?

--
nosy: +pitrou

___
Python tracker 

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



[issue23519] using asyncio.iscoroutinefunction() on a functools.partial object

2015-02-26 Thread Guido van Rossum

Guido van Rossum added the comment:

Yeah, your "add event handler" routine shouldn't be so picky to insist that 
iscoroutinefunction() returns True. It should just call the thing and verify 
that it has returned a coroutine object (asyncio.iscoroutine()).

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Did you noticed my comments to previous patch Paul?

--

___
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-02-26 Thread Julian Taylor

Julian Taylor added the comment:

I do agree that its probably safer to not change the default return value.
But adding a option (or new function) would still be good, the number of 
available cpus is more often the number you actually want in practice.
To the very least the documentation should be improved to clearly state that 
this number does not guarantee that this amount of cpus are actually available 
to run on and you should use psutils instead.

Code for getting this information for the major operating systems linux, bsd 
and windows is available in gnu coreutils.
I can possibly work on a patch if it would get accepted but I can only actually 
test it linux.

--

___
Python tracker 

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



[issue23529] Limit decompressed data when reading from LZMAFile and BZ2File

2015-02-26 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue23528] Limit decompressed data when reading from GzipFile

2015-02-26 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +pitrou

___
Python tracker 

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



[issue23507] Tuple creation is too slow

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Maybe we want a facility to create on-stack static-size tuples?

There is no guarantee that called function doesn't save the reference to args.

> How many functions can benefit from this approach, though?

>From hand-writing caching? Any function, that repeatedly call other functions 
>many times. In additional to sorted()/list.sort() with the key argument, 
>filter() and map(), these are min() and max() with the key argument, some 
>iterators from itertools (groupby(), dropwhile(), takewhile(), accumulate(), 
>filterfalse()). May be some functions that are thin wrappers around special 
>method (e.g. round()).

But it is more interesting to investigate why PyTuple_New() is so slow in 
comparison with hand-written caching. It it can be speeded up, then mauch more 
code can benefit from this.

--

___
Python tracker 

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



[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-26 Thread Brian Kearns

Brian Kearns added the comment:

You saw the demo python implementation of divmod_near in Objects/longobject.c? 
Maybe it's worth using a common implementation?

--

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

Serhiy - I just got a notification from the review tool - I'd not used it 
before and didn't know to check it. But I've read them now and corrected a 
number of places based on your comments and added a few replies to the review. 
Thanks for the review.

--

___
Python tracker 

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



[issue13617] Reject embedded null characters in wchar* strings

2015-02-26 Thread Ben Hoyt

Ben Hoyt added the comment:

Note that this (or a very similar issue) also affects os.listdir() on Windows: 
os.listdir(bytes_path_with_nul) raises ValueError as expected, but 
os.listdir(unicode_path_with_nul) does not. Test case:

>>> import os
>>> os.mkdir('foo')
>>> os.listdir(b'foo\x00zzz')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: listdir: embedded null character in path
>>> os.listdir('foo\x00zzz')
[]

However, this is not the case on Linux, as there both calls raise an 
appropriate ValueError.

This needs to be fixed in posixmodule.c's path_converter() function.

I'm in the middle of implementing PEP 471 (os.scandir), so don't want to create 
a proper patch right now, but the fix is to add these lines in posixmodule.c 
path_converter() after the if (length > 32767) {...} block:

if ((size_t)length != wcslen(wide)) {
FORMAT_EXCEPTION(PyExc_ValueError, "embedded null character in %s");
Py_DECREF(unicode);
return 0;
}

We should also add test to test_os.py like the following:

def test_listdir_nul_in_path(self):
self.assertRaises(ValueError, os.listdir, 'y\x00z')
self.assertRaises(ValueError, os.listdir, b'y\x00z')

--
nosy: +benhoyt

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Emails from Rietveld often can be found in the spam folder.

--

___
Python tracker 

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



[issue23531] SSL operations cause entire process to hang

2015-02-26 Thread johnkw

New submission from johnkw:

SSL operations cause entire process to hang.  At a minimum this includes the 
SSL read that goes on after a socket is connected.  It may apply to many other 
(or all) SSL socket operations.

--
components: Library (Lib)
files: sslbug.py
messages: 236701
nosy: johnkw
priority: normal
severity: normal
status: open
title: SSL operations cause entire process to hang
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file38251/sslbug.py

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-02-26 Thread Neil Girdhar

Neil Girdhar added the comment:

New changelist for updated patch (before merging changes).

--
Added file: http://bugs.python.org/file38252/starunpack33.diff

___
Python tracker 

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



[issue2292] Missing *-unpacking generalizations

2015-02-26 Thread Neil Girdhar

Neil Girdhar added the comment:

Finished merge.

--
Added file: http://bugs.python.org/file38253/starunpack34.diff

___
Python tracker 

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



[issue23531] SSL operations cause entire process to hang

2015-02-26 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +alex, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Paul, don't click on Reply below the comment on the main page, it never works. 
Instead click the link above the comment, then click on the comment to unfold 
it, click on the Reply below the comment, enter your reply, press Send, and 
after replying all comments click "Publish+Mail Comments" and then press 
"Pubblish All My Drafts".

Your replies by email are not archived and are received only by these who 
already is added comments on Rietveld or added to the nosy list on Roundup.

--

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

As for zipimport, it doesn't support namespace packages when no 'directory' 
entry exists (issue14905). The zipfile module CLI now adds entries for 
directories (issue22219).

--

___
Python tracker 

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



[issue1539925] warnings in interactive sessions

2015-02-26 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



[issue23528] Limit decompressed data when reading from GzipFile

2015-02-26 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Especially now that this is only going to go into 3.5, I think it makes more 
sense to handle GzipFile, LZMAFile and BZ2File all in one go. Looking at the 
code, otherwise there's going to be a lot of duplication.

How about introducing a base class 'CompressedFile' that defines most of the 
logic that's currently in LZMAFile (including the max_size patch from issue 
23529), and having {LZMA,BZ2,Gzip}File all inherit from that base?

BZ2File and LZMAFile would probably only need to define their own constructor 
to instantiate the proper compressor/decompressor object.

GzipFile would need to additionally overwrite read() and write() in order to 
handle the CRC and gzip header. But I think both methods could still be written 
to call super().read/write().

Did I miss something?

--

___
Python tracker 

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



[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

Serihy, thanks for the explanation. I was aware that my replies weren't getting 
archived, good to know how to avoid that in future.

I've worked out what you mean over the directory entries now. It was easy 
enough to fix - I just removed the is_file check before writing entries to the 
zipfile. Test added so it's checked in future as well.

--

___
Python tracker 

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



[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments

2015-02-26 Thread Paul Moore

Paul Moore added the comment:

The PEP has now been accepted, and as far as I am aware this patch is complete. 
If anyone has any review comments, please speak up, otherwise I believe this is 
ready to be committed, if some kind soul is willing :-)

--

___
Python tracker 

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



[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments

2015-02-26 Thread Steve Dower

Steve Dower added the comment:

I'll get it.

--

___
Python tracker 

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



[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments

2015-02-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2eb99070a38f by Steve Dower in branch 'default':
Issue #23465: Implement PEP 486 - Make the Python Launcher aware of virtual 
environments (patch by Paul Moore)
https://hg.python.org/cpython/rev/2eb99070a38f

--
nosy: +python-dev

___
Python tracker 

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



[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments

2015-02-26 Thread Steve Dower

Steve Dower added the comment:

It's in, and we are of course free to modify this further if virtualenv starts 
including pyvenv.cfg files or some other way to resolve the version number 
without launching it.

--

___
Python tracker 

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



[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> You saw the demo python implementation of divmod_near in Objects/longobject.c?

I was looking for it, but could not find.  Thanks for the pointer.  (See also 
#8817.)

In issue23521-6.patch, I've used a slightly optimized variant of divmod_near 
code and beefed up the tests some more because the code
is somewhat non-obvious.

--
Added file: http://bugs.python.org/file38254/issue23521-6.patch

___
Python tracker 

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



[issue21800] Implement RFC 6855 (IMAP Support for UTF-8) in imaplib.

2015-02-26 Thread Mark Lawrence

Mark Lawrence added the comment:

The patch contains changes to code and tests have been added so can we have a 
formal review please.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue23532] regex "|" behavior differs from documentation

2015-02-26 Thread Rick Otten

Changes by Rick Otten :


--
components: Regular Expressions
nosy: Rick Otten, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: regex "|" behavior differs from documentation
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue21865] Improve invalid category exception for warnings.filterwarnings

2015-02-26 Thread Mark Lawrence

Mark Lawrence added the comment:

Just a gentle reminder if this and #16845 are to get into 3.5.

--
nosy: +BreamoreBoy

___
Python tracker 

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



[issue23532] regex "|" behavior differs from documentation

2015-02-26 Thread Rick Otten

New submission from Rick Otten:

The documentation states that "|" parsing goes from left to right.  This 
doesn't seem to be true when spaces are involved.  (or \s).

Example:

In [40]: mystring
Out[40]: 'rwo incorporated'

In [41]: re.sub('incorporated| inc|llc|corporation|corp| co', '', mystring)
Out[41]: 'rwoorporated'

In this case " inc" was processed before incorporated.
If I take the space out:

In [42]: re.sub('incorporated|inc|llc|corporation|corp| co', '', mystring)
Out[42]: 'rwo '

incorporated is processed first.

If I put a space with each, then " incorporated" is processed first:

In [43]: re.sub(' incorporated| inc|llc|corporation|corp| co', '', mystring)
Out[43]: 'rwo'

And If use \s instead of a space, it is processed first:

In [44]: re.sub('incorporated|\sinc|llc|corporation|corp| co', '', mystring)
Out[44]: 'rwoorporated'

--

___
Python tracker 

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



[issue23532] regex "|" behavior differs from documentation

2015-02-26 Thread Mark Shannon

Mark Shannon added the comment:

This looks like the expected behaviour to me.
re.sub matches the leftmost occurence and the regular expression is greedy so 
(x|xy) will always match xy if it can.

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue23521] OverflowError from timedelta * float in datetime.py

2015-02-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

We can further optimize _divide_and_round by changing r*=2 to r<<=1 and q % 2 
== 1 to (q & 1), but this will obfuscate the algorithm and limit arguments to 
ints.  (As written, _divide_and_round will work with any numeric types.)

--

___
Python tracker 

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



[issue23532] regex "|" behavior differs from documentation

2015-02-26 Thread Matthew Barnett

Matthew Barnett added the comment:

@Mark is correct, it's not a bug.

In the first example:

It tries to match each alternative at position 0. Failure.
It tries to match each alternative at position 1. Failure.
It tries to match each alternative at position 2. Failure.
It tries to match each alternative at position 3. Success. ' inc' matches.

In the second example:

It tries to match each alternative at position 0. Failure.
It tries to match each alternative at position 1. Failure.
It tries to match each alternative at position 2. Failure.
It tries to match each alternative at position 3. Failure.
It tries to match each alternative at position 4. Success. 'incorporated' 
matches. ('inc' is a later alternative; it's considered only if the earlier 
alternatives have failed to match at that position.)

--

___
Python tracker 

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



[issue23531] SSL operations cause entire process to hang

2015-02-26 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Can you post a standalone example that doesn't use requests and that doesn't 
rely on a local HTTP server?

--

___
Python tracker 

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



[issue23532] regex "|" behavior differs from documentation

2015-02-26 Thread Rick Otten

Rick Otten added the comment:

Can the documentation be updated to make this more clear?

I see now where the clause "As the target string is scanned, ..." is describing 
what you have listed here.

I and a coworker both read the description several times and missed that.  I 
thought it first tried "incorporated" against the whole string, then tried " 
inc" against the whole string, etc...  When actually it was trying each, 
"incorporated" and " inc" and the others against the first position of the 
string.  And then again for the second position.

Since I want to force the order against the whole string before trying the next 
one for my particular use case, I'll do a series of re.subs instead of trying 
to do them all in one.  It makes sense now and is easy to fix.

Thanks for looking at it and explaining what is happening more clearly.  It was 
really not obvious.  I tried at least 100 variations and wasn't seeing the 
pattern.

--

___
Python tracker 

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



[issue23533] MacOSX Python child process running urlopen crashed when tkMessageBox is imported

2015-02-26 Thread vinod sharma

New submission from vinod sharma:

I've have an application which uses tkMessageBox module, multiprocessing module 
and urllib2 module. For some unknown reason, python child process is crashing 
silently while fetching a url. This only happens when tkMessageBox module is 
imported.
Sample code to reproduce the problem is attached. My operating system is MacOS 
10.10

--
components: Tkinter
files: crashreproduce.py
messages: 236721
nosy: vinod sharma
priority: normal
severity: normal
status: open
title: MacOSX Python child process running urlopen crashed when tkMessageBox is 
imported
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file38255/crashreproduce.py

___
Python tracker 

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



[issue23496] Steps for Android Native Build of Python 3.4.2

2015-02-26 Thread Ethan Furman

Ethan Furman added the comment:

Once this android Python is built, can it:

  - be copied from/to other android devices?

  - run without KBOX?

--

___
Python tracker 

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



[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2015-02-26 Thread Martin Panter

Martin Panter added the comment:

This is fixed in 3.4.3. I think it can be closed.

--

___
Python tracker 

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



[issue19884] Importing readline produces erroneous output

2015-02-26 Thread Maxime Belanger

Maxime Belanger added the comment:

I think the version check (`readline._READLINE_VERSION < 0x0600`) is incorrect, 
as the test still fails for me on Mac OS X 10.9 with readline version 6.2 
(0x602). Upgrading to 6.3 (0x603) fixes it, though.

--
nosy: +Maxime Belanger

___
Python tracker 

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



[issue23532] add example of 'first match wins' to regex "|" documentation?

2015-02-26 Thread R. David Murray

R. David Murray added the comment:

The thing is, what you describe is fundamental to how regular expressions work. 
 I'm not sure it makes sense to add a specific mention of it to the '|' docs, 
since it applies to all regexes.

--
assignee:  -> docs@python
components: +Documentation -Regular Expressions
nosy: +docs@python, r.david.murray
title: regex "|" behavior differs from documentation -> add example of 'first 
match wins' to regex "|"  documentation?

___
Python tracker 

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



[issue23533] MacOSX Python child process running urlopen crashed when tkMessageBox is imported

2015-02-26 Thread R. David Murray

R. David Murray added the comment:

When you say 'crash silently', what exactly do you mean?  How are you running 
the program?

--
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



[issue23262] webbrowser module broken with Firefox 36+

2015-02-26 Thread bazwal

bazwal added the comment:

I arrived at an almost identical solution to the one given by Oleg. It works 
for me with FF 28, 35 & 36 - but presumably there are earlier versions where it 
does not, otherise why have the -remote option at all?

The gist of the Mozilla bug report is that the option has existed for a very 
long time, but there are now other command-line options that do exactly the 
same thing. So the only question seems to be whether Python should still 
support those older versions of FF that actually require it (if any exist).

On the xdg-open issue: the $BROWSER env var has priority over the default list 
of browsers to try, so that might explain why xdg-open is not being used on 
some systems (that is how I originally became aware of this problem).

--
nosy: +bazwal

___
Python tracker 

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



[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2015-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue23262] webbrowser module broken with Firefox 36+

2015-02-26 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue19075] Add sorting algorithm visualization to turtledemo

2015-02-26 Thread Ethan Furman

Ethan Furman added the comment:

Code spiffied: added randomization routine that can be used after a sort to 
test a different sort method (or the same one).

Larry, can this extra demo go into 3.4.4, or only 3.5?

--
nosy: +larry
Added file: http://bugs.python.org/file38256/issue19075.stoneleaf.01.patch

___
Python tracker 

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



[issue23534] `test_longdouble` fails on Mac when using system libffi (version 3.1)

2015-02-26 Thread Maxime Belanger

New submission from Maxime Belanger:

Greetings,

We're compiling a custom version of Python 2.7.9 for the Mac (building on OS X 
10.9 with Xcode 6.1), and we're instructing Python to use a vanilla copy of 
`libffi` (that we've also compiled ourselves) using the `--with-system-ffi` 
flag. We're running the regression test suite for sanity purposes and we've 
noticed this error in `test_ctypes`'s `test_longdouble` method:

==
FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks)
--
Traceback (most recent call last):
  File 
"../Python.framework/Versions/2.7/lib/python2.7/ctypes/test/test_callbacks.py", 
line 88, in test_longdouble
self.check_type(c_longdouble, 3.14)
  File 
"../Python.framework/Versions/2.7/lib/python2.7/ctypes/test/test_callbacks.py", 
line 24, in check_type
self.assertEqual(result, arg)
AssertionError: 0.0 != 3.14

I'm reasonably convinced this is caused by the version of `libffi` we're using. 
It seems that if the `--with-system-ffi` flag isn't set, an internal version of 
`libffi` is used instead. However, given that version 3.1 is said to be the 
version Python 2.7.9 is "tracking", this feels like a bug to me. Also, it seems 
that trying to hit this code path in production code could trigger a crash.

--
components: Tests, ctypes
messages: 236729
nosy: Maxime Belanger
priority: normal
severity: normal
status: open
title: `test_longdouble` fails on Mac when using system libffi (version 3.1)
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue23534] `test_longdouble` fails on Mac when using system libffi (version 3.1)

2015-02-26 Thread SilentGhost

Changes by SilentGhost :


--
components: +Macintosh
nosy: +amaury.forgeotdarc, belopolsky, hynek, meador.inge, ned.deily, 
ronaldoussoren

___
Python tracker 

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



[issue23534] `test_longdouble` fails on Mac when using system libffi (version 3.1)

2015-02-26 Thread Ned Deily

Ned Deily added the comment:

Is there a reason you can't use the Python-supplied version of libffi?  That's 
what the standard builds for python.org installers do.  I believe it is the 
case that there are OS X-specific changes in the Python local version that do 
not exist in the upstream and/or system versions but I've not familiar with the 
differences myself; it's not been a high priority issue to test with them.

--

___
Python tracker 

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



[issue23314] Disabling CRT asserts in debug build

2015-02-26 Thread David Bolen

Changes by David Bolen :


--
nosy: +db3l

___
Python tracker 

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