[issue32176] Zero argument super is broken in 3.6 for methods with a hacked __class__ cell

2017-11-29 Thread Dan Snider

New submission from Dan Snider :

The following code works in 3.3, 3.4, and 3.5, but in 3.6 it throws  
RuntimeError: super(): bad __class__ cell. 

from types import FunctionType, CodeType

def create_closure(__class__):
return (lambda: __class__).__closure__

def new_code(c_or_f):
'''A new code object with a __class__ cell added to freevars'''
c = c_or_f.__code__ if isinstance(c_or_f, FunctionType) else c_or_f
return CodeType(
c.co_argcount, c.co_kwonlyargcount, c.co_nlocals,
c.co_stacksize, c.co_flags, c.co_code, c.co_consts, c.co_names,
c.co_varnames, c.co_filename, c.co_name, c.co_firstlineno,
c.co_lnotab, c.co_freevars + ('__class__',), c.co_cellvars)

def add_foreign_method(cls, f):
code = new_code(f.__code__)
name = f.__name__
defaults = f.__defaults__
closure = (f.__closure__ or ()) + create_closure(cls)
setattr(cls, name, FunctionType(code, globals(), name, defaults, closure))

class List(list):
def append(self, elem):
super().append(elem)
def extend(self, elems):
super().extend(elems)
def __getitem__(self, i):
print('foreign getitem')
return super().__getitem__(i)

add_foreign_method(List, __getitem__)

self = List([1,2,3])
self[0]

--
components: Interpreter Core
messages: 307279
nosy: bup
priority: normal
severity: normal
status: open
title: Zero argument super is broken in 3.6 for methods with a hacked __class__ 
cell
type: behavior
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



[issue32175] Add hash auto-randomization

2017-11-29 Thread Brian Jarvis

New submission from Brian Jarvis :

Hash auto-randomization is a mechanism to detect when a collision attack is 
underway and switch to a randomized keying scheme at that point.

This patch is for the 2.7 branch, where hash randomization is not on by default.

Using collided strings from 
https://github.com/Storyyeller/fnv-collider/tree/master/collided_strings, 10 
"attacks" of roughly 50,000 collided strings were launched against this. The 
unmodified Python had a median insert time of roughly 4.32 seconds and a median 
retrieve time of roughly 4.40 seconds. With the auto-randomized version of 
Python, the median insert time was roughly 3.99 seconds and median retrieve 
time was roughly 3.57 seconds. This is a 7.7% and 18.9% savings, respectively.

--
files: auto_rand_2.7.patch
keywords: patch
messages: 307278
nosy: bjarvis
priority: normal
severity: normal
status: open
title: Add hash auto-randomization
type: enhancement
versions: Python 2.7
Added file: https://bugs.python.org/file47305/auto_rand_2.7.patch

___
Python tracker 

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



[issue32174] nonASCII punctuation characters can not display in python363.chm.

2017-11-29 Thread zaazbb

New submission from zaazbb :

In chm(python363.chm) documents, some unicode chars (non ascii chars) can not 
display.
for example:

asyncio — Asynchronous I/O, event loop, coroutines and tasks

displayed as

asyncio � Asynchronous I/O, event loop, coroutines and tasks

and 

Asynchronous programming is more complex than classical “sequential” programming

display as

Asynchronous programming is more complex than classical 搒equential� programming


windows 10, simplified chinese language.
python3.6.3, python363.chm.

--
components: Windows
files: 1512013191(1).jpg
messages: 307277
nosy: paul.moore, steve.dower, tim.golden, zaazbb, zach.ware
priority: normal
severity: normal
status: open
title: nonASCII punctuation characters can not display in python363.chm.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47304/1512013191(1).jpg

___
Python tracker 

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



[issue32144] email.policy.SMTP and SMTPUTF8 doesn't honor linesep's value

2017-11-29 Thread Abhilash Raj

Abhilash Raj  added the comment:

Well, I myself missed the "serialization" part, so it probably was my mistake. 
Maybe a :note: saying line endings are only added in serialized outputs like 
the one obtained from `as_string()` or `as_bytes()` but not for other methods 
that return the body like `get_content()` or `get_payload()` might be helpful.

