[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


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



[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset a3070d530c70477273cacbc61660b318582fff44 by Benjamin Peterson in 
branch 'master':
bpo-31347: _PyObject_FastCall_Prepend: do not call memcpy if args might not be 
null (#3329)
https://github.com/python/cpython/commit/a3070d530c70477273cacbc61660b318582fff44


--

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2017-09-04 Thread Neil Schemenauer

Neil Schemenauer added the comment:


New changeset db564238db440d4a2d8eb9d60ffb94ef291f6d30 by Neil Schemenauer in 
branch 'master':
Revert "bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on 
exit. (#1908)" (#3337)
https://github.com/python/cpython/commit/db564238db440d4a2d8eb9d60ffb94ef291f6d30


--

___
Python tracker 

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



[issue31342] test.bisect module causes tests to fail

2017-09-04 Thread Neil Schemenauer

Neil Schemenauer added the comment:

The key is how the test is run.  If you run:

$ ./python Lib/test/.py

Then the Lib/test gets added to the first part of sys.path.  Then "import 
bisect" imports the Lib/test/bisect.py module rather than Lib/bisect.py.  
Obvious options seem to be:

1. rename Lib/test/bisect.py to something else
 
2. don't allow running files in Lib/test as scripts

To me, #2 is not a good option.  I'm attaching the output of:

./python.exe Lib/test/regrtest.py -v test_datetime 2>&1

In case it is helpful.  I pruned some lines to keep the file smaller.

--
Added file: http://bugs.python.org/file47119/test_datetime_out.txt

___
Python tracker 

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



[issue17852] Built-in module _io can loose data from buffered files at exit

2017-09-04 Thread Neil Schemenauer

Changes by Neil Schemenauer :


--
pull_requests: +3352

___
Python tracker 

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



Re: Please improve these comprehensions (was meaning of [ ])

2017-09-04 Thread Rustom Mody
On Tuesday, September 5, 2017 at 1:44:24 AM UTC+5:30, Ben Bacarisse wrote:
> Rustom Mody  writes:
> 
> > Here is some code I (tried) to write in class the other day
> >
> > The basic problem is of generating combinations
> 
> > Now thats neat as far as it goes but combinations are fundamentally sets
> > not lists
> >
> > So I thought python would do a better job
> > I tried translating it to python and sets but it turned out more annoying 
> > than
> > helpful
> > Can someone improve it??
> >
> > The straightforward translation of the above
> > Which is ok so far
> >
> >
> > def c(n,r):
> > if r == 0:
> > return [[]]
> > elif len(n) == 0:
> > return []
> > else:
> > return [[n[0]] + l for l in c(n[1:],r-1)] + c(n[1:],r)
> >
> >
> > Now to go from returning list of lists to set of sets:
> 
> def cs(n, r):
> if r == 0:
> return [set()]
> elif len(n) == 0:
> return []
> else:
> return [set([n[0]]) | l for l in cs(n[1:], r-1)] + cs(n[1:], r)
> 
> ?
> 
> It's not so neat if you also want n to be a set rather than a list
> because the set equivalents of n[0] and n[1:] are a but more complex but
> it's not that bad:
> 
> def css(n,r):
> if r == 0:
> return [set()]
> elif len(n) == 0:
> return []
> else:
> rest = n.copy()
> e = rest.pop()
> return [set([e]) | l for l in css(rest, r-1)] + css(rest, r)

Trying out your code Ben…

>>> css({1,2,3,4}, 2)
[set([1, 2]), set([1, 3]), set([1, 4]), set([2, 3]), set([2, 4]), set([3, 4])]

>>> type(css({1,2,3,4}, 2))



Whereas with the cs I earlier gave:
>>> cs(frozenset([1,2,3,4]), 2)
frozenset([frozenset([2, 4]), frozenset([3, 4]), frozenset([2, 3]), 
frozenset([1, 3]), frozenset([1, 2]), frozenset([1, 4])])
>>> type(cs(frozenset([1,2,3,4]), 2))


So in case I did not make it clear enough earlier, there are three collection 
types in the spec.

A small amount of meta-combinatorics on the combinatorics!

Lets say 
{1,2} : ℘ Int  ## powerset 
[1,2] : ℒ Int  ## list type constructor
There are many others eg
⟆1,2⟅ : ℬ Int  ## Bag type constructor
Not to mention iterators
Lets just stay with set and list for simplicity

So the combinations enumerator has the general type (schema)
[For ℛ being one of the above collection type constructors] 
c : ℛ t → Int → ℛ ℛ t

However each of these ℛ's could be different
c : ℛ₁ t → Int → ℛ₂ ℛ₃ t

This gives 8 possibilities (assuming 2 constructors)
Your function had type
css : ℘ t → Int → ℒ ℘ t

whereas I wanted
cs : ℘ t → Int → ℘ ℘ t

And this has not yet touched on the difference between set and frozenset!


Why do we need frozenset at all?
Because the set type wont close in python!

## List of lists... ok
>>> [[1,2],[3,4]]
[[1, 2], [3, 4]]

## List of sets slightly clunky but still ok
>>> [{1,2},{3,4}]
[set([1, 2]), set([3, 4])]

## Set of sets??… Sorry!!
>>> {{1,2},{3,4}}
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unhashable type: 'set'
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26692] cgroups support in multiprocessing

2017-09-04 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



Re: Please improve these comprehensions (was meaning of [ ])

2017-09-04 Thread breamoreboy
On Monday, September 4, 2017 at 9:14:24 PM UTC+1, Ben Bacarisse wrote:
> Rustom Mody  writes:
> 
> > Here is some code I (tried) to write in class the other day
> >
> > The basic problem is of generating combinations
> 
> > Now thats neat as far as it goes but combinations are fundamentally sets
> > not lists
> >
> > So I thought python would do a better job
> > I tried translating it to python and sets but it turned out more annoying 
> > than
> > helpful
> > Can someone improve it??
> >

[lots of code snipped]

> -- 
> Ben.

Here's my take 
https://docs.python.org/3/library/itertools.html#itertools.combinations

Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue17852] Built-in module _io can loose data from buffered files at exit

2017-09-04 Thread Neil Schemenauer

Neil Schemenauer added the comment:


New changeset e38d12ed34870c140016bef1e0ff10c8c3d3f213 by Neil Schemenauer in 
branch 'master':
bpo-17852: Maintain a list of BufferedWriter objects.  Flush them on exit. 
(#1908)
https://github.com/python/cpython/commit/e38d12ed34870c140016bef1e0ff10c8c3d3f213


--

___
Python tracker 

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



[issue31348] webbrowser BROWSER with MacOSXOSAScript type

2017-09-04 Thread Michael Lazar

New submission from Michael Lazar:

Hello,

I have found that [1] is an open issue, but I have discovered what appears to 
be a completely separate bug than the one described in that ticket. The issue 
is that there is no way to specify a MacOSXOSAScript browser using the BROWSER 
variable. The _synthesize() command fails at the "if not shutil.which(cmd)" 
line, because OSAScript browsers are not commands in the system path. As a 
result, the value specified by BROWSER will get re-mapped to a GenericBrowser 
type, which is useless for most people on macOS.

Here's an example:

$ BROWSER=firefox python3
Python 3.6.1 (default, Apr  4 2017, 09:36:47)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import webbrowser
>>> for name in webbrowser._tryorder:
... print('%s: %s' % (name, webbrowser._browsers[name.lower()]))
...
firefox: [None, ]
MacOSX: [None, ]
chrome: [None, ]
firefox: [None, ]
safari: [None, ]
links: [None, ]
elinks: [None, ]
lynx: [None, ]
w3m: [None, ]

Note that on macOS, firefox is defined in the webbrowser module as

register("firefox", None, MacOSXOSAScript('firefox'), -1)


[1] http://bugs.python.org/issue24955

--
components: Library (Lib)
messages: 301294
nosy: michael-lazar
priority: normal
severity: normal
status: open
title: webbrowser BROWSER with MacOSXOSAScript type
type: behavior
versions: Python 2.7, 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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread INADA Naoki

INADA Naoki added the comment:

> Hm, indeed, but I see that module 'abc' is in 'sys.modules', probably it is 
> then only used by 'collections.abc'/'_collections_abc'. This means that the 
> influence of 'ABCMeta' on interpreter start-up time will be smaller than I 
> thought. But still start-up times for projects that actively use ABCs will be 
> influenced by 'ABCMeta'.

Since os.environ uses _collections_abc.MutableMapping, importing 
_collections_abc is not avoidable while startup.

`io` module uses ABC and it's used for sys.std(io|err|in).  It's not avoidable 
too.

And as you know, typing module will be very common rapidly :)
Even if it doesn't affect "python_startup" microbench, it's important.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2017-09-04 Thread Glenn Linderman

Glenn Linderman added the comment:

I would dearly love to discard my private copies of argparse subclasses to 
implement this that I have been using for the last 5 years. Please, some other 
committer, concur here!

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-04 Thread INADA Naoki

INADA Naoki added the comment:

FYI, my approach is not original, but copied from PyPy.

https://bitbucket.org/pypy/pypy/src/3e52029e9a5a677f7de62ef49f36090465cfbf4c/rpython/rtyper/lltypesystem/rordereddict.py?at=default=file-view-default#rordereddict.py-1437:1551

--

___
Python tracker 

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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread Guido van Rossum

Guido van Rossum added the comment:

I've heard many anecdotal complaints about the lack of speed of ABCs. Even if 
it doesn't affect core Python startup, it does affect startup of apps, and if 
people are afraid to use them because of this, it's reasonable to try to do 
something about it.

--

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nathaniel Smith

Nathaniel Smith added the comment:

In bpo-30703 Antoine fixed signal handling so it doesn't use Py_AddPendingCall 
anymore. At this point the only time the interpreter itself uses 
Py_AddPendingCall is when there's an error writing to the signal_fd, which 
should never happen in normal usage.

If there are third-party libraries making heavy use of Py_AddPendingCall then 
it could be an issue, but any such libraries should already be making sure they 
never have more than one Py_AddPendingCall pending at a time, because you 
already have to assume that the processing might be arbitrarily delayed.

--

___
Python tracker 

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



[issue31333] Implement ABCMeta in C

2017-09-04 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue31342] test.bisect module causes tests to fail

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Can you put the whole traceback? I'm unable to reproduce the issue. Which 
datetime test uses biesct?

--

___
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-09-04 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 759e30ec47048cb9835c62aaeac48748c8151390 by Victor Stinner in 
branch 'master':
bpo-31170: Update libexpat from 2.2.3 to 2.2.4 (#3315)
https://github.com/python/cpython/commit/759e30ec47048cb9835c62aaeac48748c8151390


--

___
Python tracker 

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



[issue28411] Eliminate PyInterpreterState.modules.

2017-09-04 Thread Eric Snow

Changes by Eric Snow :


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



[issue28411] Eliminate PyInterpreterState.modules.

2017-09-04 Thread Eric Snow

Eric Snow added the comment:


New changeset 86b7afdfeee77993fe896a2aa13b3f4f95973f16 by Eric Snow in branch 
'master':
bpo-28411: Remove "modules" field from Py_InterpreterState. (#1638)
https://github.com/python/cpython/commit/86b7afdfeee77993fe896a2aa13b3f4f95973f16


--

___
Python tracker 

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



[issue16565] Increase Py_AddPendingCall array size

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
versions: +Python 3.7 -Python 2.7, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I do wonder if this is going to raise the urgency of 
https://bugs.python.org/issue16565 (Increase Py_AddPendingCall array size) or 
other refactoring of how pending calls are tracked.

--

___
Python tracker 

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



[issue31341] remove IRIX support code

2017-09-04 Thread Benjamin Peterson

Benjamin Peterson added the comment:


New changeset 069306312addf87252e2dbf250fc7632fc8b7da3 by Benjamin Peterson in 
branch 'master':
remove IRIX support (closes bpo-31341) (#3310)
https://github.com/python/cpython/commit/069306312addf87252e2dbf250fc7632fc8b7da3


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



[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +3351

___
Python tracker 

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



[issue31347] possible undefined behavior in _PyObject_FastCall_Prepend

2017-09-04 Thread Benjamin Peterson

New submission from Benjamin Peterson:

As seen by ubsan:
../cpython/Objects/call.c:858:9: runtime error: null pointer passed as argument 
2, which is declared to never be null

--
messages: 301283
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: possible undefined behavior in _PyObject_FastCall_Prepend
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



[issue31346] Prefer PROTOCOL_TLS_CLIENT/SERVER

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3349

___
Python tracker 

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3350

___
Python tracker 

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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3348

___
Python tracker 

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



[issue31346] Prefer PROTOCOL_TLS_CLIENT/SERVER

2017-09-04 Thread Christian Heimes

New submission from Christian Heimes:

Since Python 3.6 the ssl module has three new protocols:


* PROTOCOL_TLS is the new, preferred, and less confusing name of 
PROTOCOL_SSLv23. It performs auto-negotiation of the best TLS/SSL protocol 
supported by client and server.
* PROTOCOL_TLS_CLIENT is a client-only variant of PROTOCOL_TLS. The protocol 
also enables check_hostname and CERT_REQUIRED.
* PROTOCOL_TLS_SERVER is server side-only variant. It leaves check_hostname 
disabled and has CERT_NONE (no client cert validation).

Tests and code should prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER 
whenever possible.

--
assignee: christian.heimes
components: SSL
messages: 301282
nosy: christian.heimes
priority: normal
severity: normal
stage: patch review
status: open
title: Prefer PROTOCOL_TLS_CLIENT/SERVER
type: enhancement
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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 72ed233167b10d3a488d30a8ec3a17e412a7dd69 by Christian Heimes in 
branch '2.7':
[2.7] bpo-30622: Change NPN detection: (GH-2079) (#3316)
https://github.com/python/cpython/commit/72ed233167b10d3a488d30a8ec3a17e412a7dd69


--

___
Python tracker 

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



[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-04 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The help() for collections.OrderedDict.popitem is not showing the default value 
of last=True.

--- Prior versions are unhelpful --
~/npython $ python3.6
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> help(OrderedDict.popitem)
Help on method_descriptor:

popitem(...)
od.popitem() -> (k, v), return and remove a (key, value) pair.
Pairs are returned in LIFO order if last is true or FIFO order if false.


--- Current version is helpful 
$ ./python.exe
Python 3.7.0a0 (heads/master-dirty:b2d096bd2a, Sep  4 2017, 14:50:05)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import OrderedDict
>>> help(OrderedDict.popitem)
Help on method_descriptor:

popitem(self, /, last=True)
Remove and return a (key, value) pair from the dictionary.

Pairs are returned in LIFO order if last is true or FIFO order if false.

--
messages: 301280
nosy: eric.snow, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Backport docstring improvements to the C version of OrderedDict
type: enhancement
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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-09-04 Thread Zachary Ware

Zachary Ware added the comment:


New changeset 986b7ffc650919b3022ccaa458a843bb8a95d2bd by Zachary Ware in 
branch '2.7':
[2.7] bpo-30450: Pull Windows dependencies from GitHub rather than SVN 
(GH-1783) (GH-3306)
https://github.com/python/cpython/commit/986b7ffc650919b3022ccaa458a843bb8a95d2bd


--

___
Python tracker 

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



[issue30502] Fix buffer handling of OBJ_obj2txt

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3347

___
Python tracker 

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



Re: Case-insensitive string equality

2017-09-04 Thread Rick Johnson
Steven D'Aprano wrote:
[...]
> (1) Add a new string method, which performs a case-
> insensitive equality test. Here is a potential
> implementation, written in pure Python:
> 
> def equal(self, other):
> if self is other:
> return True
> if not isinstance(other, str):
> raise TypeError
> if len(self) != len(other):
> return False
> casefold = str.casefold
> for a, b in zip(self, other):
> if casefold(a) != casefold(b):
> return False
> return True
> 
> Alternatively: how about a === triple-equals operator to do
> the same thing?

A good idea. But wouldn't that specific usage be
inconsistent (even backwards) with the semantics of "===" as
defined in most languages that use "==="?

For me -- and this comment will be going beyond the scope of
strings, and possibly, beyond the scope of this thread -- i
feel that python is missing a pair of equality testing
devices (sugared or not; but preferably sugared), that
define a universal means by which all types can be tested
with either "superficial equality" (aka: ==) or "deep
equality" (aka: ===).

However, such a design (whist quite intuitive) would break
equality testing as it exists today in Python. For instance,
it would mean that:


(1) Superficial Equality

>>> "abc" == "abc"
True
>>> "abc" == "ABC" 
True
 
(2) Deep Equality
 
 >>> "abc" === "abc"
 True
 >>> "abc" === "ABC"
 False
 
And i don't think even GvR's time machine will be much
help here. :-(

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, if you look at the comments in the draft test case, we realised there 
are three things we currently need to protect:

1. POP_BLOCK -> WITH_CLEANUP_START (synchronous CM)
2. POP_BLOCK -> GET_AWAITABLE (asynchronous CM)
3. GET_AWAITABLE -> YIELD_FROM (asynchronous CM)

Now that I have a test case, I'm going to start looking at defining a new 
DEFER_PENDING_UNTIL opcode that skips pending call processing (and hence 
signals) until that particular opcode offset is reached.

--

___
Python tracker 

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



[issue30502] Fix buffer handling of OBJ_obj2txt

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3346

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nathaniel Smith

Nathaniel Smith added the comment:

This would still provide value even if you have to do a GET_AWAITABLE in the 
protected region: the most common case is that __aenter__ is a coroutine 
function, which means that its __await__ is implemented in C and already 
protected against interrupts.

Also, to make this fully useful we need some way to protect arbitrary callables 
against interrupts anyway (to handle the case where the signal arrives during 
the actual __enter__ or __exit__ body), so saying that we also need to be able 
to protect __await__ isn't a big deal.

--

___
Python tracker 

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



[issue30502] Fix buffer handling of OBJ_obj2txt

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset e503ca52889bf66ac502702569e726caa7970299 by Christian Heimes 
(Serhiy Storchaka) in branch 'master':
bpo-30502: Fix handling of long oids in ssl. (#2909)
https://github.com/python/cpython/commit/e503ca52889bf66ac502702569e726caa7970299


--

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2017-09-04 Thread R. David Murray

R. David Murray added the comment:

I've turned intermixed.patch into a PR.  I tweaked the documentation so that it 
does not refer to the details of the implementation.  I tweaked the 
implementation to have the 'try' start before the code that modifies the state, 
and did the line wrapping to <80 columns.

I have one concern about this patch: parse_intermixed_args doesn't support all 
of the argparse features.  It feels to me like it is worthwhile to add anyway, 
and maybe someone will figure out how to support more features later.  But I'd 
like at least one other committer to concur :)

Given concurrence I'll add news and what's new entries.

paul.j3: I'm trying to review argparse patches during this core sprint week, so 
if you have anything in particular you want me to focus on, please let me know.

--
stage:  -> patch review
type: behavior -> enhancement
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue14191] argparse doesn't allow optionals within positionals

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
pull_requests: +3345

___
Python tracker 

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



[issue31343] Include major(), minor(), makedev() from sysmacros

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3344

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan

Changes by Nick Coghlan :


--
dependencies: +f_trace_opcodes frame attribute to switch to per-opcode tracing

___
Python tracker 

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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Nick Coghlan

Nick Coghlan added the comment:

https://github.com/ncoghlan/cpython/pull/2/files provides a test case that 
reliably reproduces the problem for both synchronous and asynchronous context 
managers.

It's inspired by Nathaniel's proposal above, but relies on a modified version 
of sys.settrace that runs the trace function after every opcode, not just every 
time the line number changes or we jump backwards in the bytecode.

Issue 31344 is a separate issue to add that underlying capability so we can 
write this test case.

--

___
Python tracker 

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



[issue31344] f_trace_opcodes frame attribute to switch to per-opcode tracing

2017-09-04 Thread Nick Coghlan

New submission from Nick Coghlan:

In order to test issue 29988 reliably, we want the ability to run trace hooks 
for every opcode in a frame, rather than for every line.

The simplest API we've been able to come up with for that is a 
"f_trace_opcodes" attribute on the frame which we set from the trace hook the 
first time that it runs.

--
messages: 301273
nosy: gregory.p.smith, ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: f_trace_opcodes frame attribute to switch to per-opcode tracing
type: enhancement
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



[issue31343] Include major(), minor(), makedev() from sysmacros

2017-09-04 Thread Christian Heimes

New submission from Christian Heimes:

On Fedora 26, GCC is emitting warnings because we are using minor(), major() 
and makedev() 
from sys/types.h. The macros should be included from sys/sysmacros.h instead:

./Modules/posixmodule.c: In function ‘os_major_impl’:
./Modules/posixmodule.c:8758:13: warning: In the GNU C Library, "major" is 
defined
 by . For historical compatibility, it is
 currently defined by  as well, but we plan to
 remove this soon. To use "major", include 
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including .
 return major(device);
 ^  



 
./Modules/posixmodule.c: In function ‘os_minor_impl’:
./Modules/posixmodule.c:8775:13: warning: In the GNU C Library, "minor" is 
defined
 by . For historical compatibility, it is
 currently defined by  as well, but we plan to
 remove this soon. To use "minor", include 
 directly. If you did not intend to use a system-defined macro
 "minor", you should undefine it after including .
 return minor(device);
 ^  



 
./Modules/posixmodule.c: In function ‘os_makedev_impl’:
./Modules/posixmodule.c:8793:13: warning: In the GNU C Library, "makedev" is 
defined
 by . For historical compatibility, it is
 currently defined by  as well, but we plan to
 remove this soon. To use "makedev", include 
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including .
 return makedev(major, minor);
 ^

--
components: Extension Modules
messages: 301272
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: Include major(), minor(), makedev() from sysmacros
type: compile error
versions: Python 2.7, 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



[issue31342] test.bisect module causes tests to fail

2017-09-04 Thread Neil Schemenauer

New submission from Neil Schemenauer:

After a lot of head scratching, I have discovered why tests are failing for me. 
 E.g. "./python Lib/test/test_datetime.py" results in

AttributeError: module 'bisect' has no attribute 'bisect_right'

Running tests this way causes test/bisect to be imported rather than the std 
library bisect module.  I'm not sure of the correct fix, perhaps rename 
test.bisect?

Patch that added it: bpo-29512: Add test.bisect, bisect failing tests

--
assignee: haypo
messages: 301271
nosy: haypo, nascheme
priority: normal
severity: normal
stage: needs patch
status: open
title: test.bisect module causes tests to fail
type: behavior

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3343

___
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-09-04 Thread STINNER Victor

STINNER Victor added the comment:

I produced attached PR 3315 using attached cpython_rebuild_expat_dir.sh + 
revert Modules/expat/expat_external.h change to keep #include "pyexpatns.h".

--

___
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-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3342

___
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-09-04 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file47118/cpython_rebuild_expat_dir.sh

___
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-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
title: expat: utf8_toUtf8 cannot properly handle exhausting buffer -> Update to 
expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3341

___
Python tracker 

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



[issue30947] Update embeded copy of libexpat from 2.2.1 to 2.2.3

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Expat 2.2.3 has a bug: see bpo-31170 :-(

--

___
Python tracker 

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



[issue30622] Fix NPN guard for OpenSSL 1.1

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset b2d096bd2a5ff86e53c25d00ee5fa097b36bf1d8 by Christian Heimes 
(Melvyn Sopacua) in branch 'master':
bpo-30622: Change NPN detection: (#2079)
https://github.com/python/cpython/commit/b2d096bd2a5ff86e53c25d00ee5fa097b36bf1d8


--

___
Python tracker 

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



Re: wrote a commodore-64 emulator using just Python

2017-09-04 Thread Irmen de Jong
On 08/13/2017 03:50 PM, Irmen de Jong wrote:
> Hi,
> 
> As another experiment with using just tkinter for graphics, this time I 
> created a
> Commodore-64 emulator. You can find it here https://github.com/irmen/pyc64

[...]

> There's also https://github.com/mnaberez/py65 so... possibilities?

Well, I went ahead and integrated that with my emulator. With just a
slight modification (that is now merged into the py65 library) I could
hook it up to the bytearray that my emulator uses to simulate the C64's
RAM. And letting the 'SYS' basic command kick of the 6502 simulator,
rather than doing nothing, it suddenly was able to actually run real
(although simple) Commodore-64 programs. Speed seems to be around 0.5x
real-time on my machine.

The py65 library also already provides a simple machine code monitor
(assembler/disassembler) that you can use to inspect or write the
machine code in the C64's memory. With some effort it should be possible
to run it in the emulated screen, but for now, interaction with it is
done on the console prompt.

It was a great deal of fun integrating this into my project and I found
it quite spectacular to see some existing Commodore-64 programs actually
running unaltered.  Even when they're doing nothing more than changing
the screen colors and unpacking an image. At half speed. But still :-)


Irmen
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24896] It is undocumented that re.UNICODE and re.LOCALE affect re.IGNORECASE

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +3340

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset 973b901212bd84d279904bab6654709f4ec32470 by Barry Warsaw in 
branch 'master':
What's New for bpo-1198569 (#3303)
https://github.com/python/cpython/commit/973b901212bd84d279904bab6654709f4ec32470


--

___
Python tracker 

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



[issue31340] Use VS 2017 compiler for build

2017-09-04 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +3339

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-09-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:


New changeset 1dba3789e335f06e3b01cdc84070f2e828c9b861 by Gregory P. Smith in 
branch '3.6':
bpo-22536 [3.6] Set filename in FileNotFoundError  (#3305)
https://github.com/python/cpython/commit/1dba3789e335f06e3b01cdc84070f2e828c9b861


--

___
Python tracker 

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



[issue31341] remove IRIX support code

2017-09-04 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +3338

___
Python tracker 

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



[issue31326] concurrent.futures: ProcessPoolExecutor.shutdown(wait=True) should wait for the call queue thread

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3337

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Christian Heimes: "I'm ok to replace the asctime with our own implementation 
that can handle year >. Please include range checks for year, wday and 
month, though."

Done.

By the way, I discussed with Alex Gaynor on #python-dev to define the severity 
of the bug. It was said that it's a medium security issue, it's a denial of 
service which can be triggered through user data.

--

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Ok, there are 3 choices:

* Do nothing: musl crash on year > , glibc supports year > , behaviour 
is likely undefined on other libc
* PR 3296: Reject year >  on all platforms: can be seen as a Python 2.7 
regression when running with glibc
* PR 3293: Reimplement time.asctime() and time.ctime() to not depend on the 
libc anymore, as done in Python 3

My favorite option is now "PR 3293: Reimplement time.asctime()". Yeah, there is 
a risk of getting a behaviour change on funky libc with funky values, but IMHO 
it's worth it.

--

___
Python tracker 

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



[issue22650] set up and use VM for net access in the test suite

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

FYI, sha256.tbs-internet.com is no longer used in tests.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 57d963b0b559078ca419811d0d25fea27d42f30c by Christian Heimes in 
branch '2.7':
[2.7] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3301)
https://github.com/python/cpython/commit/57d963b0b559078ca419811d0d25fea27d42f30c


--

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

I've removed the sha256.tbs-internet.com from 2.7, 3.6, and master. 3.5 and 
previous versions are in security fix-only mode.

--

___
Python tracker 

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



[issue31341] remove IRIX support code

2017-09-04 Thread Benjamin Peterson

New submission from Benjamin Peterson:

IRIX hasn't been officially supported, since 2013. Per PEP 11, we're going to 
remove the code in Python 3.7.

--
components: Build
messages: 301260
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: remove IRIX support code
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



[issue31340] Use VS 2017 compiler for build

2017-09-04 Thread Jeremy Kloth

Changes by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-09-04 Thread Zachary Ware

Changes by Zachary Ware :


--
pull_requests: +3336

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

I'm ok to replace the asctime with our own implementation that can handle year 
>. Please include range checks for year, wday and month, though.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue22536] subprocess should include filename in FileNotFoundError exception

2017-09-04 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
pull_requests: +3335

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 4bc8ef0eeed191f9398a90e748f732cfba67546d by Christian Heimes in 
branch '3.6':
[3.6] bpo-25674: remove sha256.tbs-internet.com ssl test (GH-3297) (#3300)
https://github.com/python/cpython/commit/4bc8ef0eeed191f9398a90e748f732cfba67546d


--

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
pull_requests: +3334

___
Python tracker 

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



[issue31339] [2.7] time.asctime() crash with year > 9999 using musl C library

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Oh, I forgot to describe the bug.

asctime() (and ctime()?) do crash on year >  with musl. musl uses an 
hardcoded buffer of 26 bytes:
http://git.musl-libc.org/cgit/musl/tree/src/time/__asctime.c

musl developers consider that the caller must reject year larger than :


/* ISO C requires us to use the above format string,
 * even if it will not fit in the buffer. Thus asctime_r
 * is _supposed_ to crash if the fields in tm are too large.
 * We follow this behavior and crash "gracefully" to warn
 * application developers that they may not be so lucky
 * on other implementations (e.g. stack smashing..).
 */
a_crash();


I disagree. asctime() must either return a longer string, or return an error. 
But not crash.

--
title: [2.7] time.asctime() buffer overflow for year >  using mucl (C 
library) -> [2.7] time.asctime() crash with year >  using musl C library

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +

___
Python tracker 

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



[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset ba4279683f8eb8f59be10d12547ea89480614388 by Barry Warsaw in 
branch 'master':
bpo-1198569: Allow string.Template braced pattern to be different (#3288)
https://github.com/python/cpython/commit/ba4279683f8eb8f59be10d12547ea89480614388


--

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

To be honest, I'm not sure that the issue must be categorized as a security 
vulnerability, nor that it should be fixed. I opened an issue to discuss if 
it's worth it.

To be clear: Python 3 is safe (at least since Python 3.3, I didn't check older 
Python 3.x released).

--

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3332

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 002d64039b60c1a9289f981fe73a5cf91d082136 by Christian Heimes in 
branch 'master':
bpo-25674: remove sha256.tbs-internet.com ssl test (#3297)
https://github.com/python/cpython/commit/002d64039b60c1a9289f981fe73a5cf91d082136


--

___
Python tracker 

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



[issue31340] Use VS 2017 compiler for build

2017-09-04 Thread Steve Dower

New submission from Steve Dower:

The newer MSVC (v141) is available and reliable, and theoretically binary 
compatible with v140. This means we can update both Python 3.6 and 3.7 to build 
with it.

Testing for this should include:
* pythoncore with v141 and remainder with v140
* Python with v141 and wheels with v140

--
assignee: steve.dower
components: Build, Windows
messages: 301253
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Use VS 2017 compiler for build
type: enhancement
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



Re: Please improve these comprehensions (was meaning of [ ])

2017-09-04 Thread Ben Bacarisse
Rustom Mody  writes:

> Here is some code I (tried) to write in class the other day
>
> The basic problem is of generating combinations

> Now thats neat as far as it goes but combinations are fundamentally sets
> not lists
>
> So I thought python would do a better job
> I tried translating it to python and sets but it turned out more annoying than
> helpful
> Can someone improve it??
>
> The straightforward translation of the above
> Which is ok so far
>
>
> def c(n,r):
> if r == 0:
> return [[]]
> elif len(n) == 0:
> return []
> else:
> return [[n[0]] + l for l in c(n[1:],r-1)] + c(n[1:],r)
>
>
> Now to go from returning list of lists to set of sets:

def cs(n, r):
if r == 0:
return [set()]
elif len(n) == 0:
return []
else:
return [set([n[0]]) | l for l in cs(n[1:], r-1)] + cs(n[1:], r)

?

It's not so neat if you also want n to be a set rather than a list
because the set equivalents of n[0] and n[1:] are a but more complex but
it's not that bad:

def css(n,r):
if r == 0:
return [set()]
elif len(n) == 0:
return []
else:
rest = n.copy()
e = rest.pop()
return [set([e]) | l for l in css(rest, r-1)] + css(rest, r)


-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31338] Use abort() for code we never expect to hit

2017-09-04 Thread Stefan Krah

Stefan Krah added the comment:

Regarding lint warnings, I may have confused abort() with exit().

Lintian has the shlib-calls-exit tag, somehow I thought there was
a similar one for abort(), but I can't find it now.

--

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3331

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

STINNER Victor added the comment:

Antoine: "What if this produces a different result and breaks some code on some 
platforms?"

No idea. It would call that a regression.

I wrote another much simpler change: 
https://github.com/python/cpython/pull/3296 raises a ValueError for year larger 
than . It doesn't touch time.ctime() (yet?).

--

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3330

___
Python tracker 

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



[issue25674] test_ssl (test_algorithms) failures on bolen-ubuntu slaves: sha256.tbs-internet.com unknown host

2017-09-04 Thread Christian Heimes

Christian Heimes added the comment:

The sha256.tbs-internet.com has been down for a while and the DNS record is no 
longer available. Alex and I agreed that the test no longer makes sense, too. 
RSA certs with SHA-256 signatures are de-facto standard and supported by 
OpenSSL for a long time. We test SHA-256 certs with several other tests that 
talk to remote servers.

I'm going to remove the test and sha256 cert.

--
versions:  -Python 3.5

___
Python tracker 

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



[issue30423] [asyncio] orphan future close loop and cause "RuntimeError: Event loop stopped before Future completed."

2017-09-04 Thread Jimmy Lai

Changes by Jimmy Lai :


--
pull_requests: +3329

___
Python tracker 

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



Re: A question on modification of a list via a function invocation

2017-09-04 Thread Chris Angelico
On Tue, Sep 5, 2017 at 1:36 AM, Dennis Lee Bieber  wrote:
> On Tue, 05 Sep 2017 00:20:25 +1000, Steve D'Aprano
>  declaimed the following:
>
>>(Of course this is silly. As all physicists know, there are no people, animals
>>or cars in the world, there are only quarks and electrons.)
>
> Quarks and Leptons and Bosons (Oh, my!)
>
>
> {I tend to forget the bosons}

Once we get quantum computing as a regular and normal thing, we'll
have to redefine duck typing.

If it quarks like a duck...

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue1198569] string.Template not flexible enough to subclass (regexes)

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Never mind; I crafted a decent test for the PR.

--

___
Python tracker 

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



Re: A question on modification of a list via a function invocation

2017-09-04 Thread Antoon Pardon
On 04-09-17 16:30, Steve D'Aprano wrote:
> On Tue, 5 Sep 2017 12:09 am, Antoon Pardon wrote:
> 
>> Op 04-09-17 om 15:26 schreef Steve D'Aprano:
>>> On Mon, 4 Sep 2017 08:52 pm, Antoon Pardon wrote:
>>>
 Op 04-09-17 om 12:22 schreef Stefan Ram:
> Rustom Mody  writes:
>>> Stefan Ram wrote:
 JavaScript and Python do not have references as values
>>> Yes, they do. The difference is that they don't have any
> ...
>> Its because reference (or pointer or ?) is central to python's semantics
>   If they are so central, then it should be easy to show
>   quotes from The Python Language Reference to support that
>   claim.
 The section about assignment talks about reference counts.
>>> Does that mean that IronPython and Jython aren't implementations of Python?
>>> They have no reference counts.
>>
>> I am not a lawyer
> 
> But you are a Python programmer.
> 
> You should be aware that reference counts are a property of the CPython
> implementation, not a language feature. Jython and IronPython, at the very
> least, are valid, conforming implementations of Python the language which have
> no reference counts. Therefore reference counts cannot be central to Python's
> semantics, since there are Python interpreters that don't use them.

It is not my responsibility that reference counts are mentioned in the
language referece. In how far mentioning reference counts in the language
reference makes IronPython or Jython not python is IMO food for lawyers.

I also didn't claim reference counts are essential to python's semantics.

-- 
Antoon Pardon
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31172] Py_Main() is totally broken on Visual Studio 2017

2017-09-04 Thread Steve Dower

Changes by Steve Dower :


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



[issue29988] (async) with blocks and try/finally are not as KeyboardInterrupt-safe as one might like

2017-09-04 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Yury's in the room here and pointed out how Nick and I are wrong. :)  [yay 
sprints!]

async def __aexit__(self, *e):
  spamity_spam
  return Awaitable

If we resolve the GET_AWAITABLE at BEFORE_ASYNC_WITH time, the spamity_spam 
within __aexit__ is executed before the with block instead of after as happens 
today.  :/

See also 
https://www.python.org/dev/peps/pep-0492/#asynchronous-context-managers-and-async-with

Nick is actively working on making a test.

--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread Antoine Pitrou

Antoine Pitrou added the comment:

What if this produces a different result and breaks some code on some platforms?

--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +3328

___
Python tracker 

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



[issue31339] [2.7] time.asctime() buffer overflow for year > 9999 using mucl (C library)

2017-09-04 Thread STINNER Victor

New submission from STINNER Victor:

Attached PR backports (and adapts) the _asctime() function from the master 
branch to Python 2.7, so time.asctime() and time.ctime() don't call asctime() 
and ctime() functions of the external C library, but use portable and safe C 
code.

--
components: Library (Lib)
messages: 301246
nosy: haypo
priority: normal
severity: normal
status: open
title: [2.7] time.asctime() buffer overflow for year >  using mucl (C 
library)
type: security
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



[issue31337] Small opportunity for NULL dereference in compile.c

2017-09-04 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

See bpo-31338 for adopting the abort() idiom.

--

___
Python tracker 

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



[issue31338] Use abort() for code we never expect to hit

2017-09-04 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

Over in bpo-31337 the observation was made that we often use the following 
pattern in situations we never expect to hit:

assert(0);
return NULL;

but this isn't strictly optimal.  First, the asserts can be compiled away.  
Second, it's possible that our assumptions about a particular condition are 
incorrect.  Third, the intent of non-reachability isn't as clear as it could be.

As suggested in http://bugs.python.org/issue31337#msg301229 it would be better 
to use

abort() /* NOT REACHED */

instead (although @skrah says "The only drawback is that in the case of 
libraries, sometimes distribution package lint tools complain." so it would be 
useful to understand that in more detail.

@serhiy.storchaka says "I have counted 48 occurrences of assert(0), 11 assert(0 
&& "message") and 2 assert(!"message"). If fix one occurrence, why not fix all 
others?"  We should!  This issue tracks that.

--
assignee: barry
components: Interpreter Core
messages: 301244
nosy: barry, serhiy.storchaka, skrah
priority: normal
severity: normal
status: open
title: Use abort() for code we never expect to hit
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



[issue15427] Describe use of args parameter of argparse.ArgumentParser.parse_args

2017-09-04 Thread R. David Murray

Changes by R. David Murray :


--
versions: +Python 3.6, Python 3.7 -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



  1   2   >