[issue27567] Add constants EPOLLRDHUP and EPOLLHUP to module select.

2016-07-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset af98e92f3b30 by Benjamin Peterson in branch 'default':
expose EPOLLRDHUP (closes #27567)
https://hg.python.org/cpython/rev/af98e92f3b30

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> 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



[issue27539] negative Fraction ** negative int not normalized

2016-07-18 Thread Vedran Čačić

Vedran Čačić added the comment:

If it is of any help, here is the patch I wrote online:

http://www.mergely.com/TwCVpiFp/

(also in attachment). I also took the liberty of properly isolating the 
_normalize argument by requiring it to be keyword-only (starting its name with 
underscore doesn't mean much if people could just call e.g. `Fraction(2, 3, 4)` 
without error).

--
keywords: +patch
Added file: http://bugs.python.org/file43786/TwCVpiFp.diff

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Rémi Rampin

Rémi Rampin added the comment:

I am willing to work on documentation and tests if there is an interest in the 
patch.

On Windows, if REQUEST_METHOD is set, it is probably safe to assume that HTTP_* 
variables come from the web server: setting this variable is not the way we set 
a proxy there, so ignoring this dubious variable is probably fine.

--

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

Hmm... very unusual to get this error code without more information about what 
failed - the log file is oddly empty.

Do you perhaps need to reboot your machine to finish installing some other 
program or update? Do you have an earlier version of Python 3.5 installed?

--

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

I committed the fix for negation in audioop.

slice-step.patch includes a better fix for the remaining part of trapv.patch, 
with Element Tree slicing. I think this fix is much less intrusive, and I have 
copied it to other places that handle slicing, and added corresponding test 
cases.

The undefined behaviour sanitizer produces lots of errors about bit shifting 
signed integers in low-level modules like ctypes, struct, audioop. Typically 
this is for code converting signed integers to and from bytes, and 
big/little-endian conversions. This is technically undefined behaviour, but I 
think it may be less serious than the other overflows with traditional 
arithmetic like addition and multiplication. E.g. GCC explicitly documents 
 that this is 
handled as expected with twos-complement, so with GCC there should be no nasty 
surprises with optimizing out undefined behaviour. My set-overflow.patch would 
also be in this boat.

--
versions: +Python 3.6
Added file: http://bugs.python.org/file43785/slice-step.patch

___
Python tracker 

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



[issue27528] Document that filterwarnings(message=...) matches the start of a message

2016-07-18 Thread Martin Panter

Changes by Martin Panter :


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



[issue27539] negative Fraction ** negative int not normalized

2016-07-18 Thread Vedran Čačić

Vedran Čačić added the comment:

Unfortunately, until now I was just a happy user of Python. I suppose some day 
I would have to give something back, and now is as good a day as any:-), but I 
have studied https://docs.python.org/devguide/ for a while and it seems really 
scary.