I stumbled upon it while porting some code from Python 2 to Python 3 and 
decided to use the new API. But, given the behavior of Python 2's 
get_content(decode=True), I would say it might just be clearer if docs 
mentioned this change in behavior (even though the new one is the "correct" 
one).

I can send in a pull request with modifications if you'd like.

--

___
Python tracker 

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



[issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache

2017-11-29 Thread GanZiQim

Change by GanZiQim :


--
keywords: +patch
pull_requests: +4555
stage:  -> patch review

___
Python tracker 

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



[issue32173] linecache.py add lazycache to __all__ and use dict.clear to clear the cache

2017-11-29 Thread GanZiQim

Change by GanZiQim :


--
components: Library (Lib)
nosy: ganziqim
priority: normal
pull_requests: 4554
severity: normal
status: open
title: linecache.py add lazycache to __all__ and use dict.clear to clear the 
cache
type: behavior
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



[issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata

2017-11-29 Thread Malcolm Smith

Malcolm Smith  added the comment:

Related: Issue15795

--

___
Python tracker 

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



[issue32172] Add length counter for iterables

2017-11-29 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

Not every trivial one-liner needs to be in the standard library. In this case, 
there are two easy (and obvious) ways to do it:

sum(1 for x in iterator)

len(list(iterator))

(The first probably saves memory; the second probably is faster.)

Given how rare it is to care ONLY about the length of an iterator, I see no 
reason why this needs to be in the std lib. If you disagree, please take it to 
the Python-Ideas mailing list to get community support first before re-opening 
this ticket.

--
nosy: +steven.daprano
resolution:  -> rejected
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



[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

Jesse Bakker implemented all requested changes, I merged his PR. Well done, 
Jesse!

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



[issue32121] tracemalloc.Traceback.format() should have an option to reverse the traceback

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 706e10b186992e086e661a62d2c8ec9588525b31 by Victor Stinner 
(Jesse-Bakker) in branch 'master':
bpo-32121: Add most_recent_first parameter to tracemalloc.Traceback.format 
(#4534)
https://github.com/python/cpython/commit/706e10b186992e086e661a62d2c8ec9588525b31


--

___
Python tracker 

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



[issue32172] Add length counter for iterables

2017-11-29 Thread bugale bugale

New submission from bugale bugale :

I have noticed that there is no convenient way in python to get the number of 
items in a generator.

For example:
  my_iterable = iter(range(1000))
  len(my_iterable) # Would not work

Of course, something like this would ruin the generator, and it will no longer 
be usable, but in some use cases one would like to know only the count of 
something.

It is possible to do it today using this line:
  sum(1 for x in my_iterable)

but it seems odd to me that there is no function like:
  itertools.count_iterable(my_iterable)
that does exactly this

--
components: Demos and Tools
messages: 307271
nosy: bugale bugale
priority: normal
severity: normal
status: open
title: Add length counter for iterables
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue31279] Squash new gcc warning (-Wstringop-overflow)

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset dedcbee04cd52790027ecfb46cb3aa33efebdc84 by Victor Stinner in 
branch '3.6':
[3.6] bpo-30923, bpo-31279: Fix GCC warnings (#4620)
https://github.com/python/cpython/commit/dedcbee04cd52790027ecfb46cb3aa33efebdc84


--
nosy: +vstinner

___
Python tracker 

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



[issue30923] Add -Wimplicit-fallthrough=0 to Makefile ?

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset dedcbee04cd52790027ecfb46cb3aa33efebdc84 by Victor Stinner in 
branch '3.6':
[3.6] bpo-30923, bpo-31279: Fix GCC warnings (#4620)
https://github.com/python/cpython/commit/dedcbee04cd52790027ecfb46cb3aa33efebdc84


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a by Victor Stinner in 
branch '3.6':
bpo-32030: Fix test_sys.test_getallocatedblocks() (#4637)
https://github.com/python/cpython/commit/06be9daf6f03c1c65b9dd9896bc2b17f3c4bbc3a


--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-29 Thread David Cuthbert

David Cuthbert  added the comment:

Oops, I wasn't looking broadly enough. This is also used in the augmented 
assignment statements syntax, e.g. a += 1, 2, 3

--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-29 Thread David Cuthbert

David Cuthbert  added the comment:

Hm... that leaves the only production for expression_list as:
subscription ::= primary "[" expression_list "]"

And I'm not sure that this shouldn't also be replaced by starred_list. It's not 
accepted today, though:

In [6]: a[1,*(4, 5, 6)]
  File "", line 1
a[1,*(4, 5, 6)]
^
SyntaxError: invalid syntax

I will ask about this again on python-dev@

--

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Pierre Denis

Pierre Denis  added the comment:

Thanks, Tim & Mark. This indeed clarifies and gives a good rationale on Python 
implementation. Nevertheless, despite the authority arguments, I continue to 
wonder what is the rationale for these specifications. Probably the debate 
should move to the standards C99 and IEEE754 themselves.
Agreed to close the ticket on Python... waiting a change to the standards!

--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-29 Thread Henk-Jaap Wagenaar

Henk-Jaap Wagenaar  added the comment:

I think the language spec needs updating as well? In particular in

https://docs.python.org/3/reference/simple_stmts.html#the-return-statement

it seems expression_list should be replaced by starred_list.

--
nosy: +Henk-Jaap Wagenaar

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Tim Peters

Tim Peters  added the comment:

No worries, Mark :-)  Odd things happen sometimes when people are editing near 
the same time.  BTW, of course I agree with closing this!

--

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Sorry, Tim. It looks as though I un-nosied you (de-nosied you?) accidentally. 
Not sure how that happened.

--
nosy: +tim.peters

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

Having read through the rest of that grouper.ieee.org, thread, there doesn't 
seem to be any disagreement with what Vincent suggests. So I believe that 
Python's behaviour is consistent with (a) C99, (b) MPFR, and (c) the spirit of 
IEEE 754. Closing here.

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

See also this posting [1], where the omission is discussed, and Vincent Lefevre 
suggests that the behaviour should be:

> pow (±inf, y) is +inf with no exception
for finite y > 0 and not an odd integer

[1] http://grouper.ieee.org/groups/754/email/msg03969.html

--

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Mark Dickinson

Mark Dickinson  added the comment:

We follow C99 for this case, which says (C99 F 9.4.4):

> pow(−∞, y) returns +∞ for y > 0 and not an odd integer.

Oddly, this clause seems to be missing from section 9.2.1 of IEEE 754. 
Nevertheless, I believe it's the right thing to do.

IEEE 754 _does_ say:

> pow (x, y) signals the invalid operation exception for finite x < 0 and 
> finite non-integer y.

The omission of -inf here is notable, and suggests that it's _not_ intended 
that the pow(-inf, 0.5) case should be considered invalid.

--
nosy:  -tim.peters

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Tim Peters

Tim Peters  added the comment:

As a comment in the referenced patch says, the intent of the patch was to make 
behavior match the C99 spec.  Among other things, C99's annex F (section 
F.9.4.4 "The pow functions") says:

"""
— pow(−∞, y) returns −0 for y an odd integer < 0.
— pow(−∞, y) returns +0 for y < 0 and not an odd integer.
— pow(−∞, y) returns −∞ for y an odd integer > 0.
— pow(−∞, y) returns +∞ for y > 0 and not an odd integer.
"""

So the case you show is doing what the standard specifies, under the last of 
those (y=0.5, which is > 0 and not an odd integer).

--
nosy: +tim.peters

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2017-11-29 Thread David Cuthbert

David Cuthbert  added the comment:

CLA processed, and BDFL has assented on python-dev. Serhiy, thoughts on next 
steps?

--

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Ned Deily

Change by Ned Deily :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue32171] Inconsistent results for fractional power of -infinity

2017-11-29 Thread Pierre Denis

New submission from Pierre Denis :

Python returns inconsistent results when negative infinity is raised to a 
non-integer power. This happens with the ** operator as well as with the pow 
and math.pow functions. The most blatant symptom occurs with power 0.5, which 
is expectedly equivalent to a square root:

>>> float('-inf') ** 0.5
inf
>>> pow(float('-inf'), 0.5)
inf
>>> import math
>>> math.pow(float('-inf'), 0.5)
inf

Mathematically, these operations are invalid if we restrict to real numbers. 
Also, if we extend to complex numbers, the results are wrong since the result 
should be infj, which is the value returned by cmath.sqrt(float('-inf')).

IMHO, there are three possible ways to fix this:

1) raise an exception ValueError
2) return nan
3) return (nan + nanj)

