[issue31209] MappingProxyType can not be pickled

2017-08-14 Thread Alex Hayes

New submission from Alex Hayes:

I imagine that this is by design (likely because it can't be implemented) 
however I wanted to check if this was the case.

Instances of types.MappingProxyType can't be pickled.

For example;

```
import pickle
from types import MappingProxyType
eggs = MappingProxyType(dict(sausage=True))
pickle.dumps(eggs)
```

Raises: TypeError: can't pickle mappingproxy objects



Is this the desired behaviour or is it a bug?

--
components: Library (Lib)
messages: 300284
nosy: Alex Hayes
priority: normal
severity: normal
status: open
title: MappingProxyType can not be pickled
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue9253] argparse: optional subparsers

2017-08-14 Thread Anthony Sottile

Anthony Sottile added the comment:

I've attempted to address some of the backward/forward compatibility issue with 
subparsers becoming optional by default (vs required by default in python2) 
with this pull request: https://github.com/python/cpython/pull/3027 (would love 
to get a review as well!)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue31208] Simplify `low_fds_to_close` in subprocess.py

2017-08-14 Thread TaoQingyun

Changes by TaoQingyun <845767...@qq.com>:


--
components: Library (Lib)
files: subprocess.patch
keywords: patch
nosy: qingyunha
priority: normal
severity: normal
status: open
title: Simplify `low_fds_to_close` in subprocess.py
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file47082/subprocess.patch

___
Python tracker 

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



[issue26510] [argparse] Add required argument to add_subparsers

2017-08-14 Thread Anthony Sottile

Anthony Sottile added the comment:

I've added a patch for this https://github.com/python/cpython/pull/3027

Would love to get a review so it could be included

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue31198] getaddrinfo: inconsistent handling of port=None