It means I have to install and get acquainted with Mercurial [BTW I thought 
Python was on git since this year, it seems PEP 481 was just wishful 
thinking:(], and probably with Visual Studio since I use Windows - and I have 
never successfully installed that (I have some weird academic Windows licence 
it doesn't like, and it seems really hard to install for a single non-admin 
user, which is a must since this is actually not my machine:).

So, let's put the cards on the table: if the idea of your post was to initiate 
me in the process of becoming a good open-source citizen, then I'll bite the 
bullet and try to do everything in my power to actually get my equipment into a 
state where I can contribute to Python - but it will take time. On the other 
hand, if the idea was to just fix the bug in time for 3.6b1, it would be a 
great deal simpler if you wrote the patch. :-/

--

___
Python tracker 

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



[issue1621] Do not assume signed integer overflow behavior

2016-07-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6a86018ab33 by Martin Panter in branch 'default':
Issue #1621: Avoid signed int negation overflow in audioop
https://hg.python.org/cpython/rev/d6a86018ab33

--

___
Python tracker 

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



[issue27570] Avoid memcpy(. . ., NULL, 0) etc calls

2016-07-18 Thread Martin Panter

New submission from Martin Panter:

This patch fixes errors reported by GCC’s undefined behaviour sanitizer about 
calling functions with a null pointer:

./configure CC="gcc -fsanitize=undefined"

Using Issue 22605 as a precedent, I propose to avoid calling memcpy() and 
memmove() for zero-length copies when there may be a null pointer.

--
components: Interpreter Core, ctypes
files: memcpy-null.patch
keywords: patch
messages: 270806
nosy: martin.panter
priority: normal
severity: normal
stage: patch review
status: open
title: Avoid memcpy(. . ., NULL, 0) etc calls
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43784/memcpy-null.patch

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-18 Thread Ricardo Esperanza

Ricardo Esperanza added the comment:

attaching justforme. log

--
Added file: http://bugs.python.org/file43783/Python 3.5.2 
(32-bit)_20160718232956_000_core_JustForMe.log

___
Python tracker 

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



[issue27528] Document that filterwarnings(message=...) matches the start of a message

2016-07-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 739f638bb9f8 by Martin Panter in branch '2.7':
Issue #27528: Document and test warning messages must match at beginning
https://hg.python.org/cpython/rev/739f638bb9f8

New changeset 7571432200a2 by Martin Panter in branch '3.5':
Issue #27528: Document and test warning messages must match at beginning
https://hg.python.org/cpython/rev/7571432200a2

New changeset e0761e817deb by Martin Panter in branch 'default':
Issue #27528: Merge warning doc and test from 3.5
https://hg.python.org/cpython/rev/e0761e817deb

--
nosy: +python-dev

___
Python tracker 

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



[issue26207] distutils msvccompiler fails due to mspdb140.dll error on debug builds

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

We're a couple more updates along and it all seems good.

--
resolution:  -> out of date
stage:  -> 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



[issue27569] Windows install problems

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

You should have another log file for "core_JustForMe" near the one you 
uploaded. Could you include that one too?

--

___
Python tracker 

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



[issue27569] Windows install problems

2016-07-18 Thread Zachary Ware

Changes by Zachary Ware :


--
assignee:  -> steve.dower
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



[issue27569] Windows install problems

2016-07-18 Thread Ricardo Esperanza

New submission from Ricardo Esperanza:

Downloaded 3.5.2 package and recived following errors during install
also tried with 3.6 version and got same errors
Using Win 10 X64
attached complete log

[13A0:26B4][2016-07-18T22:40:59]i305: Verified acquired payload: exe_JustForMe 
at path: C:\Users\Ricardo\AppData\Local\Package 
Cache\.unverified\exe_JustForMe, moving to: 
C:\Users\Ricardo\AppData\Local\Package 
Cache\{33B10015-A9B1-4210-B50A-26C6443979B0}v3.5.2150.0\exe.msi.
[13A0:0EE0][2016-07-18T22:40:59]e000: Error 0x80070643: Failed to install MSI 
package.
[13A0:0EE0][2016-07-18T22:40:59]e000: Error 0x80070643: Failed to configure 
per-user MSI package.
[13A0:0EE0][2016-07-18T22:40:59]i319: Applied execute package: core_JustForMe, 
result: 0x80070643, restart: None
[13A0:0EE0][2016-07-18T22:40:59]e000: Error 0x80070643: Failed to execute MSI 
package.
[13A0:0EE0][2016-07-18T22:40:59]i318: Skipped rollback of package: 
core_JustForMe, action: Uninstall, already: Absent

--
components: Installation
files: Python 3.5.2 (32-bit)_20160718224049.log
messages: 270801
nosy: ricardoe
priority: normal
severity: normal
status: open
title: Windows install problems
versions: Python 3.5
Added file: http://bugs.python.org/file43782/Python 3.5.2 
(32-bit)_20160718224049.log

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

I suspect this won’t help on OSes like Windows where environment variable names 
are case-insensitive (correct me if I am wrong).

Regardless, it may be worth making the change. It would be nice to also add 
test case(s). And I wonder if it would be appropriate to add a notice to the 
documentation saying that uppercase HTTP_PROXY is ignored if REQUEST_METHOD 
exists.

--
nosy: +martin.panter

___
Python tracker 

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



[issue14375] Add socketserver running property

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

Some responses to the issues raised by Terry would be helpful, especially the 
incompatibility by adding the RuntimeError. It looks like it forces a race on 
the normal usage of shutdown(). See also Issue 12463: it seems different people 
have different ideas about what this method should do.

Without understanding the motivation(s), I can’t really suggest anything better.

--
nosy: +martin.panter

___
Python tracker 

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



[issue25591] refactor imaplib tests

2016-07-18 Thread R. David Murray

R. David Murray added the comment:

Reitveld can diff patchsets, so I used that for review.

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-18 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

The new patch passes test_datetime on Windows.  This was the last stumbling 
block for me to commit this patch.  Unless anyone would ask for more time to 
review, I plan to commit later this week.

--
Added file: http://bugs.python.org/file43781/issue24773-s3-4.diff

___
Python tracker 

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



[issue27542] Segfault in gcmodule.c:360 visit_decref

2016-07-18 Thread Ned Deily

Ned Deily added the comment:

IMO, there are too many possible scenarios here where a segfault could be 
caused by the Debian patches, by pip, by wheel, or by cffi - too many to assume 
a CPython problem.

FWIW, I am unable to reproduce the segfault on a pretty current Debian testing 
system using a vanilla built-from-source Python 2.7.12 and the currently 
available wheel on PyPI and, for that matter, I'm unable to reproduce using a 
current Debian python2.7.12-1/pip 8.1.2-2/wheel 0.29.0-1.  Unless someone can 
provide a reproducible test case that points to a Python problem using a 
vanilla Python 2.7.12, the issue will have to remain closed as we just don't 
have the resources to try to isolate every problem like this.  Sorry!

--
resolution: third party -> works for me
status: open -> closed

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +orsenthil
stage:  -> patch review
type: enhancement -> security
versions: +Python 2.7, Python 3.3, 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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Rémi Rampin

Changes by Rémi Rampin :


--
keywords: +patch
Added file: http://bugs.python.org/file43779/python-2.7-httpoxy-mitigation.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Rémi Rampin

Changes by Rémi Rampin :


Added file: http://bugs.python.org/file43780/python-3.5-httpoxy-mitigation.patch

___
Python tracker 

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



[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Rémi Rampin

New submission from Rémi Rampin:

https://httpoxy.org/

It is possible to set the HTTP_PROXY in CGI scripts by passing the Proxy 
header. If the script is a Python script and downloads files, urllib will 
happily use the attacker-supplied proxy to make requests.

This should be mitigated like it is in Perl (since 2001), Ruby, and libraries 
like curl.

See also: bug against python-requests 
https://github.com/kennethreitz/requests/issues/3422

--
components: Library (Lib)
messages: 270795
nosy: remram
priority: normal
severity: normal
status: open
title: "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts
type: enhancement

___
Python tracker 

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



[issue27542] Segfault in gcmodule.c:360 visit_decref

2016-07-18 Thread Julien

Julien added the comment:

At cffi they thinks the bug may be from cpython or pip, as

```
$ python -m pip install --user cffi
Collecting cffi
  Using cached cffi-1.7.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting pycparser (from cffi)
Installing collected packages: pycparser, cffi
Successfully installed cffi-1.7.0 pycparser-2.14
Segmentation fault (core dumped)
```

may not import cffi.
c.f.: 
https://bitbucket.org/cffi/cffi/issues/272/segfault-while-installing-via-pip#comment-29256302

--
status: closed -> open

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread R. David Murray

R. David Murray added the comment:

Raymond: yes, I was dubious about the benefit of the doc note.

--

___
Python tracker 

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



[issue26380] Add an http method enum

2016-07-18 Thread Ethan Furman

Ethan Furman added the comment:

That was the last nudge I needed.

Thanks, everyone.

--
assignee:  -> ethan.furman
resolution:  -> rejected
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



[issue26380] Add an http method enum

2016-07-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur that the enum adding nothing of value here.

--
nosy: +rhettinger

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This is an example of the open-closed-principle (the class is open for 
extension but closed for modification).  It is good thing to have because it 
allows subclassers to extend or override a method without unintentionally 
triggering behavior changes in others and without breaking the classes's 
invariants.

We even do this in pure python code as well; for example, inside the pure 
python ordered dict code, the class local call from __init__ to update() is 
done using name mangling.  This allows a subclasser to override update() 
without accidentally breaking __init__.

Sometimes, this is inconvenient.  It means that a subclasser has to override 
every method whose behavior they want to change including get(), update(), and 
others.  However, there are offsetting benefits (protection of internal 
invariants, preventing implementation details from leaking from the 
abstraction, and allowing users to assume the methods are independent of one 
another).

This style (chosen by Guido from the outset) is the default for the builtin 
types (otherwise we would forever be fighting segfaulting invariant violations) 
and for some pure python classes.

We do document when there is a departure from the default.  For example, the 
cmd module uses the framework design pattern, letting the user define various 
do_action() methods.  Also, some of the http modules do the same, specifically 
documentation that the user's do_get method gets called and that some 
specifically named user handler method gets called.

In the absence of specifically documented method hooks (i.e. those listed above 
or methods like __missing__), a subclasser should presume method independence.  
Otherwise, how are you to know whether __getitem__ calls get() under the hood 
or vice-versa?

FWIW, this isn't unique to Python.  It comes up quite a bit in object oriented 
programming.  Correctly designed classes either document root methods that 
affect the behavior of other methods or they are presumed to be independent.

There may need to be a FAQ for this, but nothing is broken or wrong here (other 
than Python having way to many dict variants to chose from).  Also, R David 
Murray almost no one would be helped by a note in some random place in the 
docs.  If someone assumes or believes that __getitem__ must be called by the 
other accessor methods, they find out very quickly that assumption is wrong 
(that is if they run even minimal tests on the code).

--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> low

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread R. David Murray

R. David Murray added the comment:

It doesn't just apply to dicts, it applies to all the built in collection types 
(and possibly to other built in types).  But not to all the methods, which will 
make the documentation somewhat vague ("you may not be able to successfully 
override base class methods such as __setitem__...")  Oh, and I suppose it 
needs to be marked as a CPython implementation detail.

--

___
Python tracker 

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



[issue27567] Add constants EPOLLRDHUP and EPOLLHUP to module select.

2016-07-18 Thread Марк Коренберг

Changes by Марк Коренберг :


--
components: +Library (Lib)
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



[issue27567] Add constants EPOLLRDHUP and EPOLLHUP to module select.

2016-07-18 Thread Марк Коренберг

New submission from Марк Коренберг:

These constants are supported since Linux kernel 2.6.17

--
messages: 270788
nosy: mmarkk
priority: normal
severity: normal
status: open
title: Add constants EPOLLRDHUP and EPOLLHUP to module select.

___
Python tracker 

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



[issue27566] Tools/freeze/winmakemakefile.py clean target should use 'del' instead of 'rm'

2016-07-18 Thread Zachary Ware

Changes by Zachary Ware :


--
keywords: +easy
stage:  -> needs patch
title: Freeze: winmakemakefile.py: clean: Linux instead of Windows command -> 
Tools/freeze/winmakemakefile.py clean target should use 'del' instead of 'rm'
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue27566] Freeze: winmakemakefile.py: clean: Linux instead of Windows command

2016-07-18 Thread David D

New submission from David D:

The command for the clean target in the Windows makefile is the same as the one 
in the Linux one: using `rm -f`.

Should be changed to `del /f` or `erase /f`.

--
components: Demos and Tools, Windows
messages: 270787
nosy: David D, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Freeze: winmakemakefile.py: clean: Linux instead of Windows command
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, 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



[issue27469] Unicode filename gets crippled on Windows when drag and drop

2016-07-18 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy:  -haypo

___
Python tracker 

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



[issue27565] Offer error context manager for code.interact

2016-07-18 Thread Claudiu Saftoiu

New submission from Claudiu Saftoiu:

When debugging code that raises unexpected exceptions, I often find myself 
doing this:

try:
some_code
except:
import code; code.interact(local=locals())
raise

My suggestion is a context manager to make this less verbose:

with code.interact_on_error():
some_code

The effect would be the same: if an exception is caught, `code.interact` is 
called with the locals of the function, and re-raised when `code.interact` ends.

--
components: Library (Lib)
messages: 270786
nosy: Claudiu Saftoiu
priority: normal
severity: normal
status: open
title: Offer error context manager for code.interact
type: enhancement

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-07-18 Thread Jim Fulton

Jim Fulton added the comment:

Does the draft doc change look OK?

--

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Iovan Irinel

Iovan Irinel added the comment:

Thanks, i don't think is a big issue.  Because on windows 7, 8 , 8.1 , 10 it 
works.

Just with windows xp i have this issue.

It's ok paid. No problem, soo if someone want to fix for me this :  Sure paid 
contact me please.

And someone want to do it free contact me too and we will submit a patch to 
help all users. 

Even paid i will share the fix.  

Regards.

--

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread Kirk Hansen

Kirk Hansen added the comment:

I think it could make sense at the top of the intro. It could also make sense 
to have it sit 
https://docs.python.org/2.7/library/stdtypes.html?highlight=dict#mapping-types-dict
 and have the intro link to it, or vice-versa. Thoughts?

--

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

Unfortunately, you can't do that either. Projects including static libraries 
all need to use the same compiler.

So either build python27.dll separately and dynamically link to it (or just use 
the one that we build and release, and be careful not to mix up memory or file 
management functions as they will be incompatible), build everything with VS 
9.0, or you'll need help to find a fix.

Most - possibly all - of our volunteers are not going to be willing to go deep 
on custom Python 2.7 build issues. You're probably going to have to find 
someone who can offer paid support.

--

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Iovan Irinel

Iovan Irinel added the comment:

It's ok for me to use  vc .9 but when i try to link it says  "  This library 
was created with an older visual stuido toolset " And it trow in a error.



And about v140 compatibility i don't maded so much changes. It was 3 minutes of 
work.

Maybe someone take a look, i'm new in c++ development and python too. I don't 
think i'm able to find a fix.

Maybe some ideea about how to make vs2015 to link with a library from vc 9.0 ?

--

___
Python tracker 

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



[issue27564] 2.7.12 Windows Installer package broken.

2016-07-18 Thread Tom Middleton

Tom Middleton added the comment:

Ok, so really bizarre. I uninstalled 2.7.11, then I was getting the same error 
with the 2.7.11 msi. So I was thinking that I should go back to the original 
version I had installed (2.7.10) the installer showed a "repair" option so I 
did that, then the 2.7.11 install worked.
And then the 2.7.12 installer worked.

I would have to agree with Steve Dower. I think that it had something to do 
with pip because there were a couple cmd windows that popped up during the 
install process that showed something to do with pip which didn't the first 
time I ran the installer.

--

___
Python tracker 

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



[issue27564] 2.7.12 Windows Installer package broken.

2016-07-18 Thread Tom Middleton

Tom Middleton added the comment:

@Zachary,
I tried to uninstall (the C:\python27\ directory seemed to persist after) the 
install of 2.7.12 failed again same message.

--

___
Python tracker 

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



[issue27564] 2.7.12 Windows Installer package broken.

2016-07-18 Thread Tom Middleton

Tom Middleton added the comment:

@Steve,
I think my pip install was fine? I was using pip pretty regularly with 2.7.11.

I had to do a restore to get 2.7.11 working again, and after an install of 
2.7.12 failed again with the same issue.

--

___
Python tracker 

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



[issue24773] Implement PEP 495 (Local Time Disambiguation)

2016-07-18 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Naoki, thanks for the review.  I addressed your comments in 

https://github.com/abalkin/cpython/commit/a61a25d2dd04336361b2ea676c80afdb2639f579

Attached patch, issue24773-s3-3.diff, incorporates your comments and a few 
other fixes.  See github for the full history.

--
Added file: http://bugs.python.org/file43778/issue24773-s3-3.diff

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Brett Cannon

Changes by Brett Cannon :


--
type:  -> enhancement

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

You're compiling Python in a completely unsupported way right now, so I'm 
afraid you'll need to submit a patch to get it fixed.

Python 2.7 is only officially supported with VC 9.0 (not VC 14.0), and I don't 
believe the other volunteers test the static library build either, so I'm 
afraid you're somewhat on your own.

That said, if you do find a fix and submit a patch, it may be merged in. 
However, to even be able to build with VC 14.0 you've probably made a great 
number of changes that certainly won't be accepted at this stage.

--

___
Python tracker 

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



[issue27564] 2.7.12 Windows Installer package broken.

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

Or if you first repair 2.7.11 and then install 2.7.12.

This error often happens because your pip installation is corrupt, and then pip 
fails to uninstall itself which aborts the whole installation. Generally 
repairing the install before uninstalling resolves it.

--

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Brett Cannon

Brett Cannon added the comment:

Is the stati library a third-party project?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue10496] Python startup should not require passwd entry

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Hi @victor I have compiled the bug.c file with my fedora 24.
there is python 2.7.11 and 3.5.1 and I don't have the bug with these versions.

What can we do with this issue ?

Thanks,

Stephane

--
nosy: +matrixise

___
Python tracker 

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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Iovan Irinel

Iovan Irinel added the comment:

I tested again. And the answer is this: Problem is stati library.

I tested:
- 2.7.6
- 2.7.7
- 2.7.8
- 2.7.9
- 2.7.10
- 2.7.11
- 2.7.12

This issue happen just when pythoncore is compiled as static library. With DLL 
it works.

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

maybe we can continue on this issue and close it asap.

what do you think ?

--
nosy: +matrixise

___
Python tracker 

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



[issue27564] 2.7.12 Windows Installer package broken.

2016-07-18 Thread Zachary Ware

Zachary Ware added the comment:

What happens if you first uninstall 2.7.11 and then install 2.7.12?

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I have checked the status of the FreeBSD issue, and it's "New". What do you 
think for the fix ?

--
nosy: +matrixise

___
Python tracker 

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



[issue18049] Re-enable threading test on OSX

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

for my part, I think you should use a #ifdef PY_DEBUG in your code and increase 
the default size of the stack for the threads, and only if you are on APPLE and 
PY_DEBUG mode.

--
nosy: +matrixise

___
Python tracker 

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



[issue27364] Deprecate invalid unicode escape sequences

2016-07-18 Thread Emanuel Barry

Emanuel Barry added the comment:

Here's a new patch which also deprecates invalid escape sequences in bytes. 
Tests included with test_codecs.

Patch includes and supersedes deprecate_invalid_escapes_only_3.patch, and I 
have not found a single instance of an invalid escape sequence other than in 
test_codecs, so this should be fine now.

--
Added file: 
http://bugs.python.org/file43777/deprecate_invalid_escapes_both_1.patch

___
Python tracker 

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



[issue14375] Add socketserver running property

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

what's the status of this issue ?

--
nosy: +matrixise

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

A simple try ... except ... can set the variable to Py_None:

>>> import threading
>>> def foo():
... try:
... raise RuntimeError
... except:
... pass
... raise
... 
>>> threading.Thread(target=foo).start()
>>> Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
  File "", line 6, in foo
RuntimeError: No active exception to reraise

In the startup procedure, some c-apis are called and there are patterns like:

try:
import some_module
except ImportError:
some_module = ...

So I think after startup the variable can't be NULL. But we do see a NULL case 
here.

--

___
Python tracker 

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



[issue27564] 2.7.12 Windows Installer package broken.

2016-07-18 Thread Tom Middleton

New submission from Tom Middleton:

I was running:
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

I downloaded the msi for Python 2.7.12 and attempted to run it. During the 
installation it gave me the following error:

"There is a problem with this Windows Installer package. A program required for 
this install to complete could not be run. Contact your support personnel or 
package vendor."


Then it "rolls back" the action, which killed my current 2.7.11 installation.  
Despite that it states: 

"Python 2.7.12 setup ended prematurely because of an error. Your system has not 
been modified. To install this program at a later time, please run the 
installation again."

(pardon any typos in the error messages since I wasn't able to copy the text 
directly.)

I attempted this twice with the same result.

Thanks,
Tom

--
components: Installation
messages: 270762
nosy: busfault
priority: normal
severity: normal
status: open
title: 2.7.12 Windows Installer package broken.
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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread R. David Murray

R. David Murray added the comment:

Since ceval already has such a check, I think we should fix it by adding the 
check as proposed.  Investigating whether the codebase could be simplified by 
making sure that Py_None is always there after startup would be a separate 
issue, I think, possibly related to PEP 432.

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread R. David Murray

R. David Murray added the comment:

Where in the docs do you think such a note should go?  I suppose it could go in 
the intro to the chapter you link to.  I doubt many people will find it there, 
though :(

--
nosy: +r.david.murray
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

It's reasonable but I'd still like to hear others' voices since it looks more 
like to me it's the behaviour of raise itself rather than threading that 
crashes.

--

___
Python tracker 

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



[issue27563] docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean)

2016-07-18 Thread Ram Rachum

New submission from Ram Rachum:

My mistake

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue27563] docs for `gc.get_referrers` should explain the result format (i.e. what keys in the dict mean)