Discussion:

- Solution 1) is consistent with current handling of *finite* negative base 
with non-integer exponent; also, it is consistent with 
math.sqrt(float('-inf')), which raises ValueError.

- I expected solution 2) to be more in line with IEEE754 … until I read the 
following statement in this specification: "pow(x, y) signals the invalid 
operation exception for finite x<0 and finite non-integer y". I’m not an expert 
of this topic but I think that there is miss here since IEEE754 does not state 
what happens for *infinite* x<0 and finite non-integer y.

- Solution 3) emphasizes the fact that, although the result is generally 
undefined, it belongs to complex type.

- In any case, the solution should be consistent also with the case with 
negative fractional exponent… even if I would tend to accept that 
(float('-inf')**-0.5) == 0.0 is mathematically sensible!

- The test assertions shall be updated in Python standard test suite 
(test_float.py).

Note that Python 2.6 behaves consistently for all negative bases, finite or not 
finite: it raises ValueError exception with the message "negative number cannot 
be raised to a fractional power". The behavior described here seems to be 
introduced in this commit: 
https://github.com/python/cpython/commit/9ab44b509a935011beb8e9108a2271ee728e8ad4#diff-b7e3652f51768cec742ef07326413ad0

--
messages: 307256
nosy: pdenis
priority: normal
severity: normal
status: open
title: Inconsistent results for fractional power of -infinity
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32170] Contrary to documentation, ZipFile.extract does not extract timestamps or other metadata

