[issue30135] default value of argument seems to be overwritten

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See "Why are default values shared between objects?" in Python FAQ 
(https://docs.python.org/3/faq/programming.html#id13).

--
nosy: +serhiy.storchaka
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



[issue29802] A possible null-pointer dereference in struct.s_unpack_internal()

2017-04-21 Thread Serhiy Storchaka

Changes 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



[issue29802] A possible null-pointer dereference in struct.s_unpack_internal()

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 7bfd740e3d484e6fdf3f5c2d4640450957f9d89c by Serhiy Storchaka in 
branch 'master':
Remove unneeded Misc/NEWS entry for bpo-29802. (#1251)
https://github.com/python/cpython/commit/7bfd740e3d484e6fdf3f5c2d4640450957f9d89c


--

___
Python tracker 

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



[issue18576] Document test.support.script_helper

2017-04-21 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +1367

___
Python tracker 

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



[issue29960] _random.Random state corrupted on exception

2017-04-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
stage: needs patch -> backport needed
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



[issue29960] _random.Random state corrupted on exception

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 9616a82e7802241a4b74cf7ae38d43c37bf66e48 by Serhiy Storchaka 
(bladebryan) in branch 'master':
bpo-29960 _random.Random corrupted on exception in setstate(). (#1019)
https://github.com/python/cpython/commit/9616a82e7802241a4b74cf7ae38d43c37bf66e48


--

___
Python tracker 

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



[issue29802] A possible null-pointer dereference in struct.s_unpack_internal()

2017-04-21 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1366

___
Python tracker 

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



[issue30113] Allow helper functions to wrap sys.setprofile

2017-04-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks Louie.

I've adjusted the issue title, as I think the core RFE is that we'd like the 
following helper function to work exactly the same way as calling 
sys.setprofile directly:

def setprofile_helper(f):
sys.setprofile(f)

The following utility function can be used to demonstrate the current 
discrepancy:

def profile_call(setprofile, call):
pr = profile.Profile()
setprofile(pr.dispatcher)
try:
call()
finally:
setprofile(None)
return pr

Specifically:

```
>>> profile_call(sys.setprofile, lambda:print("Profiled!"))
Profiled!

>>> profile_call(setprofile_helper, lambda:print("Profiled!"))
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in profile_call
  File "", line 2, in setprofile_helper
  File "/usr/lib64/python3.5/profile.py", line 209, in trace_dispatch_i
if self.dispatch[event](self, frame, t):
  File "/usr/lib64/python3.5/profile.py", line 293, in trace_dispatch_return
assert frame is self.cur[-2].f_back, ("Bad return", self.cur[-3])
AssertionError: ('Bad return', ('profile', 0, 'profiler'))
```

If we can figure out a way to do it reliably, the most desirable approach would 
be to make helper functions like the above "just work", perhaps by remembering 
the stack frame where the profiler was *defined*, and using that as the 
reference point to construct the synthetic stack the first time a trace 
dispatch occurs.

If that transparent-to-the-user approach doesn't appear to be feasible, an 
alternative would be to offer a new private method on Profile objects to adjust 
their synthetic stack by one level, as if `sys.setprofile` had been called 
*before* the call into the helper function.

That is, a profiler-aware alternative to the helper function above might look 
like:

def profile_helper(pr):
sys.setprofile(pr.dispatcher)
pr._adjust_stack()

and that's then the approach that the `__enter__` method would use to implement 
context management support.

The advantage of the latter private option is that it wouldn't need to support 
arbitrary helper functions, just the specific implementation of `__enter__` for 
issue 9285.

In either case, I *don't* think changing the assertion is the right answer - 
instead, I think the internal profiler state needs to be adjusted so the 
assertion passes without modification.

--
title: Add profile test case for trace_dispatch_return assertion -> Allow 
helper functions to wrap sys.setprofile

___
Python tracker 

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



[issue29782] Use __builtin_clzl for bits_in_digit if available

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

But even 15% speed up in particular microbenchmarks looks too small to me for 
such complex change.

--

___
Python tracker 

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



[issue29782] Use __builtin_clzl for bits_in_digit if available

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In some microbenchmarks this can give up to 15%.

$ ./python.patched -m perf timeit -q --compare-to=./python.default -s "a = 
list(map(float, range(1)))" "12345 in a"
Mean +- std dev: [python.default] 1.28 ms +- 0.11 ms -> [python.patched] 1.12 
ms +- 0.07 ms: 1.15x faster (-13%)

--

___
Python tracker 

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



[issue30136] Add test.support.script_helper to documentation

2017-04-21 Thread Berker Peksag

Berker Peksag added the comment:

This is a duplicate of issue 18576.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Document test.support.script_helper

___
Python tracker 

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



[issue30136] Add test.support.script_helper to documentation

2017-04-21 Thread Louie Lu

New submission from Louie Lu:

`test.support.script_helper` didn't document at `test` document.

It should be add on.

--
assignee: docs@python
components: Documentation
messages: 292103
nosy: docs@python, louielu
priority: normal
severity: normal
status: open
title: Add test.support.script_helper to documentation
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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

re.escape() shouldn't be used for a replacement template. You need just double 
backslashes when escape a literal string for a replacement template: 
s.replace('\\', ''). This should be documented if still is not documented.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30134] BytesWarning is missing from the documents

2017-04-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

BytesWarning should be added in the table in warnings.rst (and check that all 
other built-in warning categories are in this table). It is worth to mention 
the -b option.

And I think the docstring of BytesWarning should be corrected. "Unicode" should 
be used rather that "str" since str and bytes is the same in 2.7.

--
nosy: +benjamin.peterson, r.david.murray, serhiy.storchaka
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

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



[issue30135] default value of argument seems to be overwritten

2017-04-21 Thread Klaus Wolf

New submission from Klaus Wolf:

Two function results differ if the parameter is given explictly instead of 
using the given default.

(Enclosed example: A small simple interpreter of Forth language, both scripts 
should give the same result, but the first one (variant1) fails because the 
value from the first pass remains on the stack.)

--
components: Interpreter Core
files: misc_math.7z
messages: 292100
nosy: approximately
priority: normal
severity: normal
status: open
title: default value of argument seems to be overwritten
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file46825/misc_math.7z

___
Python tracker 

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



[issue30134] BytesWarning is missing from the documents

2017-04-21 Thread KINEBUCHI Tomohiko

Changes by KINEBUCHI Tomohiko :


--
pull_requests: +1365

___
Python tracker 

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



[issue30134] BytesWarning is missing from the documents

2017-04-21 Thread KINEBUCHI Tomohiko

New submission from KINEBUCHI Tomohiko:

In Python 2.6, BytesWarning was added, but a description of that warning is 
missing from the document, library/exceptions.rst.

--
assignee: docs@python
components: Documentation
messages: 292099
nosy: cocoatomo, docs@python
priority: normal
severity: normal
status: open
title: BytesWarning is missing from the documents
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



[issue29952] "keys and values" preferred to "keys and elements" for dict constituent

2017-04-21 Thread KINEBUCHI Tomohiko

Changes by KINEBUCHI Tomohiko :


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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

PR has been merged and backported to 3.5 and 3.6. 
Thanks everyone :)

--
resolution:  -> fixed
stage: backport needed -> 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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset a3d8dda7d899bf41ab7eb2c6148459ad276fe295 by Mariatta in branch 
'3.6':
bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future   
(GH-1170) (#1247)
https://github.com/python/cpython/commit/a3d8dda7d899bf41ab7eb2c6148459ad276fe295


--

___
Python tracker 

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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 503d74a60aa9290cf8d174eab95fdfdea1f2b284 by Mariatta in branch 
'3.5':
bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future   
(GH-1170) (#1246)
https://github.com/python/cpython/commit/503d74a60aa9290cf8d174eab95fdfdea1f2b284


--

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread Matthew Barnett

Matthew Barnett added the comment:

The function solution does have a larger overhead than a literal.

Could the template be made more accepting of backslashes without breaking 
anything? (There's also issue29995 "re.escape() escapes too much", which might 
help.)

--

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread R. David Murray

R. David Murray added the comment:

Good point, re.escape is for literal text you want to insert into a matching 
pattern, but the replacement template isn't a matching pattern.  Do we need a 
different escape function?  I guess the function solution is enough?

--

___
Python tracker 

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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1363

___
Python tracker 

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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +1364

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-21 Thread Kubilay Kocak

Changes by Kubilay Kocak :


--
nosy: +koobs

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread Matthew Barnett

Matthew Barnett added the comment:

Yes, the second argument is a replacement template, not a literal.

This issue does point out a different problem, though: re.escape will add 
backslashes that will then be treated as literals in the template, for example:

>>> re.sub(r'a', re.escape('(A)'), 'a')
'\\(A\\)'

re.escape doesn't always help.

The solution here is to pass a replacement function instead:

>>> re.sub(r'a', lambda m: '(A)', 'a')
'(A)'

--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-21 Thread Martin Panter

Martin Panter added the comment:

Last time I proposed removing the automatic rebuilding of checked-in generated 
files, it seemed getting a consensus would not be trivial. Nick seemed strongly 
against changing the status quo: 
.
 He did say it has been too hard to remember how to rebuild generated files in 
the past.

Documenting the quirks of the build system would be good even if we keep the 
automatic regeneration.

--

___
Python tracker 

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



[issue29442] Replace optparse with argparse in setup.py

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

Did someone test the patch? Does Python still bootstrap after a distclean or 
not? If not, I suggest to close the issue, except if Chi Hsuan Yen finf an 
elegant way to fix them :-)

--

___
Python tracker 

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



[issue29782] Use __builtin_clzl for bits_in_digit if available

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

I concur with Antoine and suggest to reject this issue.

--

___
Python tracker 

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



[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

I merged your PR. We are at the begining of the 3.7 cycle. Applications can be 
fixed before 3.7.

In the worst case, we can revert the change.

I like this enhancement, it should help to catch bugs ;-)

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2017-04-21 Thread Skip Montanaro

Skip Montanaro added the comment:

Again, my apologies for the crappy initial bug report. Hopefully this comment 
and the two files I just attached demonstrate what I am getting at.

I just uploaded a stupid little example, partial3.py. Stupid, but still, it 
demonstrates part of how I think docstrings on these partial methods could be 
improved. If you run it (I'm using Python 3.6.1), note that the doc strings for 
the sum method (instance and class), look wrong:

Child.sum doc: None
c.sum doc: partial(func, *args, **keywords) - new function with partial 
application
of the given arguments and keywords.

The file, ft.diff, includes a one-line patch to partialmethod.__get__ which 
corrects the docstring for the instance of the Child class:

Child.sum doc: None
c.sum doc: sum doc

I haven't looked to see where the docstring of Child.sum could be set, but I 
believe it should be fairly straightforward for someone more familiar with this 
code. Also, the patch doesn't improve the output of pydoc:

partial3.Child = class Child(builtins.object)
 |  Methods defined here:
 |  
 |  diff(self, arg1, arg2)
 |  diff doc
 |  
 |  sum = _method(self, arg2)
 |  
 |  --
 |  Data descriptors defined here:
 |  
 |  __dict__
 |  dictionary for instance variables (if defined)
 |  
 |  __weakref__
 |  list of weak references to the object (if defined)

--

___
Python tracker 

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



[issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger

2017-04-21 Thread David Bolen

David Bolen added the comment:

Ok, this should be resolved.  I opted to be a bit more conservative and only 
upgraded to sqlite3 3.8.3.1, which is the oldest version still in use for the 
dmg installer packages (for 2.7).  I restarted the most recent 3.x build and 
while it's not completely done yet, the sqlite tests have passed.

--

___
Python tracker 

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



[issue29867] Add asserts in PyXXX_GET_SIZE macros

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 1a5856bf9295fa73995898d576e0bedf016aee1f by Victor Stinner 
(Serhiy Storchaka) in branch 'master':
bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. 
(#751)
https://github.com/python/cpython/commit/1a5856bf9295fa73995898d576e0bedf016aee1f


--

___
Python tracker 

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



[issue28041] Inconsistent behavior: Get st_nlink from os.stat() and os.scandir()

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

scandir () is designed for effiency, not for portability or correctness. The 
API has deliberate limitations which are well documented, as the one you 
spotted:
https://docs.python.org/dev/library/os.html#os.DirEntry.stat

Your PR would defeat the whole purpose of scandir.

--
nosy: +haypo
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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2017-04-21 Thread Skip Montanaro

Changes by Skip Montanaro :


--
keywords: +patch
Added file: http://bugs.python.org/file46824/ft.diff

___
Python tracker 

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



[issue29059] Windows: Python not using ANSI compatible console

2017-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In #30075, Tithen Firion reports that "subprocess.call('', shell=True)" leaves 
the console in ANSI mode.  In Eryk Sun says that this is likely a bug in 
cmd.exe and gives improved code for putting the console in VT mode, when this 
is possible.  I closed that issue as a duplicate of this.

--
nosy: +terry.reedy
stage:  -> resolved

___
Python tracker 

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2017-04-21 Thread Skip Montanaro

Changes by Skip Montanaro :


Added file: http://bugs.python.org/file46823/partial3.py

___
Python tracker 

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



[issue30075] Printing ANSI Escape Sequences on Windows 10

2017-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This is a (duplicate) enhancement request, not a bug report.  The superseder 
field is for when an issue is closed as a duplicate; I decided that this should 
be.  Further discussion should be on python-ideas.

--
nosy: +terry.reedy
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
type: behavior -> enhancement
versions: +Python 3.7 -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



[issue29903] struct.Struct Addition

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

I dislike this feature. I reject it: Serhiy, Raymond and me dislike it.

I never needed this feature and a correct implementation can be very complex if 
you have to take care of endian, alignement, etc. It's trivial to implement you 
own add using the format attribute if you want the simple implementation 
format1+format2.

--
nosy: +haypo
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



[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:


New changeset a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d by Victor Stinner in 
branch 'master':
bpo-30125: disable faulthandler in ctypes test_SEH (#1237)
https://github.com/python/cpython/commit/a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d


--

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread R. David Murray

R. David Murray added the comment:

I think you are missing a re.escape around text.  Text is otherwise not a valid 
replacement pattern.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue30133] Strings that end with properly escaped backslashes cause error to be thrown in re.search/sub/etc. functions.

2017-04-21 Thread Patrick Foley

New submission from Patrick Foley:

The following code demonstrates:

import re
text = 'ab\\'
exp = re.compile('a')
print(re.sub(exp, text, ''))

If you remove the backslash(es), the code runs fine.

This appears to be specific to the re module and only to strings that end in 
(even properly escaped) backslashes. You could easily receive raw data like 
this from freehand input sources so it would be nice not to have to remove 
trailing backslashes before running a regular expression.

--
components: Regular Expressions
files: sample.py
messages: 292079
nosy: Patrick Foley, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Strings that end with properly escaped backslashes cause error to be 
thrown in re.search/sub/etc. functions.
versions: Python 2.7, Python 3.4
Added file: http://bugs.python.org/file46822/sample.py

___
Python tracker 

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



[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 3a8f8ea2aca46f9ef1e715f2c924357b6719525f by Victor Stinner in 
branch '3.6':
bpo-30125: Fix faulthandler.disable() on Windows (#1243)
https://github.com/python/cpython/commit/3a8f8ea2aca46f9ef1e715f2c924357b6719525f


--

___
Python tracker 

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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset ae5b3260dd459845aad8a30491b76d471577785d by Mariatta (Charles 
Renwick) in branch 'master':
bpo-30098: Clarify that run_coroutine_threadsafe expects asyncio.Future   
(GH-1170)
https://github.com/python/cpython/commit/ae5b3260dd459845aad8a30491b76d471577785d


--
nosy: +Mariatta

___
Python tracker 

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



[issue30098] Verbose TypeError for asyncio.ensure_future

2017-04-21 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
stage:  -> backport needed
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



[issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger

2017-04-21 Thread David Bolen

David Bolen added the comment:

The test appears to pass against a local test build of sqlite3 3.18.0, so I'll 
probably just plan on updating the slave to that later tonight.  Unless anyone 
is interested in figuring out why it fails with 3.6.11 and not 3.18.0 (e.g., 
does the test have a higher minimum version than it currently declares).

--

___
Python tracker 

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



[issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger

2017-04-21 Thread David Bolen

David Bolen added the comment:

No recent changes to the buildbot (I think the last was in September to bump 
the local python used to run the slave/build installer to 2.7).

The default system sqlite (/usr/lib) is 3.0.8.6, so extremely old, but 3.6.11 
is in /usr/local/{lib,include} from early days of setting up the slave, so only 
marginally less old.  As long as the python build process finds that (which it 
appears to) it should be consistent.

I configured and built a local 3.x branch version of python on the slave and 
modified it to dump the version info during module initialization:

> ./python.exe
Python 3.7.0a0 (heads/master:d1ae24e, Apr 21 2017, 15:06:29) 
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
SQLITE_VERSION: 3.6.11
SQLITE_VERSION_NUMBER: 3006011
sqlite3_libversion: 3.6.11

so it appears to be in line.  This local build still fails the test.

Maybe whatever feature is needed for this test is broken with 3.6.11.

One thing I did notice, though I suspect it's not an issue, but the 3.6.11 this 
slave is using seems to fall into the gap in the original bpo-9303 _v2 support 
patch where a _v2 prepare with a plain close (versions >= 3.3.9 and <3.7.14).  
Both plain and _v2 close methods have the same signature, but I wonder if there 
might be an issue mixing and matching?

I don't think anything else has a hard dependency on my /usr/local libraries on 
the slave at this point (the dmg installer builds its own local copies), so I 
could try updating that to a more current sqlite3 if we wanted to see if that 
resolved the issue.

--

___
Python tracker 

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



[issue28909] Adding LTTng-UST tracing support

2017-04-21 Thread Charalampos Stratakis

Charalampos Stratakis added the comment:

Just a small note here for the documentation patch.

yum is deprecated in Fedora, and dnf is now the default package manager, so the 
respective instructions for Fedora should reflect that.

--
nosy: +cstratak

___
Python tracker 

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



[issue29191] liblzma is missing from pcbuild.sln

2017-04-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks everyone :) I merged the backport PR, so I'm closing this issue.

While backporting is still a manual effort, this utility script automates some 
part of it. https://github.com/python/core-workflow/tree/master/cherry_picker

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



[issue29191] liblzma is missing from pcbuild.sln

2017-04-21 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 1ccbe6007e5569ab25170f8ecddd5fbbc2ef36b0 by Mariatta (Steve 
Dower) in branch '3.6':
bpo-29191: Add liblzma.vcxproj to pcbuild.sln and other missing entries 
(GH-1222) (GH-1244)
https://github.com/python/cpython/commit/1ccbe6007e5569ab25170f8ecddd5fbbc2ef36b0


--
nosy: +Mariatta

___
Python tracker 

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



[issue28909] Adding LTTng-UST tracing support

2017-04-21 Thread cburroughs

Changes by cburroughs :


--
nosy: +cburroughs

___
Python tracker 

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



[issue28787] Out of tree --with--dtrace builds fail with a traceback

2017-04-21 Thread cburroughs

Changes by cburroughs :


--
nosy: +cburroughs

___
Python tracker 

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



[issue30122] Added missing archive programs.

2017-04-21 Thread Decorater

Decorater added the comment:

Oh

--
title: Added missing archive programs and close option to Windows docs. -> 
Added missing archive programs.

___
Python tracker 

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



[issue29077] build failure when enabling dtrace on FreeBSD

2017-04-21 Thread cburroughs

Changes by cburroughs :


--
nosy: +cburroughs

___
Python tracker 

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2017-04-21 Thread Skip Montanaro

Skip Montanaro added the comment:

Yeah, sorry about that. I work in an environment where I can't "eject" any
code from my work computer. I've come up with a simple Python3 example, but
it will have to wait until I can recreate it from scratch on my home
computer.

--

___
Python tracker 

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



[issue30130] array.array is not an instance of collections.MutableSequence

2017-04-21 Thread Alexander Gosselin

Alexander Gosselin added the comment:

Thanks for taking a look at this. I think array is little used, so registering 
it as a member of some of the abstract base classes in collections could easily 
have been overlooked.

One of the prerequisites for membership in MutableSequence is a .clear() 
method, and array doesn't have one, though there is no reason why it shouldn't. 
Here's the workaround that I'm using:

import array
import collections

class array(array.array,
collections.MutableSequence):
__slots__ = ()

def __reversed__(self):
# this is a bit hacky
return reversed(self.tolist())

def clear(self):
self.__setitem__(slice(None), self.__class__(self.typecode))

Here are some results:

>>> a = array('f', [1,2,3,4])
>>> list(reversed(a))
[4.0, 3.0, 2.0, 1.0]
>>> a.clear()
>>> a
array('f')

--

___
Python tracker 

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



[issue30060] Crash on Py_Finalize if Py_NoSiteFlag is used

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

> Anyway my preference was to stop automatically regenerating files, and to 
> keep the build system as simple as practical without hacks like the BOOT="#" 
> flag.

In the past, this issue bite me so many times on Solaris, FreeBSD, etc. One 
because there was not "python" command, then because "python" was an old python 
2.6 and so hg touch didn't work, etc.

It's "nice" to try to keep track of build dependencies, but in pratice it is 
super painful. So I'm also in favor of removing these build dependencies based 
on file modification file, and maybe document how to force a rebuild (do you 
really need to do that? developers hacking special files know how to rebuild 
generated files, no?).

--

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

FYI 3 FreeBSD buildbots are currently broken because of this issue.

--
nosy: +haypo

___
Python tracker 

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



[issue29191] liblzma is missing from pcbuild.sln

2017-04-21 Thread Steve Dower

Changes by Steve Dower :


--
pull_requests: +1362

___
Python tracker 

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



[issue29191] liblzma is missing from pcbuild.sln

2017-04-21 Thread Steve Dower

Steve Dower added the comment:

Yeah, merging into master is easy right now, but backports are still manual 
effort. It should only require 3.6, so I'll try to get to it today.

--

___
Python tracker 

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



[issue29950] Rename SlotWrapperType to WrapperDescriptorType

2017-04-21 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

This was added in python/typing just a couple of days ago, so I'm bumping to 
maybe get the PR to python/cpython merged too.

--

___
Python tracker 

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



[issue29840] Avoid raising OverflowError in bool()

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

Hum, I dislike this change since it's non-obvious what/who is raising the 
OverflowError. If an object calls a function in __len__() and the function 
raises OverflowError, should we consider that object is "true"? In temptation 
to guess, I prefer to not guess but passthrough the exception.

If you want to support bool(range(1<<1000)), we need to get the result of 
__len__() as a Python object rather than a C Py_ssize_t.

Maybe, if __len__() raises an OverflowError: call again the len(), but using 
the "__len__" method instead of the slot?

--

___
Python tracker 

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



[issue30130] array.array is not an instance of collections.MutableSequence

2017-04-21 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Thanks for the bug report, Alexander. This is related, if not a superseder, of: 
https://bugs.python.org/issue29727

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue30121] Windows: subprocess debug assertion on failure to execute the process

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue30085] Discourage operator.__dunder__ functions

2017-04-21 Thread Sanket Dasgupta

Sanket Dasgupta added the comment:

@terry, I have updated the same, thanks!

--
nosy: +sanketdg

___
Python tracker 

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



[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:


New changeset b984a05d557e78b928f38098d0b6c0e95f737b9a by Victor Stinner in 
branch '3.6':
bpo-30107: don't dump core on expected test_io crash (#1235) (#1241)
https://github.com/python/cpython/commit/b984a05d557e78b928f38098d0b6c0e95f737b9a


--

___
Python tracker 

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



[issue17703] Trashcan mechanism segfault during interpreter finalization in Python 2.7.4

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue30132] [Windows] test_distutils leaks a vc140.pdb file

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
title: test_distutils leaks a vc140.pdb file -> [Windows] test_distutils leaks 
a vc140.pdb file

___
Python tracker 

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



[issue30132] test_distutils leaks a vc140.pdb file

2017-04-21 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/566/steps/test/logs/stdio

Warning -- files was modified by test_distutils
  Before: []
  After:  ['vc140.pdb']

--
components: Tests, Windows
messages: 292060
nosy: haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_distutils leaks a vc140.pdb file
type: resource usage
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



[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1361

___
Python tracker 

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



[issue30117] test_lib2to3.test_parser.test_all_project_files() fails

2017-04-21 Thread Eric Appelt

Eric Appelt added the comment:

I added a PR to fix these two (in my opinion) spurious failure conditions in 
the lib2to3.tests.test_parser.TestParserIdempotency test_parser test with the 
following changes to the test:

1. Use the same encoding found in the initial file to write a temp file for a 
diff. This retains the BOM if the encoding was initially utf-8-sig.

2. If the file cannot be parsed using the normal grammar, try again with no 
print statement which should succeed for valid files using future print_function

For case (1), the driver was correctly handling a BOM in a utf-8 file, but then 
the test was not writing a comparison file using 'utf-8-sig' to diff against, 
so the BOM got removed. I don't think that is the fault of the parser, and 
lib2to3 will retain the BOM.

For case (2), lib2to3 pre-detects the use of from __future__ import 
print_function or allows the user to force this interpretation with a -p flag, 
and then selects a different grammar with the print statement removed. That 
makes the test cases unfair to this test as the driver itself doesn't know 
which grammar to use. As a minimal fix, the test will try using a grammar with 
the print statement, and if that fails fall back on a grammar without it. A 
more thorough handling of the idempotency test would to be to parse all files 
using both grammars and ignore if one of the two failed but otherwise check 
both. I didn't think this was necessary but can change.

--
nosy: +Eric Appelt

___
Python tracker 

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



[issue30117] test_lib2to3.test_parser.test_all_project_files() fails

2017-04-21 Thread Eric Appelt

Changes by Eric Appelt :


--
pull_requests: +1360

___
Python tracker 

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



[issue30131] test_logging leaks a "dangling" thread

2017-04-21 Thread STINNER Victor

New submission from STINNER Victor:

Example on Windows from AppVeyor:

https://ci.appveyor.com/project/python/cpython/build/3.7.0a0.1402

Warning -- threading._dangling was modified by test_logging
  Before: <_weakrefset.WeakSet object at 0x027CBE30>
  After:  <_weakrefset.WeakSet object at 0x027CBFF0>

I also saw this warning on FreeBSD buildbots.

--
components: Tests
messages: 292058
nosy: haypo
priority: normal
severity: normal
status: open
title: test_logging leaks a "dangling" thread
type: resource usage
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



[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 46c2b81026bbf966c0898a1fa30d98c33673aea0 by Victor Stinner in 
branch 'master':
bpo-30125: Fix faulthandler.disable() on Windows (#1240)
https://github.com/python/cpython/commit/46c2b81026bbf966c0898a1fa30d98c33673aea0


--

___
Python tracker 

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



[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1359

___
Python tracker 

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



[issue30107] python.core file created when running tests on AMD64 FreeBSD CURRENT Non-Debug 3.x buildbot

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 2a1aed04b0943636f605543522e16cca1dc23e70 by Victor Stinner in 
branch 'master':
bpo-30107: don't dump core on expected test_io crash (#1235)
https://github.com/python/cpython/commit/2a1aed04b0943636f605543522e16cca1dc23e70


--

___
Python tracker 

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



[issue30125] test_SEH() of test_ctypes logs "Windows fatal exception: access violation"

2017-04-21 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1358

___
Python tracker 

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



[issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

> It seems there might be mismatch between sqlite3_libversion() and 
> SQLITE_VERSION. I am not familiar with the buildbots but can you run a test 
> that check that sqlite3_libversion() == SQLITE_VERSION?

The Python sqlite3 exports sqlite3_libversion() as sqlite3.sqlite_version, 
"3.6.11" on OS X Tiger.

The doc https://sqlite.org/c3ref/libversion.html says "These interfaces 
[sqlite3_libversion()] provide the same information as the SQLITE_VERSION, ..."

I don't know how to check, I don't have access to the buildbot.

--

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread Eric V. Smith

Eric V. Smith added the comment:

I agree we shouldn't do anything heroic to "fix" dtoa.c. I'd wait and see if 
Gay (or other maintainers) will chose an approach if Clang keeps this behavior.

At most, I think Mark's idea to use -fno-strict-aliasing only on dtoa.c and 
nowhere else would be the better approach.

--

___
Python tracker 

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



[issue30130] array.array is not an instance of collections.MutableSequence

2017-04-21 Thread Alexander Gosselin

New submission from Alexander Gosselin:

array.array has all of the methods required by collections.MutableSequence, but:

>>> import array
>>> import collections
>>> isinstance(array.array, collections.MutableSequence)
False

--
messages: 292053
nosy: Alexander Gosselin
priority: normal
severity: normal
status: open
title: array.array is not an instance of collections.MutableSequence
type: enhancement
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



[issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger

2017-04-21 Thread Aviv Palivoda

Aviv Palivoda added the comment:

> It's even more strange. The test started to fail since this build, Sun Apr 9 
> 10:10:15 2017:

This was merged on Apr 9 (commit 0e6cb2ea624570ed08c354f1ed1f595dab4192d6).

>From a quick look in the internet some other people had a similar problem:
http://stackoverflow.com/questions/28973887/how-to-fix-sqlite3-libversion-mismatch

It seems there might be mismatch between sqlite3_libversion() and 
SQLITE_VERSION. I am not familiar with the buildbots but can you run a test 
that check that sqlite3_libversion() == SQLITE_VERSION?

--
nosy: +palaviv

___
Python tracker 

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2017-04-21 Thread R. David Murray

R. David Murray added the comment:

Yes, please do provide an example. Your final words do not make a convincing 
case that this is a problem in python3 :)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue30129] functools.partialmethod should look more like what it's impersonating.

2017-04-21 Thread Skip Montanaro

New submission from Skip Montanaro:

I needed to create a partial method in Python 2.7, so I grabbed 
functools.partialmethod from a Python 3.5.2 install. For various reasons, one 
of the reasons I wanted this was to suck in some methods from a delegated class 
so they appeared in dir() and help() output on the primary class (the one 
containing the partialmethod objects). Suppose I have

class Something:
  def meth(self, arg1, arg2):
"meth doc"
return arg1 + arg2

then in the metaclass for another class I construct an attribute (call it 
"mymeth") which is a partialmethod object. When I (for example), run pydoc, 
that other class's attribute appears as:

mymeth = 

It would be nice if it at least included the doc string from meth, something 
like:

mymeth = 
meth doc

Even better would be a proper signature:

mymeth(self, arg1, arg2)
meth doc

In my copy of functools.partialmethod, I inserted an extra line in __get__, 
right after the call to partial():

results.__doc__ = self.func.__doc__

That helps a bit, as I can

print("mymeth doc:", inst.mymeth.__doc__)

and see

mymeth doc: meth doc

displayed. That's not enough for help()/pydoc though.

I suspect the heavy lifting will have to be done in pydoc.Doc.document(). 
inspect.isroutine() returns False for functools.partial objects. I also see 
_signature_get_partial() in inspect.py. That might be the source of the 
problem. When I create a partialmethod object in my little example, it actually 
looks like a functools.partial object, not a partialmethod object. It's not 
clear that this test:

if isinstance(partialmethod, functools.partialmethod):

in inspect._signature_from_callable() is testing for the correct type.

Apologies that I can't easily provide a detailed example. My Python 2.x 
metaclass example (where I'm smashing methods from one class into another) 
doesn't work in Python 3.x for some reason, the whole partialmethod thing isn't 
available in Python 2.x (inspect doesn't know about partialmethod or partial) 
and it's not really a "hello world"-sized example anyway. I'll beat on things a 
bit more to try and craft a workable Python 3.x example.

--
components: Library (Lib)
messages: 292050
nosy: skip.montanaro
priority: normal
severity: normal
status: open
title: functools.partialmethod should look more like what it's impersonating.
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



[issue30128] xid_start definition for Unicode identifiers refers to xid_continue

2017-04-21 Thread Ralph Corderoy

New submission from Ralph Corderoy:

https://docs.python.org/3/reference/lexical_analysis.html#identifiers has a 
grammar.

identifier   ::=  xid_start xid_continue*
id_start ::=  
id_continue  ::=  
xid_start::=  
xid_continue ::=  

I struggle to make sense of it unless I remove `xid_continue*' from 
`xid_start's definition.
I suspect it ended up there due to cut and paste.

--
assignee: docs@python
components: Documentation
messages: 292049
nosy: docs@python, ralph.corderoy
priority: normal
severity: normal
status: open
title: xid_start definition for Unicode identifiers refers to xid_continue
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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread Mark Dickinson

Mark Dickinson added the comment:

> Updating dtoa.c would be a large and error-prone task.

It would also take us even further away from the upstream sources, making it 
harder to integrate bugfixes from upstream.

--

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread Mark Dickinson

Mark Dickinson added the comment:

> (I would prefer to keep -fstrict-aliasing).

Updating dtoa.c would be a large and error-prone task. It may be simpler to 
adjust the buildsystem so that we can specify -fno-strict-aliasing just for 
dtoa.c.

--

___
Python tracker 

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



[issue26264] keyword module missing async and await keywords

2017-04-21 Thread Михайло Гавеля

Changes by Михайло Гавеля :


--
pull_requests: +1357

___
Python tracker 

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



[issue30127] argparse action not correctly describing the right behavior

2017-04-21 Thread Diego Costantini

Diego Costantini added the comment:

You are right, I misunderstood the part where it sets defaults opposite to the 
stored value, although apparently over one year ago I did understand it 
correctly when I first went through that documentation.

Today my second pair of eyes had my same understanding of it though :)

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



[issue30127] argparse action not correctly describing the right behavior

2017-04-21 Thread Eric V. Smith

Eric V. Smith added the comment:

I think the example is correct. Because baz's action is store_false, the 
default is True. So if baz is omitted, it should have a True value. That's what 
the example shows, and what I see when I run this code.

Can you show what you tested, what you saw, and what you expected?

--
nosy: +eric.smith

___
Python tracker 

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



[issue30127] argparse action not correctly describing the right behavior

2017-04-21 Thread Diego Costantini

New submission from Diego Costantini:

Here https://docs.python.org/2/library/argparse.html#action we have the 
following:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('--foo', action='store_true')
>>> parser.add_argument('--bar', action='store_false')
>>> parser.add_argument('--baz', action='store_false')
>>> parser.parse_args('--foo --bar'.split())
Namespace(bar=False, baz=True, foo=True)

baz should be False because omitted.
I also tested it.

--
assignee: docs@python
components: Documentation
messages: 292044
nosy: Diego Costantini, docs@python
priority: normal
severity: normal
status: open
title: argparse action not correctly describing the right behavior
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



[issue30122] Added missing archive programs and close option to Windows docs.

2017-04-21 Thread R. David Murray

R. David Murray added the comment:

Also, please review the (newly rewritten) section in the devguide about PRs.  I 
see now that there were changes made from the original here already, but I 
don't see the commits that made those changes.  The history of changes should 
be kept during PR development (they get squashed at the end).

--

___
Python tracker 

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



[issue30122] Added missing archive programs and close option to Windows docs.

2017-04-21 Thread R. David Murray

R. David Murray added the comment:

To be clear: backport PRs should be created only after a PR has been approved.

--

___
Python tracker 

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



[issue30122] Added missing archive programs and close option to Windows docs.

2017-04-21 Thread R. David Murray

R. David Murray added the comment:

Please close the redundant PRs.  I've commented on pr1228.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

> Yes, I've read it. And I think the Clang folks are wrong in their 
> interpretation of the standard. And even if they're not, they're going to 
> break a lot of code with this change: the union trick has been widely 
> accepted as a valid way to do things.

If Clang decides or not to handle union will decide if Python has or has no to 
change dtoa.c :-) (I would prefer to keep -fstrict-aliasing).

--

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread Mark Dickinson

Mark Dickinson added the comment:

> See the clang bug report:

Yes, I've read it. And I think the Clang folks are wrong in their 
interpretation of the standard. And even if they're not, they're going to break 
a lot of code with this change: the union trick has been widely accepted as a 
valid way to do things.

--

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread Mark Dickinson

Mark Dickinson added the comment:

And the basic rule that bans aliasing in the first place is C99 6.5p7:
"""
An object shall have its stored value accessed only by an lvalue expression 
that has one of the following types ...
"""
But I'd argue that the "an aggregate or union type" subclause of 6.5p7 covers 
this case.

--

___
Python tracker 

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



[issue30124] Fix C aliasing issue in Python/dtoa.c to use strict aliasing on Clang 4.0

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

> I'd strongly prefer not to modify dtoa.c here unless we really have to.

See the clang bug report:
https://bugs.llvm.org//show_bug.cgi?id=31928

--

___
Python tracker 

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



[issue30126] CheckTraceCallbackContent of test_sqlite3 fails on OS X Tiger

2017-04-21 Thread STINNER Victor

STINNER Victor added the comment:

It's even more strange. The test started to fail since this build, Sun Apr 9 
10:10:15 2017:

http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/528

test_sqlite: testing with version '2.6.0', sqlite_version '3.6.11'
...
test test_sqlite failed


Sadly, before the test passed and so the SQLite version wasn't logged:

http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/527/steps/test/logs/stdio
0:26:24 [227/404/1] test_sqlite passed


@David Bolen: Did you make a change, like an upgrade, on this buildbot slave 
around Apr 9, 2017?

--
nosy: +db3l

___
Python tracker 

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



  1   2   >