2016-07-18 Thread Ram Rachum

Changes by Ram Rachum :


--
assignee: docs@python
components: Documentation
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: docs for `gc.get_referrers` should explain the result format (i.e. what 
keys in the dict mean)
versions: Python 2.7, Python 3.2, Python 3.3, 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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread Berker Peksag

Berker Peksag added the comment:

I would prefer Antti's test case in msg270730 since the bug can be reproduced 
by using threading module (you can use assert_python_ok() as a helper.) 
Lib/test_threading.py is probably a better place for the test.

--
nosy: +berker.peksag
stage: needs patch -> 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



[issue27562] Import error encodings (Windows xp compatibility)

2016-07-18 Thread Iovan Irinel

New submission from Iovan Irinel:

I have python embeded intro my application. I wanted to upgrade to python 
2.7.12 i use also a static library. Not DLL.  I have defined 
"Py_NO_ENABLE_SHARE"
Ok, all work fine with 2.7.6

I want to say this error happen just when i run it under windows xp.
Under windows 10 it works , my application start.. Pythoncore and application 
is build with v140_xp toolset i user visual studio 2015. I can make a video 
with error if is necessary. Thanks.

Traceback (most recent call last):
  File "Lib/site.py", line 548, in 
  File "Lib/site.py", line 537, in main
  File "Lib/site.py", line 465, in aliasmbcs
  File "Lib/locale.py", line 13, in 