2017-11-29 Thread Malcolm Smith

New submission from Malcolm Smith :

The documentation explicitly says "file information is extracted as accurately 
as possible". But the `zipfile` module doesn't actually extract any metadata at 
all. I assume this text was copied and pasted from the `tarfile` module, which 
does implement this.

Fixing the code is preferred to fixing the documentation.

--
components: Library (Lib)
messages: 307255
nosy: Malcolm Smith
priority: normal
severity: normal
status: open
title: Contrary to documentation, ZipFile.extract does not extract timestamps 
or other metadata
type: behavior
versions: Python 2.7, 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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-11-29 Thread Larry Hastings

Larry Hastings  added the comment:


New changeset 8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3 by larryhastings (Victor 
Stinner) in branch '3.4':
[3.4] bpo-31170: Fix inclusion of expat in Windows build projects (#3785)
https://github.com/python/cpython/commit/8b11e8de7aedacfbbcc8c780f3c4097396f1d1a3


--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue27172] Undeprecate inspect.getfullargspec()

2017-11-29 Thread Brett Cannon

Brett Cannon  added the comment:

Nick pointed me at this issue for the undeprecation of 
inspect.getfullargspec(). While I'm fine with the un-deprecation for 
compatibility reasons, I would rather the function not last beyond Python 3 
un-deprecated. Nick says, though that:
"""
... the undeprecation
isn't a Python 2/3 issue, it's a "tuples, lists and dicts are really
handy representations of things, and Python developers often prefer
them to more structured objects" issue.

The modern inspect.getfullargspec implementation is a relatively thin
wrapper around inspect.signature, and the only lossy part of the
output transformation is that you can't tell the difference between
positional-only and positional-or-keyword parameters.
"""

My argument is TOOWDI and as of right now there's 3 for getting parameter 
information for functions (of which only one is currently deprecated). I would 
also argue that if people want a "signature to core data structure" translation 
then that can be covered by a package on PyPI since even now getfullargspec() 
is lossy and we don't need that kind of pragmatic support in the stdlib for 
this.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Thanks Victor!

I'll open a topic on Python-Dev about file removals.

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

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

I reverted Misc/svnmap.txt.