2017-08-14 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Ugh, apparently this weird behavior is actually mandated by the RFC :-(.

RFC 3493:

   The nodename and servname arguments are either null pointers or
   pointers to null-terminated strings.  One or both of these two
   arguments must be a non-null pointer.

So... never mind!

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Great work. Thank you.
Next: #31205, #31001, #31206, then ...

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



[issue31093] IDLE: Add tests for configdialog extensions tab

2017-08-14 Thread Terry J. Reedy

New submission from Terry J. Reedy:

It is not clear what will be left after #27099

--

___
Python tracker 

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



[issue31207] IDLE, configdialog: Factor out ExtPage class from ConfigDialog

2017-08-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +IDLE: Add tests for configdialog extensions tab

___
Python tracker 

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



[issue31207] IDLE, configdialog: Factor out ExtPage class from ConfigDialog

2017-08-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee: terry.reedy
components: IDLE
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE, configdialog: Factor out ExtPage class from ConfigDialog
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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +IDLE: Add tests for configdialog highlight tab

___
Python tracker 

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



[issue31206] IDLE, configdialog: Factor out HighPage class from ConfigDialog

2017-08-14 Thread Terry J. Reedy

New submission from Terry J. Reedy:

As with #31050, #31205

--
assignee: terry.reedy
components: IDLE
messages: 300278
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE, configdialog: Factor out HighPage class from ConfigDialog
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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset a31459008c5b3230363d155a2e8616664dc4f0c6 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-31002: IDLE: Add tests for configdialog keys tab (GH-2996) (#3092)
https://github.com/python/cpython/commit/a31459008c5b3230363d155a2e8616664dc4f0c6


--

___
Python tracker 

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



[issue31001] IDLE: Add tests for configdialog highlight tab

2017-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If we do the same renamings for the theme selection vars and functions as done 
for keys selection on the keys tab, then the corresponding tests can be copied 
and slightly altered.  However, duplicate names require that KeyPage be 
separated first.  Hence the dependency.

When the current mess is replaced on both pages, we *might* be able to make a 
simple Frame subclass tested once and used on both pages.

--
dependencies: +IDLE, configdialog: Factor out KeysPage class from ConfigDialog
nosy: +csabella

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Let me know if you start on this.

--
nosy: +csabella

___
Python tracker 

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +3132

___
Python tracker 

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-14 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 2f8964634918bdf09107c49a2d5ca62460091e54 by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-31002: IDLE: Add tests for configdialog keys tab (#2996)
https://github.com/python/cpython/commit/2f8964634918bdf09107c49a2d5ca62460091e54


--

___
Python tracker 

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



[issue31205] IDLE, configdialog: Factor out KeysPage class from ConfigDialog

2017-08-14 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Do as did with #31050 and GenPage class.  This should be done *before* #31001, 
highlights test.

--
assignee: terry.reedy
components: IDLE
messages: 300273
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE, configdialog: Factor out KeysPage class from ConfigDialog
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



[issue31194] Inconsistent __repr__s for _collections objects

2017-08-14 Thread Raymond Hettinger

Raymond Hettinger added the comment:

IIRC, deque() did this to better match the behavior of list().  Not everything 
in Python is consistent and sometimes we have to pick and choose between what 
we want to be consistent with.  For the most part, the decisions have worked 
out well in practice (deque.__repr__ hasn't seemed to bother anyone in its 
dozen year history).

--

___
Python tracker 

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



[issue31194] Inconsistent __repr__s for _collections objects

2017-08-14 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
priority: normal -> low
versions: +Python 3.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



[issue31204] Support __fspath__ in shlex.quote

2017-08-14 Thread Anthony Sottile

Anthony Sottile added the comment:

Ah oops, I'm incorrect here, the __fspath__ object I was dealing with supported 
__str__ and that's how subprocess was converting it -- not via __fspath__.

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



[issue31204] Support __fspath__ in shlex.quote

2017-08-14 Thread Anthony Sottile

New submission from Anthony Sottile:

Given shlex.quote often is used closely with calls in `subprocess`, should it 
also support quoting __fspath__ objects?

I'll write up a quick patch for this

--
components: Library (Lib)
messages: 300270
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: Support __fspath__ in shlex.quote
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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-14 Thread Łukasz Langa

Changes by Łukasz Langa :


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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-14 Thread Łukasz Langa

Łukasz Langa added the comment:


New changeset 09b77165e3fffa7b7ff160ad06042cdcfa004bf5 by Łukasz Langa in 
branch '3.6':
[3.6] bpo-30983: eval frame rename in pep 0523 broke gdb's python extension 
(GH-2803) (#3090)
https://github.com/python/cpython/commit/09b77165e3fffa7b7ff160ad06042cdcfa004bf5


--

___
Python tracker 

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



[issue31170] expat: utf8_toUtf8 cannot properly handle exhausting buffer

2017-08-14 Thread Lin Tian

Lin Tian added the comment:

Reactive this issue as to let you know that libexpat has confirmed and fixed 
the bug and they are interested in porting the fix to python. Reactive this in 
case you want to know what's going on and make a decision accordingly. (Sorry, 
I'm not very familiar with process here)

--
status: closed -> open

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-14 Thread Łukasz Langa

Changes by Łukasz Langa :


--
pull_requests: +3131

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-14 Thread Łukasz Langa

Changes by Łukasz Langa :


--
pull_requests: +3130

___
Python tracker 

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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-14 Thread Larry Hastings

Larry Hastings added the comment:

You understand correctly.  It won't be backported to Python 3.5.

--

___
Python tracker 

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



[issue30983] eval frame rename in pep 0523 broke gdb's python extension

2017-08-14 Thread Łukasz Langa

Łukasz Langa added the comment:


New changeset 2e0f4db114424a00354eab889ba8f7334a2ab8f0 by Łukasz Langa (Bruno 
"Polaco" Penteado) in branch 'master':
bpo-30983: eval frame rename in pep 0523 broke gdb's python extension (#2803)
https://github.com/python/cpython/commit/2e0f4db114424a00354eab889ba8f7334a2ab8f0


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue31149] Add Japanese to the language switcher

2017-08-14 Thread Julien Palard

Julien Palard added the comment:

@inada make sense, so I'll change "Français" for "French" for consistency.

--

___
Python tracker 

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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-14 Thread Марк Коренберг

Марк Коренберг added the comment:

If I understand right, Python 3.5 will not be fixed with this pathc. Right ?

If yes, I will tell Debian maintainers to backport this patch to Python 3.5, 
which is shipped with latest stable Debian 9.

--

___
Python tracker 

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



[issue1612262] Class Browser doesn't show internal classes

2017-08-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +IDLE: add docstrings to browser.py
stage: test needed -> patch review

___
Python tracker 

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



[issue31024] typing.Tuple is class but is defined as data inside https://docs.python.org/3.6/objects.inv

2017-08-14 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Bernát, I would recommend asking this on Sphinx tracker (I also assigned this 
to docs@python since this seems to be a purely documentation issue).

https://github.com/sphinx-doc/sphinx

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
type:  -> enhancement

___
Python tracker 

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



[issue31191] Fix grammar in threading.Barrier docs

2017-08-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue31191] Fix grammar in threading.Barrier docs

2017-08-14 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


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



[issue31191] Fix grammar in threading.Barrier docs

2017-08-14 Thread Mariatta Wijaya

New submission from Mariatta Wijaya:


New changeset 143be366295038b36fc32c44b8e1b48a375eab56 by Mariatta (Saurabh 
Chaturvedi) in branch 'master':
bpo-31191: Improve grammar in threading.Barrier docs (GH-3080)
https://github.com/python/cpython/commit/143be366295038b36fc32c44b8e1b48a375eab56


--
nosy: +Mariatta

___
Python tracker 

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



[issue31148] Can we get an MSI installer for something past 3.4.4?

2017-08-14 Thread Steve Dower

Steve Dower added the comment:

The general requirements of an installer are:
* runs without any preinstalled prerequisites
* does not install anything permanent until the user says so (Visual Studio 
breaks this rule :( )
* installs all required prerequisites
* install on all supported operating systems
* allow users to [de]select optional components
* correctly uninstall previous compatible versions
* correctly do *not* uninstall previous identical versions
* update user environment settings (registry, environment, etc.)
* create Start Menu shortcuts
* create file associations
* create context menus
* install files into customizable location with correct security settings
* correctly roll back when installation fails, including restoring previously 
uninstalled components and attempting to execute installed tools that may not 
be installed correctly
* attempt to execute just-installed components that may not be installed 
correctly (e.g. ensurepip, compileall, trigger environment variable reload)
* detect and abort when installation is going to fail, and explain to the user 
how to solve the problem
* provide live progress feedback and information about what operations are 
occurring
* provide detailed log files to help offer user support post-installation, and 
help users find those logs
* provide registration information so the operating system can help users 
modify or remove the installation
* allow users to modify, repair and upgrade the installation without corrupting 
it (or any others) or forcing them to remove/reinstall
* allow users to choose whether to install just for themselves or for the 
entire machine, and request correct permissions based on this choice
* allow administrators to script an entire installation and have it run 
silently and/or with progress (and cancellation) only
* allow users to minimize download size by deselecting optional components
* allow users to obtain all optional components to allow full installation 
without public internet access
* install without executing arbitrary third-party code that may have been 
maliciously placed in a user's download directory
* automatically include new files added by developers who have not explicitly 
modified the installer

These are all the features of our current installer, and nearly all of them 
work for basically every user. Many of these are literally not achievable with 
just an MSI, or require significantly more complicated commands to be run by 
the end user, rather than providing options in a user interface.

If you're still interested in giving it a go, visit http://wixtoolset.org/ and 
have a look at their tools. These are the gold-standard right now for building 
MSIs (and Burn bundles, which is what we currently have).

--

___
Python tracker 

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



[issue30824] Add mimetype for extension .json

2017-08-14 Thread R. David Murray

Changes by R. David Murray :


--
stage: needs patch -> backport needed

___
Python tracker 

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



[issue30824] Add mimetype for extension .json

2017-08-14 Thread R. David Murray

R. David Murray added the comment:


New changeset 8204b903683f9e0f037ccfaa87622716019914d7 by R. David Murray (Nate 
Tangsurat) in branch 'master':
bpo-30824: Add mimetype for .json (#3048)
https://github.com/python/cpython/commit/8204b903683f9e0f037ccfaa87622716019914d7


--

___
Python tracker 

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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Needed a NEWS entry.

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



[issue31193] re.IGNORECASE strips combining character from lower case of LATIN CAPITAL LETTER I WITH DOT ABOVE

2017-08-14 Thread David MacIver

David MacIver added the comment:

Sure, but 'i' is a single code point. The bug is that the regex matches 'i', 
not that it doesn't match the actual two codepoint lower case of the string.

--

___
Python tracker 

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



[issue31193] re.IGNORECASE strips combining character from lower case of LATIN CAPITAL LETTER I WITH DOT ABOVE

2017-08-14 Thread Matthew Barnett

Matthew Barnett added the comment:

The re module works with codepoints, it doesn't understand canonical 
equivalence.

For example, it doesn't recognise that "\N{LATIN CAPITAL LETTER E}\N{COMBINING 
ACUTE ACCENT}" is equivalent to "\N{LATIN CAPITAL LETTER E WITH ACUTE}".

This is true for Python in general, except for identifiers, which are 
normalised:

>>> "\N{LATIN CAPITAL LETTER E}\N{COMBINING ACUTE ACCENT}"
'É'
>>> É = 0
>>> "\N{LATIN CAPITAL LETTER E WITH ACUTE}"
'É'
>>> É
0

This also means that, say '.' will match only 1 _codepoint_.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue31195] Make any() and all() work with async generators

2017-08-14 Thread Brett Cannon

Brett Cannon added the comment:

I figured there was something. :( Closing this as "rejected".

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



[issue31129] RawConfigParser.items() is unusual in taking arguments

2017-08-14 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't think this is worth it.

--
resolution:  -> wont fix
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



[issue31129] RawConfigParser.items() is unusual in taking arguments

2017-08-14 Thread Daniel Watkins

Daniel Watkins added the comment:

Having ironed out my confusion over typing the method, I agree that making
the types more obvious is not a compelling argument for this change.

That said, I think the current API has been confusing to me in the past,
and I think the proposed change is still a worthwhile improvement for users
of this module.

On Mon, Aug 7, 2017 at 12:08 AM Guido van Rossum 
wrote:

>
> Guido van Rossum added the comment:
>
> I think the proposed change is not worth it. Developments in type checking
> (in particular overloading) make it unambiguous what the return type will
> be from just a static inspection of the call site. (Given that the _UNSET
> value is intended to be private.) See also
> https://github.com/python/mypy/issues/3805#issuecomment-320561797
>
> --
> nosy: +gvanrossum
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31200] address sanitizer build fails

2017-08-14 Thread Julien Palard

Julien Palard added the comment:

Segfault occur in Include/object.h line 1054:

#define Py_TRASHCAN_SAFE_BEGIN(op) \
do { \
PyThreadState *_tstate = PyThreadState_GET(); \
if (_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
⧺_tstate->trash_delete_nesting;
/* The body of the deallocator is here. */

the _tstate is null at this moment.

It's NULL because in the main, right before the 
_Py_ReleaseInternedUnicodeStrings there's a call to Py_FinalizeEx which calls 
PyThreadState_Swap(NULL), see pylifecycle.c:1097:

/* Delete current thread. After this, many C API calls become crashy. */
PyThreadState_Swap(∅);

But there's probably still references to strings before the Py_FinalizeEx so it 
does not make sense to garbage collect before it.

Maybe make Py_TRASHCAN_SAFE_BEGIN more robust by disabling the counter when the 
state is NULL?

--

___
Python tracker 

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



[issue31201] module test that failed doesn't exist

2017-08-14 Thread R. David Murray

R. David Murray added the comment:

Yep, I figured that.  That's why I suggested the clarification to the README, 
if someone wants to generate a PR for it.

--

___
Python tracker 

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



[issue31201] module test that failed doesn't exist

2017-08-14 Thread Paulo Matos

Paulo Matos added the comment:

Argh, apologies David. I hadn't noticed the mistake. I simply copy/pasted and 
was expecting the command line to rerun all the tests that had previously 
failed. I was assuming the suite had some kind of state that recorded the tests 
that previously failed and ran only those. :)

--

___
Python tracker 

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



[issue31199] configure checks fail confusingly under --with-address-sanitizer if libasan is missing

2017-08-14 Thread R. David Murray

Changes by R. David Murray :


--
title: !HAVE_CLOCK_GETTIME causes problems with _PyTime_FromTimespec -> 
configure checks fail confusingly under --with-address-sanitizer if libasan is 
missing

___
Python tracker 

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



[issue31201] module test that failed doesn't exist

2017-08-14 Thread R. David Murray

R. David Murray added the comment:

Replace "test_that_failed" with the name of the test that failed.

The README could be improved by saying:

If any tests fail, you can re-run the failing test(s) in verbose mode.  For 
example if, 'test_os' and 'test_gdb' failed, you can run::

 make test TESTOPTS="-v test_os test_gdb"

--
assignee:  -> docs@python
components: +Documentation -Tests
nosy: +docs@python, r.david.murray

___
Python tracker 

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



[issue31203] socket.IP_PKTINFO is missing from python

2017-08-14 Thread Laurent GUERBY

Laurent GUERBY added the comment:

Probable fix in Modules/socketmodule.c after /* IPv4 [gs]etsockopt options */ 
add:

#ifdef  IP_PKTINFO
PyModule_AddIntMacro(m, IP_PKTINFO);
#endif

--

___
Python tracker 

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



[issue31203] socket.IP_PKTINFO is missing from python

2017-08-14 Thread Laurent GUERBY

New submission from Laurent GUERBY:

The constant socket.IP_PKTINFO is missing.

Definition on Linux:

http://elixir.free-electrons.com/linux/v4.12.7/source/include/uapi/linux/in.h#L96

Exemple code that would benefit from the definition:

https://chiliproject.tetaneutral.net/projects/tetaneutral/wiki/Netconsole#nagios-selectors

Note: socket.IPV6_PKTINFO is defined :).

--
components: Library (Lib)
messages: 300248
nosy: guerby
priority: normal
severity: normal
status: open
title: socket.IP_PKTINFO is missing from python
type: enhancement
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, 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



[issue31024] typing.Tuple is class but is defined as data inside https://docs.python.org/3.6/objects.inv

2017-08-14 Thread Bernát Gábor

Bernát Gábor added the comment:

how can we find it out?

--

___
Python tracker 

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



[issue31200] address sanitizer build fails

2017-08-14 Thread Julien Palard

Julien Palard added the comment:

Some (most?) of them looks to be unicode strings, and according to the very end 
of the main function:

#ifdef __INSURE__
/* Insure++ is a memory analysis tool that aids in discovering
 * memory leaks and other memory problems.  On Python exit, the
 * interned string dictionaries are flagged as being in use at exit
 * (which it is).  Under normal circumstances, this is fine because
 * the memory will be automatically reclaimed by the system.  Under
 * memory debugging, it's a huge source of useless noise, so we
 * trade off slower shutdown for less distraction in the memory
 * reports.  -baw
 */
_Py_ReleaseInternedUnicodeStrings();
#endif /* __INSURE__ */

So, to ensure everything is as expected, I compiled with the __INSURE__ flag, 
and got:

releasing 1894 interned strings
total size of all interned strings: 17945/0 mortal/immortal
ASAN:DEADLYSIGNAL
=
==23814==ERROR: AddressSanitizer: SEGV on unknown address 0x00a0 (pc 
0x5575b1c16904 bp 0x7ffe1c4f1f60 sp 0x7ffe1c4f1f40 T0)
#0 0x5575b1c16903 in list_dealloc 
(/home/mdk/Downloads/cpython/python+0x524903)
#1 0x5575b1bf287d in _Py_Dealloc 
(/home/mdk/Downloads/cpython/python+0x50087d)
#2 0x5575b1c3daca in _Py_ReleaseInternedUnicodeStrings 
(/home/mdk/Downloads/cpython/python+0x54baca)
#3 0x5575b206c0d3 in Py_Main (/home/mdk/Downloads/cpython/python+0x97a0d3)
#4 0x5575b206d1d2 in main (/home/mdk/Downloads/cpython/python+0x97b1d2)
#5 0x7f5ed0b622b0 in __libc_start_main 
(/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
#6 0x5575b1b1f8d9 in _start (/home/mdk/Downloads/cpython/python+0x42d8d9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/mdk/Downloads/cpython/python+0x524903) 
in list_dealloc
==23814==ABORTING

Which in this case does not looks normal.

--

___
Python tracker 

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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-14 Thread Larry Hastings

Changes by Larry Hastings :


--
pull_requests: +3129

___
Python tracker 

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



[issue31202] Windows pathlib.Path.glob(pattern) fixed part of the pattern changed to lowercase whereas it should be unchanged.

2017-08-14 Thread aicirbs

New submission from aicirbs:

Windows pathlib.Path.glob(pattern) fixed part of the pattern to lowercase 
whereas it should be unchanged.
Note that this issue is different from http://bugs.python.org/issue26655 : 
"pathlib glob case sensitivity issue on Windows" where it was asked to get the 
actual case of the folder from the file system.

Assuming a directory contains a folder named 'Folder'.
On Windows, calling pathlib.Path().glob('Folder') gives 'folder', but 'Folde?' 
will return 'Folder'
This is an issue for instance if trying to glob files to put them in an archive 
to be sent to a case sensitive platform.
glob.glob() does behave properly though, Windows pathlib.Path is the only 
platform which has such a behavior.

I would expect Path.glob to output the same as glob.glob() for each platform.
>From comments on http://bugs.python.org/issue19718 : "Path.glob() on 
>case-insensitive Posix filesystems" it sounds that it should even match the 
>native shell behavior.
And it looks like it is the case for linux and macOS, I tested that with the 
following script, whose results on win32, darwin and linux platforms follow:

```
#!/usr/bin/env python3.6
# Let's say this path exists : ./Folder/file
from pathlib import Path
import glob
import os
import sys
import subprocess

def ls(pattern):
if sys.platform in ('win32', 'win64'):
process = subprocess.run(['powershell', '-Command', f'dir {pattern}'], 
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=os.getcwd(), 
encoding='utf-8')
if process.returncode:
return []
# expected output:
# 
# 
# Directory: C:\path_to\Folder
# 
# 
# ModeLastWriteTime Length Name
# - -- 
# -a   2017-08-14 10:16  0 file
lines = process.stdout.splitlines()
folder = os.path.basename(lines[2].split()[-1])
file = lines[7].split()[-1]
result = f"{folder}{os.path.sep}{file}"
return [result]
else:
cmd = ['ls', f'{pattern}']
process = subprocess.run(' '.join(cmd), stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, cwd=os.getcwd(), encoding='utf-8', shell=True)
if process.returncode:
return []
return [process.stdout.strip()]

def main():
print(sys.platform)
p = Path('.')
tests = ['Folder/*', 'FOlder/*', 'F?lder/*', 'FOlde?/*', 'folder/*', 
'f?lder/*']
for t in tests:
print(f'{t}:')
print(f'Path.glob():  {[str(f) for f in p.glob(t)]}')
print(f'glob.glob():  {[f for f in glob.glob(str(p/t))]}')
print(f'shell:{ls(str(p/t))}')

if __name__ == '__main__':
main()
```

```
Output:
win32darwin 
   linux
1:  Folder/*:Folder/*:  
   Folder/*:
1a: Path.glob():  ['folder\\file']   Path.glob():  
['Folder/file'] Path.glob():  ['Folder/file']
1b: glob.glob():  ['Folder\\file']   glob.glob():  
['Folder/file'] glob.glob():  ['Folder/file']
1c: shell:['Folder\\file']   shell:
['Folder/file'] shell:['Folder/file']
2:  FOlder/*:FOlder/*:  
   FOlder/*:
2a: Path.glob():  ['folder\\file']   Path.glob():  
['FOlder/file'] Path.glob():  []
2b: glob.glob():  ['FOlder\\file']   glob.glob():  
['FOlder/file'] glob.glob():  []
2c: shell:['FOlder\\file']   shell:
['FOlder/file'] shell:[]
3:  F?lder/*:F?lder/*:  
   F?lder/*:
3a: Path.glob():  ['Folder\\file']   Path.glob():  
['Folder/file'] Path.glob():  ['Folder/file']
3b: glob.glob():  ['Folder\\file']   glob.glob():  
['Folder/file'] glob.glob():  ['Folder/file']
3c: shell:['Folder\\file']   shell:
['Folder/file'] shell:['Folder/file']
4:  FOlde?/*:FOlde?/*:  
   FOlde?/*:
4a: Path.glob():  ['Folder\\file']   Path.glob():  []   
   Path.glob():  []
4b: glob.glob():  ['Folder\\file']   glob.glob():  []   
   glob.glob():  []
4c: shell:['Folder\\file']   shell:[]   
   shell:[]
5:  folder/*:

[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-14 Thread Larry Hastings

Larry Hastings added the comment:


New changeset d4b93e21c2664d6a78e0656e7a7be0807be1c352 by larryhastings 
(Коренберг Марк) in branch 'master':
bpo-31106: Fix handling of erros in posix_fallocate() and posix_fadvise() 
(#3000) (#3000)
https://github.com/python/cpython/commit/d4b93e21c2664d6a78e0656e7a7be0807be1c352


--

___
Python tracker 

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



[issue31200] address sanitizer build fails

2017-08-14 Thread Julien Palard

Julien Palard added the comment:

Are you sure you build is failing? It looks like it succeeded, if we only speak 
about the build.

You're seeing AddressSanitizer reports because, during the build, the built 
python is used. Like in `./python -E -S -m sysconfig --generate-posix-vars`.

So if you see AddressSanitizer output, it's because a `./python` has been 
successfully built and used.

The built cpython with AddressSanitizer however reports leaks, which is 
probably reproductible by running, typically:

  ./python -c ''

--
nosy: +mdk

___
Python tracker 

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



[issue31149] Add Japanese to the language switcher

2017-08-14 Thread INADA Naoki

INADA Naoki added the comment:

My preference is "Japanese".

After selecting drop down list, we can type "jap" to select Japanese.
On the other hand, we should use IME to input "日本語".  It's not so easy as input 
alphabets.

--

___
Python tracker 

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



[issue31201] module test that failed doesn't exist

2017-08-14 Thread Paulo Matos

New submission from Paulo Matos:

Trying to rerun the tests that failed but it just says that the module doesn't 
exist. I am running the exact command line mentioned in the readme file:

$ make test TESTOPTS="-v test_that_failed"
running build
running build_ext

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
atexitpwd   time   

running build_scripts
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/pydoc3 -> 
build/scripts-3.7
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/idle3 -> 
build/scripts-3.7
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/2to3 -> 
build/scripts-3.7
copying and adjusting /home/pmatos/Projects/cpython/Tools/scripts/pyvenv -> 
build/scripts-3.7
changing mode of build/scripts-3.7/pydoc3 from 664 to 775
changing mode of build/scripts-3.7/idle3 from 664 to 775
changing mode of build/scripts-3.7/2to3 from 664 to 775
changing mode of build/scripts-3.7/pyvenv from 664 to 775
renaming build/scripts-3.7/pydoc3 to build/scripts-3.7/pydoc3.7
renaming build/scripts-3.7/idle3 to build/scripts-3.7/idle3.7
renaming build/scripts-3.7/2to3 to build/scripts-3.7/2to3-3.7
renaming build/scripts-3.7/pyvenv to build/scripts-3.7/pyvenv-3.7
./python  ../Tools/scripts/run_tests.py -v test_that_failed
/home/pmatos/Projects/cpython/debug/python -u -W default -bb -E -W 
error::BytesWarning -m test -r -w -j 0 -u all,-largefile,-audio,-gui -v 
test_that_failed
== CPython 3.7.0a0 (heads/master:48d9823a0e, Aug 14 2017, 11:53:56) [GCC 7.1.1 
20170622 (Red Hat 7.1.1-3)]
== Linux-4.11.11-300.fc26.x86_64-x86_64-with-fedora-26-Twenty_Six little-endian
== hash algorithm: siphash24 64bit
== cwd: /home/pmatos/Projects/cpython/debug/build/test_python_22582
== CPU count: 16
== encodings: locale=UTF-8, FS=utf-8
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, 
verbose=0, bytes_warning=2, quiet=0, hash_randomization=1, isolated=0)
Using random seed 8085058
Run tests in parallel using 18 child processes
0:00:00 load avg: 15.90 [1/1/1] test_that_failed failed
test test_that_failed crashed -- Traceback (most recent call last):
  File "/home/pmatos/Projects/cpython/Lib/test/libregrtest/runtest.py", line 
163, in runtest_inner
the_module = importlib.import_module(abstest)
  File "/home/pmatos/Projects/cpython/Lib/importlib/__init__.py", line 127, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.test_that_failed'

1 test failed:
test_that_failed
Re-running failed tests in verbose mode
Re-running test 'test_that_failed' in verbose mode
test test_that_failed crashed -- Traceback (most recent call last):
  File "/home/pmatos/Projects/cpython/Lib/test/libregrtest/runtest.py", line 
163, in runtest_inner
the_module = importlib.import_module(abstest)
  File "/home/pmatos/Projects/cpython/Lib/importlib/__init__.py", line 127, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in _find_and_load
  File "", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.test_that_failed'

1 test failed again:
test_that_failed

Total duration: 355 ms
Tests result: FAILURE
make: *** [Makefile:1019: test] Error 2

--
components: Tests
messages: 300241
nosy: pmatos
priority: normal
severity: normal
status: open
title: module test that failed doesn't exist

___
Python tracker 

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



[issue31200] address sanitizer build fails

2017-08-14 Thread Paulo Matos

New submission from Paulo Matos:

Build with address sanitizer fails miserably.

Configuration in Fedora 26. I attach config.log and the output of 
$ ../configure --with-assertions --with-lto --with-pydebug 
--with-address-sanitizer --disable-ipv6
$ make -j18 profile-opt

--
components: Build
files: files.zip
messages: 300240
nosy: pmatos
priority: normal
severity: normal
status: open
title: address sanitizer build fails
type: compile error
Added file: http://bugs.python.org/file47081/files.zip

___
Python tracker 

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



[issue31199] !HAVE_CLOCK_GETTIME causes problems with _PyTime_FromTimespec

2017-08-14 Thread Paulo Matos

Paulo Matos added the comment:

OK, the problem was the missing libasan which made quite a few checks fail. 

We should check for libasan before all other checks, when compiling with 
--with-address-sanitizer.

--

___
Python tracker 

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



[issue31199] !HAVE_CLOCK_GETTIME causes problems with _PyTime_FromTimespec

2017-08-14 Thread Paulo Matos

New submission from Paulo Matos:

On a Fedora 26 system, I run configure as:
$ ../configure --with-assertions --with-lto --with-pydebug 
--with-address-sanitizer --disable-ipv6

My pyconfig.h contains:
/* #undef HAVE_CLOCK */

/* Define to 1 if you have the `clock_getres' function. */
/* #undef HAVE_CLOCK_GETRES */

/* Define to 1 if you have the `clock_gettime' function. */
/* #undef HAVE_CLOCK_GETTIME */

/* Define to 1 if you have the `clock_settime' function. */
/* #undef HAVE_CLOCK_SETTIME */

/* Define if the C compiler supports computed gotos. */
/* #undef HAVE_COMPUTED_GOTOS */


When this happens, __PyTime_FromTimespec is undefined in pytime.c:747.
../Python/pytime.c:747:9: error: implicit declaration of function 
‘_PyTime_FromTimespec’; did 
you mean ‘_PyTime_FromTimeval’? [-Werror=implicit-function-declaration]
 if (_PyTime_FromTimespec(tp, , raise) < 0)
 ^~~~
 _PyTime_FromTimeval
cc1: some warnings being treated as errors
make[2]: *** [Makefile:1553: Python/pytime.o] Error 1

--
components: Build
messages: 300238
nosy: pmatos
priority: normal
severity: normal
status: open
title: !HAVE_CLOCK_GETTIME causes problems with _PyTime_FromTimespec
type: compile error

___
Python tracker 

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



[issue26669] time.localtime(float("NaN")) does not raise a ValueError on all platforms

2017-08-14 Thread Mark Dickinson

Mark Dickinson added the comment:

> potentially questionable? I'll ask a C compiler person...

Questionable indeed. Attempting to cast a NaN to an integer type results in 
undefined behaviour. Unfortunately, so does attempting to cast any double value 
that's outside the range represented by the `time_t` type, so the 
questionability extends beyond just the NaN handling.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue31198] getaddrinfo: inconsistent handling of port=None

2017-08-14 Thread Nathaniel Smith

Changes by Nathaniel Smith :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue31198] getaddrinfo: inconsistent handling of port=None

2017-08-14 Thread Nathaniel Smith

New submission from Nathaniel Smith:

socket.getaddrinfo accepts None as a port argument, and translates it into 0. 
This is handy, because bind() understands 0 to mean "pick a port for me", and 
if you want bind to pick a port for you and port=None is a slightly more 
obvious way to say that then port=0.

For example:

>>> socket.getaddrinfo("127.0.0.1", None)
[(, , 6, '', ('127.0.0.1', 
0)), (, , 17, '', 
('127.0.0.1', 0)), (, , 0, 
'', ('127.0.0.1', 0))]

socket.getaddrinfo also accepts None as a host name; this is necessary because 
the underlying getaddrinfo(3) call has special handling for host=NULL, and we 
need some way to access it:

>>> socket.getaddrinfo(None, 0)
[(, , 6, '', ('::1', 0, 
0, 0)), (, , 17, '', 
('::1', 0, 0, 0)), (, , 0, 
'', ('::1', 0, 0, 0)), (, , 6, '', ('127.0.0.1', 0)), (, 
, 17, '', ('127.0.0.1', 0)), (, , 0, '', ('127.0.0.1', 0))]

However, even though both of these features are supported separately... if you 
try to use them *together*, then socket.getaddrinfo errors out:

>>> socket.getaddrinfo(None, None)
socket.gaierror: [Errno -2] Name or service not known

I expected that last call to be equivalent to socket.getaddrinfo(None, 0).

--
components: Extension Modules
messages: 300236
nosy: njs
priority: normal
severity: normal
status: open
title: getaddrinfo: inconsistent handling of port=None
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



[issue31197] Namespace disassembly omits some compiled objects

2017-08-14 Thread Nick Coghlan

Nick Coghlan added the comment:

Note that the current dis._get_code_object() helper doesn't *quite* cover this, 
as it will implicitly compile raw strings, which isn't the desired behaviour 
for this use case.

--

___
Python tracker 

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



[issue31197] Namespace disassembly omits some compiled objects

2017-08-14 Thread Nick Coghlan

New submission from Nick Coghlan:

In reviewing the PR for issue 31183, I noticed that the criteria for deciding 
which values to disassemble when disassembling a namespace (objects with a 
__dict__ attribute) has gotten out of sync with the criteria used by the dis() 
itself.

The problem is that dis() checks for particular attributes that may contain 
code objects, while the recursive descent when processing a __dict__ attribute 
is based on isinstance() and a predefined list of types.

My proposed remedy for this would be:

1. Factor out a dis._get_code() helper function that returns either None or a 
compiled code object
2. Base the recursive descent in __dict__ processing on the value either having 
a __dict__ attribute, or else _get_code() returning a non-None result (in the 
latter case, the code object itself would be passed to the recursive call, 
rather than the original value from the namespace)

--
messages: 300234
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Namespace disassembly omits some compiled objects
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