ImportError: No module named encodings


I made more test and i come with a reply.

--
components: Windows
messages: 270756
nosy: Iovan Irinel, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Import error encodings (Windows xp compatibility)
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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Upload a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file43776/issue27558.patch

___
Python tracker 

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



[issue27561] Warn against subclassing builtins, and overriding their methods

2016-07-18 Thread Kirk Hansen

New submission from Kirk Hansen:

I tried subclassing dict, and overriding its __setitem__ and __getitem__ and 
got some interesting results. See 
http://stackoverflow.com/questions/38362420/subclassing-dict-dict-update-returns-incorrrect-value-python-bug?noredirect=1#comment64142710_38362420
 for an example.

I tried sub-classing UserDict.UserDict and experienced some of the same 
problems. Eventually, I discovered that subclassing MutableMapping was my best 
bet.

After an hour or two of searching and reading I discovered that CPython will 
not call overridden built-in methods of the same object 
(https://pypy.readthedocs.io/en/latest/cpython_differences.html#subclasses-of-built-in-types).
 This behaviour could (and did) cause some hard to track down bugs in code. 

I briefly looked at the later versions of python documentation and didn't see a 
mention of this (sorry if it's there), but python2.7 definitely does not 
mention this. In fact, python2.7 seems to __encourage__ users to subclass the 
built-ins (see the note 
https://docs.python.org/2.7/library/stdtypes.html?highlight=dict#built-in-types).
 Subclassing dict to __extend__ functionality is great, but there should be a 
big bad warning when trying to __override__ built-ins like __setitem__ and 
__getitem__.

--
assignee: docs@python
components: Documentation
messages: 270754
nosy: Kirk Hansen, docs@python
priority: normal
severity: normal
status: open
title: Warn against subclassing builtins, and overriding their methods
type: enhancement
versions: Python 2.7, Python 3.2, Python 3.3, 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



[issue26380] Add an http method enum

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

what's the status of your issue ?

--
nosy: +matrixise

___
Python tracker 

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



[issue3119] pickle.py is limited by python's call stack

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

hello, I think we can close this issue because Python 3.1 is not supported. or 
we keep it if this issue is confirmed for Python 3.6.

--
nosy: +matrixise

___
Python tracker 

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



[issue11822] Improve disassembly to show embedded code objects

2016-07-18 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

hello, we can continue the discussion on this issue ?

--

___
Python tracker 

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



[issue27539] negative Fraction ** negative int not normalized

2016-07-18 Thread Mark Dickinson

Mark Dickinson added the comment:

Oops, that's an embarrassing bug.

Branching depending on the sign sounds fine to me. There's no point worrying 
about supporting strange Fraction-like things without a concrete idea of 
exactly which such things we want to support.

Are you interested in writing a patch?

--
priority: normal -> high

___
Python tracker 

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



[issue26624] Windows hangs in call to CRT setlocale()

2016-07-18 Thread Steve Dower

Steve Dower added the comment:

Lot of different people involved in those areas, so can't promise an answer, 
but I'll see.

Also, unless you think a closed issue needs to be reopened, please avoid using 
them for chat.

--

___
Python tracker 

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



[issue27543] from module import function creates package reference to the module

2016-07-18 Thread R. David Murray

R. David Murray added the comment:

Note that conceptually this is closely related to issue 27515.  In both cases 
the conceptual problem (the thing that trips up user expectations) is that what 
import does to the namespaces differs depending on whether the base module 
exists in sys.modules or not.  I don't know that there is a fix, but it is 
certainly an inconsistency that causes mental hiccoughs.

--

___
Python tracker 

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



[issue27558] SystemError with bare `raise` in threading or multiprocessing

2016-07-18 Thread Emanuel Barry

Changes by Emanuel Barry :


--
nosy: +davin, ebarry, pitrou
stage:  -> needs patch
title: SystemError inside multiprocessing.dummy Pool.map -> SystemError with 
bare `raise` in threading or multiprocessing
versions: +Python 3.6 -Python 3.2, Python 3.3

___
Python tracker 

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



[issue27560] Memory overallocation crash and keyboard interrupt stops working

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

Yes you are probably right Antti. The input to compress would need 31 TB of 
memory, and is a text string, while Python 3’s zlib.compress() requires bytes. 
In other words, this will be the same problem of overallocating memory as Issue 
27559.

Pablo: I suggest you carefully look at the code, try to understand what it is 
doing, eliminating the unnecessary parts, etc. Especially when so many of your 
reports today involve similar techniques.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Crash On bytearray()
title: zlib.compress() crash and keyboard interrupt stops working -> Memory 
overallocation crash and keyboard interrupt stops working

___
Python tracker 

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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

> Easiest fix would be to make do_raise test for both NULL and None, but I'd 
> really consider fixing the new thread initialization if possible.

I think the easiest fix is OK. The new thread initialization is consistent and 
should not be changed. The Py_None seems to be set in somewhere in ceval but I 
am not sure where. You can see at 
https://hg.python.org/cpython/file/tip/Python/ceval.c#l1200 both NULL and 
Py_None are checked.

--

___
Python tracker 

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



[issue27547] Integer Overflow Crash On float(array.array())

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

Perhaps this is the same as Issue 5614, i.e. the problem lies with OS X rather 
than Python?

--
nosy: +martin.panter

___
Python tracker 

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



[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

I may be hard to test this change without enough memory. I upload the test 
results with the latest change.

--
Added file: http://bugs.python.org/file43775/zlib_test_result

___
Python tracker 

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



[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Thanks for your work.

--

___
Python tracker 

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



[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

Committed without any macro for the time being

--
resolution: not a bug -> 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



[issue27559] Crash On bytearray()

2016-07-18 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution: remind -> not a bug
stage:  -> resolved

___
Python tracker 

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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread Antti Haapala

Antti Haapala added the comment:

I am pretty sure **it never calls zlib.compress**. I get memory error from that 
argument alone, on Linux with overcommit memory enabled, 16G ram, swap.

--
nosy: +ztane

___
Python tracker 

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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

Compressing large data is born to be slow and it's highly possible to cause the 
kernel halt then due to resource limit. 

> This may be used to crash python remotely if a server takes user input and 
> runs it through zlib.compress(b'variable' * 2**32) which is not very likely. 
> You probably should set a limit for what you compress and how much it is.

This is the responsibility of application code not library code.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread pablo sacristan

pablo sacristan added the comment:

I'd like to but I don't have enough memory either, sorry.

--
versions: +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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

There is a good chance crashes and related 2 GiB and 4 GiB limits in zlib will 
be solved by Issue 27130. Do you want to see if the patch improves the 
situation? (I cannot test it directly because I don’t have enough memory.)

--
nosy: +martin.panter

___
Python tracker 

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



[issue27559] Crash On bytearray()

2016-07-18 Thread pablo sacristan

pablo sacristan added the comment:

I know, but then shouldn't you try limiting the amount of data it allocates? Or 
maybe allow for keyboard interrupts to be used while the it is going on, 
because keyboard interrupts weren't working while it was working.

--
resolution: not a bug -> remind

___
Python tracker 

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



[issue27559] Crash On bytearray()

2016-07-18 Thread Martin Panter

Martin Panter added the comment:

bytearray(n) needs to allocate n bytes. Unless your computer has 1024 GiB of 
memory, this is not going to be possible. If you are using an OS like Linux, it 
may pretend to allocate that much memory, and then kill the process when it 
realizes it has overallocated. If you need more robust behaviour on Linux, I 
suggest looking into disabling memory overcommit.

--
nosy: +martin.panter
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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Antti Haapala

Antti Haapala added the comment:

I was thinking that perhaps an exception is always raised somewhere before? I 
tried skipping site, but it still works, so I am not too sure.

--

___
Python tracker 

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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

I am curious why individual `raise` doesn't get the same problem in single 
thread program.

--

___
Python tracker 

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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Xiang Zhang

Xiang Zhang added the comment:

It seems the thread state is initialized in thread_PyThread_start_new_thread. 
It calls _PyThreadState_Prealloc which initialize exc_type to NULL.

--

___
Python tracker 

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



[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread pablo sacristan

New submission from pablo sacristan:

zlib.compress crashes when you put a lot of stuff into it and even when you try 
keyboard interrupts it doesn't work for some reason, and Python gets killed 
because trying to compress so much data gets the Python process get killed by 
the kernel. If you put a large amount of data in it will get killed quicker. A 
problem is that keyboard interrupts stop working while the program is running, 
which is usually around 5 - 15 seconds during which python stops working 
(including interrupts) until it gets killed by the kernel. This may be used to 
crash python remotely if a server takes user input and runs it through 
zlib.compress(b'variable' * 2**32) which is not very likely. You probably 
should set a limit for what you compress and how much it is.
The output is:
Killed: 9
Even though you try doing keyboard interrupt it doesn't work.

--
files: crash.py
messages: 270732
nosy: pabstersac
priority: normal
severity: normal
status: open
title: zlib.compress() crash and keyboard interrupt stops working
Added file: http://bugs.python.org/file43774/crash.py

___
Python tracker 

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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Antti Haapala

Antti Haapala added the comment:

more easily reproducible by

import threading
def foo():
raise
threading.Thread(target=foo).start()

--

___
Python tracker 

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



[issue27559] Crash On bytearray()

2016-07-18 Thread pablo sacristan

New submission from pablo sacristan:

There is a crash on bytearray(), not really a crash but rather the process gets 
killed by the kernel, but that is a crash, and the keyboard interrupt stops 
working while bytearray is working, so you can either restart python or wait 
for python to get killed by the kernel. The biggest problem is that while 
bytearray() is trying to do something, you can't interrupt it just doesn't work 
for some reason.
This should be enough for bytearray to crash :
bytearray(0xFF)
It crashes after some time with a Killed: 9 error.

Hope it helps ;)

--
messages: 270731
nosy: pabstersac
priority: normal
severity: normal
status: open
title: Crash On bytearray()
versions: 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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Antti Haapala

Antti Haapala added the comment:

OTOH, if you put sys.exc_info() in place of raise there, it correctly (None, 
None, None) there, because it does (sysmodule.c:sys_exc_info)

tstate->exc_type != NULL ? tstate->exc_type : Py_None,

Easiest fix would be to make do_raise test for both NULL and None, but I'd 
really consider fixing the new thread initialization if possible.

--

___
Python tracker 

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



[issue27558] SystemError inside multiprocessing.dummy Pool.map

2016-07-18 Thread Antti Haapala

Antti Haapala added the comment:

Reproducible on Python 3.6a4ish on Ubuntu. I believe this needs forking 
multiprocessing.

do_raise is called with 2 NULLs as arguments, it should raise

PyErr_SetString(PyExc_RuntimeError,
"No active exception to reraise");

What happens is that PyThreadState is initialized to *all* NULL pointers on the 
new thread on multiprocessing, however `type` is expected to point to `Py_None` 
when no exception has been raised:

PyThreadState *tstate = PyThreadState_GET();
PyObject *tb;
type = tstate->exc_type;
value = tstate->exc_value;
tb = tstate->exc_traceback;
if (type == Py_None) {
PyErr_SetString(PyExc_RuntimeError,
"No active exception to reraise");
return 0;
}

I am not sure where the thread state should have been initialized though

--
nosy: +ztane

___
Python tracker 

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



[issue16191] ceval cleanup

2016-07-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6cf4386de3cc by Martin Panter in branch '3.5':
Issue #16191: Fix up references to renamed variables
https://hg.python.org/cpython/rev/6cf4386de3cc

New changeset c10fe99afced by Martin Panter in branch 'default':
Issue #16191: Merge comment fixes from 3.5
https://hg.python.org/cpython/rev/c10fe99afced

--

___
Python tracker 

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



[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 54cc0480904c by Martin Panter in branch '3.5':
Issue #27507: Check for integer overflow in bytearray.extend()
https://hg.python.org/cpython/rev/54cc0480904c

New changeset 6e166b66aa44 by Martin Panter in branch '2.7':
Issue #27507: Check for integer overflow in bytearray.extend()
https://hg.python.org/cpython/rev/6e166b66aa44

New changeset 646ad4894c32 by Martin Panter in branch 'default':
Issue #27507: Merge overflow check from 3.5
https://hg.python.org/cpython/rev/646ad4894c32

--
nosy: +python-dev

___
Python tracker 

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



  1   2   >