I understood that the removal of the two tools in Tools is now ok, and so I 
close the issue. If I misunderstood, please speak up and/or reopen the issue ;-)

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 859f7ce7a49f8bd6309748c05e460c10f6a433ed by Victor Stinner in 
branch 'master':
bpo-32159: Revert Misc/svnmap.txt (#4639)
https://github.com/python/cpython/commit/859f7ce7a49f8bd6309748c05e460c10f6a433ed


--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

> How have you created PR 4639? What git commands were used?

"git revert fe2d5babba5d26de2093b6518316b268488187be", then I modified the 
commit to only revert svnmap (git commit --amend).

Git internal storage is fully based on sha1. Identical objects should be merged 
naturally.

My PR 4639 is made of a single commit: 
58f0b38b4058bfaa45a9896aca2b07f02b2de486. You can inspect it using:

$ git ls-tree 58f0b38b4058bfaa45a9896aca2b07f02b2de486 Misc/svnmap.txt
100644 blob 142be7fc206e9d06d5cf62f6500ef987c0441087Misc/svnmap.txt

Compare it with the svnmap.txt *before* my revert:

$ git ls-tree fe2d5babba5d26de2093b6518316b268488187be^ Misc/svnmap.txt
100644 blob 142be7fc206e9d06d5cf62f6500ef987c0441087Misc/svnmap.txt

=> *same* blob object (blob sha1: 142be7fc206e9d06d5cf62f6500ef987c0441087)

--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

How have you created PR 4639? What git commands were used?

--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "Wouldn't this add two 4 MiB patched in the git repository? Wouldn't 
this break the history of this file?"

No idea.

--

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-11-29 Thread Larry Hastings

Larry Hastings  added the comment:

Resetting to "needs patch", because we still need PRs for 3.4 and 3.5 (please!).

--
stage: resolved -> needs patch

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "I don't think it is worth to add this vulnerability to the 
python-security website. You need to compile a 1 GiB Python file on 32-bit 
system for reproducing it. It is very unlikely that this can happen by 
accident, and it is hard to used it in security attack. If you can make the 
attacked program compiling a 1 GiB Python file, you perhaps have easier ways to 
make a harm."

I'm trying to keep track of all CVEs. People are scared by CVE numbers :-( But 
it seems like any bug can get a CVE number, without any real evalution of the 
severity of the bug.

I completed the description on python-security with your paragraph.

FYI I wrote python-security to make sure that vulnerabilities are fixed in 
supported Python branches. Here it seems like we forgot to fix Python 3.4 and 
3.5.

--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Wouldn't this add two 4 MiB patched in the git repository? Wouldn't this break 
the history of this file?

--

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I don't think it is worth to add this vulnerability to the python-security 
website. You need to compile a 1 GiB Python file on 32-bit system for 
reproducing it. It is very unlikely that this can happen by accident, and it is 
hard to used it in security attack. If you can make the attacked program 
compiling a 1 GiB Python file, you perhaps have easier ways to make a harm.

--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

When I wrote PR 4615, I misunderstood the usage of Misc/svnmap.txt. I 
understood that it was used by removed files.

I wrote PR 4639 to revert the file and clarify its usage in Misc/README.

--

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4553

___
Python tracker 

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



[issue32163] getattr() returns None even when default is given

2017-11-29 Thread Raymond Hettinger

Change by Raymond Hettinger :


--
status: open -> closed

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-29 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4552

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset cc83920ad267c992bc421987829da04d88ae816b by Andrew Svetlov in 
branch 'master':
bpo-32166: Drop Python 3.4 code from asyncio (#4612)
https://github.com/python/cpython/commit/cc83920ad267c992bc421987829da04d88ae816b


--

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

I added this vulnerability to the python-security website:
http://python-security.readthedocs.io/vuln/cve-2017-1000158_pystring_decodeescape_integer_overflow.html

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 5d39e0429029324cae90bba2f19fb689b007c7d6 by Victor Stinner in 
branch 'master':
bpo-32030: Rework memory allocators (#4625)
https://github.com/python/cpython/commit/5d39e0429029324cae90bba2f19fb689b007c7d6


--

___
Python tracker 

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



[issue30657] [security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-11-29 Thread STINNER Victor

Change by STINNER Victor :


--
title: CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape -> 
[security] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

___
Python tracker 

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



[issue30657] CVE-2017-1000158: Unsafe arithmetic in PyString_DecodeEscape

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

Leo kirotawa silva: "I re-did the build here for python3.4 and couldn't reach 
the same test fail. So I'm assuming it was a false alarm."

Python 3.4 and 3.5 seem to be also vulnerable:
---

PyObject *PyBytes_DecodeEscape(const char *s,
Py_ssize_t len,
const char *errors,
Py_ssize_t unicode,
const char *recode_encoding)
{
...
Py_ssize_t newlen = recode_encoding ? 4*len:len;
v = PyBytes_FromStringAndSize((char *)NULL, newlen);
---

I don't think that Python 3.6 and 3.7 are vulnerable, the code was rewritten 
with the _PyBytesWriter API. The code got a new _PyBytes_DecodeEscapeRecode() 
helper function which calls _PyBytesWriter_WriteBytes(), and this function 
detects properly integer overflows.

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open
title: Unsafe arithmetic in PyString_DecodeEscape -> CVE-2017-1000158: Unsafe 
arithmetic in PyString_DecodeEscape
versions: +Python 2.7, Python 3.5

___
Python tracker 

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



[issue32107] Improve MAC address calculation and fix test_uuid.py

2017-11-29 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


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



[issue32107] Improve MAC address calculation and fix test_uuid.py

2017-11-29 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 23cc8c0f9ece32f1f96133b9db2cb30c64f23a0e by Barry Warsaw in 
branch '3.6':
[3.6] bpo-32107 - Backport bitmask check fix (GH-4576) (#4591)
https://github.com/python/cpython/commit/23cc8c0f9ece32f1f96133b9db2cb30c64f23a0e


--

___
Python tracker 

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



[issue32107] Improve MAC address calculation and fix test_uuid.py

2017-11-29 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:


New changeset 56e444f8df34cd502d6e3b110c90aed086883a72 by Barry Warsaw in 
branch '2.7':
[2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590)
https://github.com/python/cpython/commit/56e444f8df34cd502d6e3b110c90aed086883a72


--

___
Python tracker 

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Closing now.
Thanks Victor :-)

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset bc19cf57a8f061bbb1961aa069ed54e8361023ae by xdegaye (Miss 
Islington (bot)) in branch '2.7':
bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)
https://github.com/python/cpython/commit/bc19cf57a8f061bbb1961aa069ed54e8361023ae


--

___
Python tracker 

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



[issue32151] -mvenv vs minor python version updates

2017-11-29 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

This is the expected behavior, the upgrade from 3.5 to 3.6 is a feature update 
that is (in general) not expected to be binary compatible with the previous 
release.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset b0df786258c99f98295b82ec62daea1f49912c33 by xdegaye (Miss 
Islington (bot)) in branch '3.6':
bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4635)
https://github.com/python/cpython/commit/b0df786258c99f98295b82ec62daea1f49912c33


--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2017-11-29 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Pinging here. Is there some way to push the issue forward?

--

___
Python tracker 

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



[issue31900] localeconv() should decode numeric fields from LC_NUMERIC encoding, not from LC_CTYPE encoding

2017-11-29 Thread Charalampos Stratakis

Charalampos Stratakis  added the comment:

Pinging here. Is there some way I can help to move the issue forward?

--

___
Python tracker 

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4551

___
Python tracker 

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4550
stage: resolved -> patch review

___
Python tracker 

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread STINNER Victor

STINNER Victor  added the comment:

Python 3.6 and 2.7 are also affected and should be fixed. I requested automated 
backports.

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open
versions: +Python 2.7, Python 3.6

___
Python tracker 

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



[issue32159] Remove tools for CVS and Subversion

2017-11-29 Thread R. David Murray

R. David Murray  added the comment:

I think Serhiy's point is that it doesn't matter whether or not it is used by a 
tool, it is useful for humans.  I don't know if it is used by the tracker; Ezio 
worked on that code, I think.

--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Fixed unix_events.py but see no legacy code in futures.py and sslproto.py.

--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
Removed message: https://bugs.python.org/msg307226

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines and asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Ok, will do everything in single PR

--
title: Drop python 3.4 code from asyncio.coroutines -> Drop python 3.4 code 
from asyncio.coroutines and asyncio.unix_events

___
Python tracker 

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



[issue32169] Drop python 3.4-3.5 code from asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

New submission from Andrew Svetlov :

The work will be done in https://bugs.python.org/issue32166

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Drop python 3.4 code from asyncio.coroutines

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Ok, will do everything in single PR

--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I would prefer to do all trivial changes with one commit.

There may be also non-trivial changes.

--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Andrew Svetlov

Change by Andrew Svetlov :


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



[issue32169] Drop python 3.4-3.5 code from asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
keywords: +patch
pull_requests: +4549
stage:  -> patch review

___
Python tracker 

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



[issue32169] Drop python 3.4-3.5 code from asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
title: Drop python 3.4 code from asyncio.unix_events -> Drop python 3.4-3.5 
code from asyncio.unix_events

___
Python tracker 

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



[issue32169] Drop python 3.4 code from asyncio.unix_events

2017-11-29 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
assignee: asvetlov
components: Library (Lib), asyncio
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Drop python 3.4 code from asyncio.unix_events
versions: Python 3.7

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Separate PyPI package is for Python 3.3 only.
Python 3.4 is shipped with asyncio in standard batteries.

https://github.com/python/asyncio development is stopped, no new PyPI release 
is expected.

Thank you for pointing on 3.4 specific code in other files.

Victor Stinner did some cleanup in last weeks, I've picked up his initiative.

Will review other files as well.
Please let me create a new issue to keep changes small and modular.

--

___
Python tracker 

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



[issue32168] Mutable instance variables don't get new references with args.

2017-11-29 Thread Ertuğrul Karademir

Ertuğrul Karademir  added the comment:

Thank you

Ertuğrul Karademir

On Wed, Nov 29, 2017 at 11:28 AM, Eric V. Smith 
wrote:

>
> Eric V. Smith  added the comment:
>
> This is defined behavior. Try searching for "mutable default parameter".
> For example, here's an old post on it:
>
> http://www.effbot.org/zone/default-values.htm
>
> This isn't related to class vs. instance attributes, but rather the
> default parameter 'props' being modified.
>
> --
> nosy: +eric.smith
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32168] Mutable instance variables don't get new references with args.

2017-11-29 Thread Eric V. Smith

Eric V. Smith  added the comment:

This is defined behavior. Try searching for "mutable default parameter". For 
example, here's an old post on it:

http://www.effbot.org/zone/default-values.htm

This isn't related to class vs. instance attributes, but rather the default 
parameter 'props' being modified.

--
nosy: +eric.smith
resolution:  -> not a bug
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



[issue32168] Mutable instance variables don't get new references with args.

2017-11-29 Thread Ertuğrul Karademir

New submission from Ertuğrul Karademir :

Hello,

I've searched all over Google and this bug tracker with all combinations of 
keywords that I can associate with this issue, but I couldn't find an 
explanation that makes sense or fits the issue.

I know that when dealing with mutable variables, class variables share the same 
reference with all instances, so to assign separate attributes for instances, 
mutable variables should be instance level variables.

However when I create a class like the following,

class Base:
def __init__(self, props=list(), foo='foo base'):
self.props = props
self.foo = foo

def insert_prop(self, i):
self.props.append(i)

and run this:

if __name__ == '__main__':
base = Base()

base.insert_prop(1)
base.insert_prop(2)

print('base props before base2, 3 creation:', base.props)

base2 = Base()
base3 = Base([41, 42])

print('base props after base2, 3 creation:', base.props)
print('base2 props after base2, 3 creation:', base2.props)
print('base3 props after base2, 3 creation:', base3.props)

base2.insert_prop(51)
base3.insert_prop(61)

print('base props after insertion:', base.props)
print('base2 props after insertion:', base2.props)
print('base3 props after insertion:', base3.props)

the output is this:

base props before base2, 3 creation: [1, 2]
base props after base2, 3 creation: [1, 2]
base2 props after base2, 3 creation: [1, 2]
base3 props after base2, 3 creation: [41, 42]
base props after insertion: [1, 2, 51]
base2 props after insertion: [1, 2, 51]
base3 props after insertion: [41, 42, 61]

So initiating base3 with explicit args gives it a new reference to the props 
variable but base and base2 share the same reference. So suddenly props is 
hoisted to class level.

I actually encountered this behaviour when trying to do the same thing with 
child classes with no __init__ method like:

class Sub1(Base):
pass

The whole code is attached.

Is this an expected behaviour? If so I couldn't find a gotcha anywhere.

Regards,

Ertugrul

--
components: Interpreter Core
files: bug.py
messages: 307219
nosy: ekarademir
priority: normal
severity: normal
status: open
title: Mutable instance variables don't get new references with args.
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47303/bug.py

___
Python tracker 

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



[issue32138] android: test_faulthandler fails also on API 24

2017-11-29 Thread Xavier de Gaye

Change by Xavier de Gaye :


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



[issue32138] android: test_faulthandler fails also on API 24

2017-11-29 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset ef83806f5ec01f34f6cbf4ebb5752875b5961f7e by xdegaye in branch 
'master':
bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV (GH-4604)
https://github.com/python/cpython/commit/ef83806f5ec01f34f6cbf4ebb5752875b5961f7e


--

___
Python tracker 

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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Xavier de Gaye

Change by Xavier de Gaye :


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



[issue32139] android: locale is modified by test_strftime

2017-11-29 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d by xdegaye in branch 
'master':
bpo-32139: test_strftime does not anymore modify the locale (GH-4569)
https://github.com/python/cpython/commit/cc55e78acab93a495c974b9a2ea71c8bb9cc2f5d


--

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If it is good to drop 3.4 support in the stdlib asyncio, then there is other 
outdated code.

There is a 3.3 specific workaround in unix_events.py.

There is a 3.4 code or comments in futures.py, sslproto.py, unix_events.py. 
Maybe comments are related to optional code which can now be used 
unconditionally.

Note that not all 3.4 code is marked with "Python 3.4". It can be marked with 
"Python < 3.5".

--

___
Python tracker 

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



[issue32167] Improve random.choice function for FiFa purpose

2017-11-29 Thread Du Phan

Change by Du Phan :


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



[issue32167] Improve random.choice function for FiFa purpose

2017-11-29 Thread Du Phan

Change by Du Phan :


--
title: "Improve" random.choice function for FiFa purpose -> Improve 
random.choice function for FiFa purpose

___
Python tracker 

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



[issue32167] "Improve" random.choice function for FiFa purpose

2017-11-29 Thread Du Phan

Change by Du Phan :


--
components: Build
nosy: duphan
priority: normal
severity: normal
status: open
title: "Improve" random.choice function for FiFa purpose
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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I support getting rid of outdated code.

But what is relation between asyncio in the stdlib and the version outside of 
the stdlib? Shouldn't the code support old Python versions for easier 
synchronization? I remember in the past this prevented modernizing it.

The support of 3.4 is important, since this is a version shipped with Ubuntu 
16.04 LTS. This will be a main version for enterprise at least yet a year.

--
nosy: +giampaolo.rodola, gvanrossum, serhiy.storchaka, vstinner
type:  -> enhancement

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
keywords: +patch
pull_requests: +4548
stage:  -> patch review

___
Python tracker 

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



[issue32166] Drop python 3.4 code from asyncio.coroutines

2017-11-29 Thread Andrew Svetlov

New submission from Andrew Svetlov :

Dropped lines are never executed by supported Python versions.
The code exists for sake of keeping the same code base for stdlib asyncio and 
third-party library with the same name.
Since Python 3.4 asyncio is a part of stdlib, asyncio on PyPI is not 
supported/updated for 2.5 years.
Removing is safe.

The change keeps backward compatibility with old libraries written for `yield 
from` syntax, both awaiting old-styled coroutines and yielding from new styles 
async functions are supported.

async def f():
...
yield from f()

@asyncio.coroutine
def g():
...
await g()

Thus no regressions/deprecations, just removing non-public never executed 
implementation details.

--
assignee: asvetlov
components: Library (Lib), asyncio
messages: 307214
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Drop python 3.4 code from asyncio.coroutines
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2017-11-29 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Steven, do you care to put this to rest?

--
assignee:  -> bethard
nosy: +rhettinger

___
Python tracker 

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



[issue32122] Improve -x option documentation

2017-11-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

AFAIK this should work in Windows XP. And maybe even in Windows 2000.

--

___
Python tracker 

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