[issue4921] Object lifetime and inner recursive function

2018-02-19 Thread Eric Wieser

Eric Wieser  added the comment:

Would it be possible for function self-reference cell vars to be weak 
references?

This wouldn't solve the issue for co-recursive inner functions, but would at 
least prevent reference cycles for the more common case of simple recursive 
functions.

--
nosy: +Eric.Wieser

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Matthias Klose

New submission from Matthias Klose :

The backport of issue #32305 causes regressions in several packaged namespace 
packages:

https://bugs.debian.org/890621
https://bugs.debian.org/890754

while the change is intended, is it appropriate to backport it to 3.6?  Please 
could you have a look, you might still have an appropriate chroot laying around 
;)

--
components: Library (Lib)
keywords: 3.6regression
messages: 312344
nosy: barry, doko, eric.smith
priority: critical
severity: normal
status: open
title: backport of #32305 causes regressions in various packages
type: crash
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



[issue29612] TarFile.extract() suffers from hard links inside tarball

2018-02-19 Thread Joachim Trouverie

Joachim Trouverie  added the comment:

Is there anybody working on this issue or can I create a branch concerning it ?

--
nosy: +jtrouverie

___
Python tracker 

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



[issue32873] Pickling of typing types

2018-02-19 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

In 3.6 typing types are pickled by names:

>>> import pickle, pickletools, typing
>>> pickletools.optimize(pickle.dumps(typing.List))
b'\x80\x03ctyping\nList\n.'
>>> pickletools.dis(pickletools.optimize(pickle.dumps(typing.List)))
0: \x80 PROTO  3
2: cGLOBAL 'typing List'
   15: .STOP
highest protocol among opcodes = 2

The side effect of this is that they are considered atomic by the copy module.

In 3.7 the pickle data contains all private attributes.

>>> pickletools.optimize(pickle.dumps(typing.List))
b'\x80\x03ctyping\n_GenericAlias\n)\x81}(X\x05\x00\x00\x00_inst\x89X\x08\x00\x00\x00_special\x88X\x05\x00\x00\x00_nameX\x04\x00\x00\x00ListX\n\x00\x00\x00__origin__cbuiltins\nlist\nX\x08\x00\x00\x00__args__ctyping\nTypeVar\n)\x81q\x00}(X\x04\x00\x00\x00nameX\x01\x00\x00\x00TX\x05\x00\x00\x00boundNX\x0b\x00\x00\x00constraints)X\x02\x00\x00\x00co\x89X\x06\x00\x00\x00contra\x89ub\x85X\x0e\x00\x00\x00__parameters__h\x00\x85X\t\x00\x00\x00__slots__Nub.'
>>> pickletools.dis(pickletools.optimize(pickle.dumps(typing.List)))
0: \x80 PROTO  3
2: cGLOBAL 'typing _GenericAlias'
   24: )EMPTY_TUPLE
   25: \x81 NEWOBJ
   26: }EMPTY_DICT
   27: (MARK
   28: XBINUNICODE '_inst'
   38: \x89 NEWFALSE
   39: XBINUNICODE '_special'
   52: \x88 NEWTRUE
   53: XBINUNICODE '_name'
   63: XBINUNICODE 'List'
   72: XBINUNICODE '__origin__'
   87: cGLOBAL 'builtins list'
  102: XBINUNICODE '__args__'
  115: cGLOBAL 'typing TypeVar'
  131: )EMPTY_TUPLE
  132: \x81 NEWOBJ
  133: qBINPUT 0
  135: }EMPTY_DICT
  136: (MARK
  137: XBINUNICODE 'name'
  146: XBINUNICODE 'T'
  152: XBINUNICODE 'bound'
  162: NNONE
  163: XBINUNICODE 'constraints'
  179: )EMPTY_TUPLE
  180: XBINUNICODE 'co'
  187: \x89 NEWFALSE
  188: XBINUNICODE 'contra'
  199: \x89 NEWFALSE
  200: uSETITEMS   (MARK at 136)
  201: bBUILD
  202: \x85 TUPLE1
  203: XBINUNICODE '__parameters__'
  222: hBINGET 0
  224: \x85 TUPLE1
  225: XBINUNICODE '__slots__'
  239: NNONE
  240: uSETITEMS   (MARK at 27)
  241: bBUILD
  242: .STOP
highest protocol among opcodes = 2

Unpickling it creates a new object. And I'm not sure all invariants are 
satisfied.

In additional to lesses efficiency and lost of preserving identity, such pickle 
can be incompatible with old Python versions and future Python versions if the 
internal representation of typing types will be changed.

--
components: Library (Lib)
messages: 312346
nosy: gvanrossum, levkivskyi, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Pickling of typing types
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue32388] Remove cross-version binary compatibility

2018-02-19 Thread Stefan Behnel

Change by Stefan Behnel :


--
nosy: +scoder

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2018-02-19 Thread Stefan Behnel

Change by Stefan Behnel :


--
nosy: +scoder

___
Python tracker 

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



[issue32858] Improve OpenSSL ECDH support

2018-02-19 Thread sruester

sruester  added the comment:

AppVeyor build failed for pull request 5707. It looks like there was a problem 
with the build environment.

--

___
Python tracker 

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



[issue31966] [EASY C][Windows] print('hello\n', end='', flush=True) raises OSError when ran with py -u

2018-02-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5531
stage: needs patch -> patch review

___
Python tracker 

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



[issue29116] Make str and bytes error messages on concatenation conform with other sequences

2018-02-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue24159] Misleading TypeError when pickling bytes to a file opened as text

2018-02-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue32858] Improve OpenSSL ECDH support

2018-02-19 Thread Christian Heimes

Christian Heimes  added the comment:

Please split this issue into multiple issues, a bug report for the curve 
configuration bug and a feature request for kxinfo. The bug fix may land in 
2.7, 3.6 and 3.7 while the new feature can only land in 3.8.

Before you start coding, let's figure out an API first. For instance I don't 
like "kxinfo" as method name. It's a) a cryptic name and b) technically wrong 
for TLS 1.3 and PFS suites. Although people refer to DH as key exchange 
protocol, it's really a key agreement protocol. kRSA is a key exchange protocol.

--

___
Python tracker 

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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-02-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have noticed that there are no tests for after() and after_cancel(). Maybe 
first write tests for them and later add a test for this specific issue to them?

--

___
Python tracker 

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



[issue29612] TarFile.extract() suffers from hard links inside tarball

2018-02-19 Thread TROUVERIE Joachim

Change by TROUVERIE Joachim :


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

___
Python tracker 

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



[issue32846] Deletion of large sets of strings is extra slow

2018-02-19 Thread INADA Naoki

INADA Naoki  added the comment:

@Luis, would you try dict instead of set?  It's little larger than set, but 
delete elements by insertion order.

But I don't think builtin data structure can be optimized for such workload.
Maybe, LMBD[1] or some other KVS can help you.

[1]: https://lmdb.readthedocs.io/en/release/

--

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Both of those upstreams should be using `if getattr(module, '__file__', None)` 
instead.  The old behavior was an undocumented quirk.

--

___
Python tracker 

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



[issue23462] All os.exec*e variants crash on Windows

2018-02-19 Thread Steve Dower

Change by Steve Dower :


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



[issue32874] IDLE: Add tests for pyparse

2018-02-19 Thread Cheryl Sabella

New submission from Cheryl Sabella :

Add unit tests for pyparse.py in IDLE.

--
assignee: terry.reedy
components: IDLE
messages: 312352
nosy: csabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Add tests for pyparse
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue32874] IDLE: Add tests for pyparse

2018-02-19 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I also moved existing comments in pyparse.py to be docstrings.

Adding the tests revealed a bug in the initialization of 
self.lastopenbracketpos, but I didn't make any changes to fix it.  With the 
bug, the tests weren't repeatable, so I modified the tests to work with the bug 
in place.

--

___
Python tracker 

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



[issue32874] IDLE: Add tests for pyparse

2018-02-19 Thread Cheryl Sabella

Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue32873] Pickling of typing types

2018-02-19 Thread Guido van Rossum

Guido van Rossum  added the comment:

I think it would be nice it would be pickled by name so the pickles are
compatible between Python versions.

What would we do for List[int]?

How are regular ABCs pickled?

--

___
Python tracker 

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



[issue32873] Pickling of typing types

2018-02-19 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

Here is the situation for 3.6 and before:

Generic classes are all actual class objects, so they are pickled as immutable. 
However this creates a problem, parameterized generics, such as `List[int]` 
_cannot_ be pickled in 3.6 and before, see 
https://github.com/python/typing/issues/511 (and this is something very hard to 
fix).

Here is the situation for 3.7:

Almost no generics are actual class objects, so they are pickled as usual. This 
also fixes the pickling problems in 3.6. However, there is one problematic 
thing, type variables, they should be pickled as immutable (i.e. by name 
reference), but I didn't have time to fix this, this is tracked in 
https://github.com/python/typing/issues/512

What is interesting this issue adds here is an idea that we can treat special 
typing aliases that are conceptually "unique" also as immutable. For example, 
`typing.List` will be pickled as "typing.List", while `typing.List[int]` will 
be pickled as _GenericAlias(, args=(,), ...)

Conveniently, all the special typing aliases are already marked with 
`_special=True`, so the potential solution would be like this:

class _GenericAlias:
...
def __reduce__(self):
if self._special:
return 'typing.' + self._name
return super().__reduce__()

--

___
Python tracker 

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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
assignee:  -> steve.dower

___
Python tracker 

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



[issue32457] Windows Python cannot handle an early PATH entry containing ".." and python.exe

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5534
stage: needs patch -> patch review

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

Eryk's solution seems to be best, so I'll add that.

--
assignee:  -> steve.dower
versions: +Python 3.8

___
Python tracker 

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



[issue32873] Pickling of typing types

2018-02-19 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I think it would be better to pickle `typing.List[int]` as 
`operator.getitem(typing.List, int)`.

def __reduce__(self):
if self._special:
return self._name # __module__ = 'typing'
index = self._args
if len(index) == 1:
index, = index
return operator.getitem, (self._unparametrized, index)

And there may be a special case for Union. I tried to implement this, but it 
seems to me that parametrized type doesn't have a reference to unparametrized 
type, and I don't know this code enough for writing idiomatic code.

--

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Barry A. Warsaw

Change by Barry A. Warsaw :


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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5535
stage: needs patch -> patch review

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Ned Deily

Ned Deily  added the comment:

Now that we know that this change *does* break some existing code, I think it 
is worth having that talk as mentioned in PR 5481:

"I suppose it's possible that this will break existing code, but I'd argue that 
because current behavior runs counter to the documentation and makes no sense 
given the inconsistencies, it is better to fix them. I propose this change be 
applied to 3.7 and 3.6, although if you, my friendly reviewer, disagrees about 
3.6, we can talk about it!"

The question I have is: is the problem the backport is trying to fix severe 
enough to cause package regressions in the middle of a maintenance release 
cycle?  Sure, the third-party packages should be fixed and such a change is 
fine for 3.7 but we also kinda promise that installing a maintenance release 
should be painless.  I don't know what is the right answer and I don't want to 
spend a lot of time on this but I'd like to get a bit more input on this before 
we go ahead with releasing it in 3.6.5.

--
nosy: +brett.cannon, ncoghlan, ned.deily
resolution: wont fix -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Ned Deily

Change by Ned Deily :


--
priority: critical -> release blocker

___
Python tracker 

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



[issue32854] Add ** Map Unpacking Support for namedtuple

2018-02-19 Thread Jay Crotts

Jay Crotts  added the comment:

Thanks Raymond, I wasn't sure if it was a common pattern or not, that makes 
sense.

--

___
Python tracker 

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



[issue32875] Add __exit__() method to event loops

2018-02-19 Thread Victor Porton

New submission from Victor Porton :

Please add `__exit__()` method to event loops, to use them with `with`.

--
components: asyncio
messages: 312360
nosy: asvetlov, porton, yselivanov
priority: normal
severity: normal
status: open
title: Add __exit__() method to event loops
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue31937] Add the term "dunder" to the glossary

2018-02-19 Thread Brett Cannon

Change by Brett Cannon :


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

___
Python tracker 

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



[issue32820] Add bits method to ipaddress

2018-02-19 Thread Eric Osborne

Eric Osborne  added the comment:

I brought it up on python-ideas.  Since I've not been through this process
before - what happens now?  Do I wait for code review on github, or is
there more I need to do?

eric

On Tue, Feb 13, 2018 at 11:56 PM Nick Coghlan 
wrote:

>
> Nick Coghlan  added the comment:
>
> Aye, definitely worth a thread on python-ideas. My rationale for
> suggesting something based on the built-in numeric codes is that it makes
> it straightforward for *users* to transfer knowledge from that
> mini-language.
>
> As far as parsing goes, I was thinking of something along the lines of the
> following naive approach:
>
> typechar = fmt[-1:]
> if not typechar or typechar not in ("b", "n", "x"):
> return super().__format__(fmt)
> prefix, group_sep, suffix = fmt[:-1].rpartition("_")
> if prefix and prefix != "#" or suffix:
> return super().__format__(fmt)
> field_width = self._calculate_field_width(typechar)
> return format(int(self),
> f"{prefix}0{field_width}{group_sep}{type_char}")
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Eric Snow

Eric Snow  added the comment:

@Yury, thanks!  I thought I had checked before I made the PR, but apparently 
not.  I'll git it fixed.

--

___
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

2018-02-19 Thread Zachary Ware

Change by Zachary Ware :


--
pull_requests: +5536

___
Python tracker 

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



[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2018-02-19 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

Thank you for checking. If this issue happens even when Python is run manually 
from an ordinary shell, fixing it in the same way as in #30225 is probably not 
what you want because while the error message will be gone the corresponding 
std stream will be None (sys.stdin in the case that you ktrace'd). However, if 
fd 0 really becomes unusable for some reason, there isn't anything Python can 
do.

Given your description and ktrace log, I can't imagine why fd 0 would behave 
strangely only in Python. I've attached a small C program to check fd 0. Could 
you compile it and run in an infinite loop from the shell in an attempt to 
reproduce this?

--
Added file: https://bugs.python.org/file47451/fstat0.c

___
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

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:


New changeset 5537646bfacec463b450871dde31cb06c44a0556 by Zachary Ware in 
branch 'master':
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
https://github.com/python/cpython/commit/5537646bfacec463b450871dde31cb06c44a0556


--

___
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

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5538

___
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

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5537

___
Python tracker 

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



[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Brett Cannon

Brett Cannon  added the comment:

I'm personally fine if the change gets reverted. I don't think the odd 
behaviour is severe enough to justify breaking projects in a maintenance 
release. Besides, they will learn soon enough about their code breaking in 
Python 3.7.

--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Eric Snow

Eric Snow  added the comment:

I'm not seeing any refleak (on linux/clang).  I'm guessing this is 
Windows-specific (based on use of "./python.exe").  How does 
test_multiprocessing_fork even run on Windows?  I thought "fork" is an 
unsupported start method on Windows (see 
https://docs.python.org/3.7/library/multiprocessing.html#contexts-and-start-methods).

Also, I'm not sure how my change might cause a refleak outside of code using 
the _xxsubinterpreters module.

--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Eric Snow

Eric Snow  added the comment:

Davin, any thoughts on how my most recent commit (for this issue) might be 
causing the leaks Yury found?

--
nosy: +davin

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:

Looks like macOS rather than Windows, and I can't reproduce it locally with 
current master:

14:28 $ ./python.exe -m test -R3:3 test_multiprocessing_fork
Run tests sequentially
0:00:00 load avg: 2.68 [1/1] test_multiprocessing_fork
beginning 6 repetitions
123456
..
test_multiprocessing_fork passed in 9 min 20 sec
1 test OK.

Total duration: 9 min 20 sec
Tests result: SUCCESS



The Windows and Linux refleak buildbots [1] are currently unhappy about other 
things that appear to be unrelated.

[1] http://buildbot.python.org/all/#/builders?tags=%2Brefleak

--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Yury Selivanov

Yury Selivanov  added the comment:

FYI I found out about this refleak from 
https://mail.python.org/pipermail/python-checkins/2018-February/153907.html

So it's definitely not Mac OS X specific thing.

--

___
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

2018-02-19 Thread miss-islington

miss-islington  added the comment:


New changeset ef0bb5c7b76a49a5f3c5b85b5f9112cfefe54328 by Miss Islington (bot) 
in branch '3.6':
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
https://github.com/python/cpython/commit/ef0bb5c7b76a49a5f3c5b85b5f9112cfefe54328


--
nosy: +miss-islington

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:

I'm pretty sure that report is still running on the last changeset on 
hg.python.org; can you confirm that Antoine?

--
nosy: +pitrou

___
Python tracker 

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



[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2018-02-19 Thread Stefan Behnel

Change by Stefan Behnel :


--
nosy: +scoder

___
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

2018-02-19 Thread miss-islington

miss-islington  added the comment:


New changeset 622a824802771fc5aa133ae92101bc8303360294 by Miss Islington (bot) 
in branch '3.7':
bpo-30121: Fix test_subprocess for Windows Debug builds (GH-5758)
https://github.com/python/cpython/commit/622a824802771fc5aa133ae92101bc8303360294


--

___
Python tracker 

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



[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-02-19 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

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



[issue30439] Expose the subinterpreters C-API in the stdlib.

2018-02-19 Thread pmpp

Change by pmpp :


--
nosy: +pmpp

___
Python tracker 

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



[issue32566] Not able to run Python 3.6 on Windows

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
resolution:  -> works for me
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



[issue32877] Login to bugs.python.org with Google account NOT working

2018-02-19 Thread ruffsl

New submission from ruffsl :

I've been unable to login to bugs.python.org using Google's oauth.

After clicking the google oauth logo on the sidebar on bugs.python.org, I am 
either slowly redirected to a google login page (after about 1 min) to select 
an account, then after selecting the relevant google account or if I'm only 
active in it, I'm eventually given a error message after about 2 min of loading 
time:

``` html
An error has occurred
An error has occurred
A problem was encountered processing your request.
The tracker maintainers have been notified of the problem.

```

Other outputs from the browser debug console:
```
Failed to load resource: the server responded with a status of 404 
(/tracker/favicon.ico)
Failed to load resource: the server responded with a status of 500 (Internal 
Server Error)
```
This has persisted for about a week now, on multiple machines, bowsers, and 
ISPs. Presently, the only way I've been able to post this issue at all is due 
to my first and only login session on one workstation is still active. I 
suspect this might be a larger issue, only that no one else using google oauth 
to login has been able to login to file and voise the bug?

Related?
https://bugs.python.org/issue29544
https://bugs.python.org/issue28887

--
messages: 312374
nosy: ruffsl
priority: normal
severity: normal
status: open
title: Login to bugs.python.org with Google account NOT working

___
Python tracker 

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



[issue32874] IDLE: Add tests for pyparse

2018-02-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

My only contact with pyparse has been #21765, which modified hyperparser and 
pyparse to support unicode identifiers.  It also added tests for hyperparser, 
but not pyparse (msg223150: "it seems to be working as expected").  Thanks for 
filling in this hole.

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



[issue32878] Document value of st_ino on Windows

2018-02-19 Thread Guido van Rossum

New submission from Guido van Rossum :

We received a report from a well-meaning security researcher who was confused 
by the non-zero and arbitrary value of st_ino in stat() results on Windows 
(where in Python 2 this was always zero). The researcher was worried that this 
was due to an uninitialized memory read. The actual cause is the way this field 
is filled with arbitary data:
https://github.com/python/cpython/blob/master/Python/fileutils.c#L758

Let's make sure this is documented properly for all versions where we still 
update the docs.

--
assignee: steve.dower
components: Documentation
messages: 312376
nosy: gvanrossum, steve.dower
priority: normal
severity: normal
status: open
title: Document value of st_ino on Windows

___
Python tracker 

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



[issue32873] Pickling of typing types

2018-02-19 Thread Guido van Rossum

Guido van Rossum  added the comment:

I'm honestly not too concerned about what happens with List[int] (though
doing a sensible thing here is not wrong :-), but I feel strongly that a
pickle containing a reference to typing.List should be compatible between
Python 3.6 and 3.7.

--

___
Python tracker 

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



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5539
stage: needs patch -> patch review

___
Python tracker 

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



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
assignee:  -> steve.dower
stage: patch review -> needs patch
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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

I took another look at this and it's still unclear whether it's worth the 
performance loss.

Perhaps moving fsencode and fsdecode (almost) entirely into C would be a better 
approach? That shouldn't send us backwards at all, and all they really do is a 
typecheck and then calling a function that's already written in C.

--
assignee: steve.dower -> 

___
Python tracker 

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



[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Steven D'Aprano

Steven D'Aprano  added the comment:

The stdlib HTML parser requires correct HTML.

To parse broken HTML, as you find in the real world, you need a third-party 
library like BeautifulSoup. BeautifulSoup is much more complex (about 7-8 times 
as many LOC) but can handle nearly anything a browser can.

I doubt the stdlib will ever compete with BeautifulSoup.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Hanno Boeck

Hanno Boeck  added the comment:

Actually BeautifulSoup also uses the python html parser in the backend, so it 
has the same problem. (It can use alternative backends, but the python parser 
is the default and they also describe it as "lenient", which I would interpret 
as "it can handle that".)

--

___
Python tracker 

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



[issue32840] Must install python 3.6.3 when 3.6.4 already installed

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

We confirmed offline that it's not a bug.

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



[issue32876] HTMLParser raises exception on some inputs

2018-02-19 Thread Ezio Melotti

Ezio Melotti  added the comment:

The HTMLParser has been updated to handle HTML5 and should never fail parsing a 
document, so if it raises an error it's probably a bug.

--

___
Python tracker 

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



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
keywords: +patch
pull_requests: +5540
stage: needs patch -> patch review

___
Python tracker 

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



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

Turns out this is a trivial typo in the test, so I stole the issue from Greg 
and pushed a PR.

--
assignee: gregory.p.smith -> steve.dower

___
Python tracker 

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



[issue32870] Documentation typo (2.x only) for deque.remove

2018-02-19 Thread Raymond Hettinger

Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue32870] Documentation typo (2.x only) for deque.remove

2018-02-19 Thread Raymond Hettinger

Change by Raymond Hettinger :


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



[issue32857] tkinter after_cancel does not behave correctly when called with id=None

2018-02-19 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

I had also noticed that the `after` commands didn't have tests.  Did you want 
me to add tests in a separate issue before this one is merged or did you want 
me to add tests under this PR?

Thanks!

--

___
Python tracker 

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



[issue32878] Document value of st_ino on Windows

2018-02-19 Thread Steve Dower

Change by Steve Dower :


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

___
Python tracker 

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



[issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

2018-02-19 Thread Steve Dower

Change by Steve Dower :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Zachary Ware

Zachary Ware  added the comment:

I fixed this independently earlier today, tied to bpo-30121 (the issue that 
introduced the test bug) because I didn't find this one.  See PR5758, PR5759 
(3.7), and PR5760 (3.6).

--

___
Python tracker 

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



[issue32764] Popen doesn't work on Windows when args is a list

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:

Sounds good to me

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Windows: subprocess debug assertion on failure to execute the 
process

___
Python tracker 

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



[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2018-02-19 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

> I think that we can even drop dup-based validation from is_valid_fd()

For POSIX, that is. There is no fstat on Windows, and dup is probably OK there 
(or, even better, dup2(fd, fd) -- no need to close).

--

___
Python tracker 

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



[issue32849] Fatal Python error: Py_Initialize: can't initialize sys standard streams

2018-02-19 Thread Alexey Izbyshev

Alexey Izbyshev  added the comment:

OK, never mind with the test. I've finally got to a FreeBSD box and reproduced 
the problem. It has to do with 'revoke' feature of *BSD. When revoke is called 
on a terminal device (as part of logout process, for example), all descriptors 
associated with it are invalidated. They can be dup'ed, but any I/O (including 
fstat) will fail with EBADF. The attached 'repro.c' demonstrates the same 
behavior as Python in your ktrace log.

# sleep 5; ./repro >&err.txt &
# exit
(login again)
# cat err.txt
isatty: Inappropriate ioctl for device
dup ok: 3
fstat: Bad file descriptor

So it seems that in your case the parent of your Python processes passed a 
descriptor referring to the terminal as fd 0, and then terminal got revoked at 
some point. People have stumbled on that, for example, 
https://bitbucket.org/tildeslash/monit/issues/649/init_env-fails-if-open-2-returns-an

As for Python, it seems OK to fix it as in #30225 since the fd is unusable for 
I/O anyway. I think that we can even drop dup-based validation from 
is_valid_fd() since there is a corner case for Linux too: if a descriptor 
opened with O_PATH inherited as a standard one, dup() will succeed but fstat() 
will fail in kernels before 3.6. And we do fstat() almost immediately after 
is_valid_fd() to get blksize, so the dup-based optimization doesn't seem worth 
the trouble.

Victor, do you have an opinion on that?

--
components: +FreeBSD, IO
nosy: +koobs
versions: +Python 3.7
Added file: https://bugs.python.org/file47452/repro.c

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:


New changeset 6240917b773b52f8883387b9e3a5f327a4372068 by Steve Dower in branch 
'master':
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5757)
https://github.com/python/cpython/commit/6240917b773b52f8883387b9e3a5f327a4372068


--

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5543, 5544

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5543

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5545

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:


New changeset a3d6c1b23b8a49b5003fdbd115d3598fe3d4c4bf by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5765)
https://github.com/python/cpython/commit/a3d6c1b23b8a49b5003fdbd115d3598fe3d4c4bf


--

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Change by Steve Dower :


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



[issue32879] Race condition in multiprocessing Queue

2018-02-19 Thread Simon Bouchard

New submission from Simon Bouchard :

The clear list function call in made after the put(data) on the queue. But the 
data is sometime clear in the queue (randomly). Since both function are call 
within the same process, a race condition is not expected.

--
files: code.py
messages: 312391
nosy: TwistedSim
priority: normal
severity: normal
status: open
title: Race condition in multiprocessing Queue
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47453/code.py

___
Python tracker 

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



[issue32879] Race condition in multiprocessing Queue

2018-02-19 Thread Tim Peters

Tim Peters  added the comment:

The docs could be clearer about this:  the argument to .put() is _not_ pickled 
at the time .put() is called.  The object is remembered (by reference, not by 
value), and a feeder thread pickles the value and puts the pickle on the queue 
when the feeder thread gets around to that.  So if the object is mutated in any 
way in between, it's not defined whether the pre- or post-mutation state is put 
on the queue (or, in some cases, even some partially mutated value).

To make it wholly deterministic you could, e.g., change the .put() to this:

queue.put(data[:])

Or you could use a Manager().Queue() instead, which doesn't use a feeder thread.

--
nosy: +tim.peters

___
Python tracker 

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



[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-02-19 Thread Steve Dower

Steve Dower  added the comment:


New changeset 8e149ff481acbb3889c825b8bf7b10aa191f09a7 by Steve Dower (Miss 
Islington (bot)) in branch '3.6':
bpo-32409: Ensures activate.bat can handle Unicode contents (GH-5766)
https://github.com/python/cpython/commit/8e149ff481acbb3889c825b8bf7b10aa191f09a7


--

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-19 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Pyparse was mostly written in the early 2000s, with the only one code change 
since 2007 in 2014. #32874 will add tests for pyparse 'as is' (though with some 
docstring and comment changes).  This issue will change pyparse code, and 
change or add test as needed.

Here are two items to fix.  More will be added.  Some fixes might be separate 
PRs or spun off into separate issues.

def dump: dump this; print does the same, without hardcoding sys.__stdout__, 
which might be None.

_synchre: Only used in find_good_parse_start. Missing 'if' (mentioned in 
function docstring as 'popular' and 'for' and new things like 'with'. 'async' 
and 'await' are not generally popular, but is not any statement beginning a 
good parse start?

--
assignee: terry.reedy
components: IDLE
messages: 312394
nosy: csabella, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Fix and update and cleanup pyparse
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-19 Thread Zackery Spytz

Change by Zackery Spytz :


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

___
Python tracker 

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



[issue32500] PySequence_Length() raises TypeError on dict type

2018-02-19 Thread Zackery Spytz

Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 3.8

___
Python tracker 

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



[issue31848] "aifc" module does not always initialize "Aifc_read._ssnd_chunk"

2018-02-19 Thread Zackery Spytz

Change by Zackery Spytz :


--
components:  -Tests
nosy: +ZackerySpytz
type: crash -> behavior
versions: +Python 2.7, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Let's consider the todo questions at the end of the class Parser code.
---
# XXX - is this used?
lastopenbracketpos = None

def get_last_open_bracket_pos(self):
"Return index of last open bracket or None."
self._study2()
return self.lastopenbracketpos

# XXX - is this used?
stmt_bracketing = None

def get_last_stmt_bracketing(self):
"""Return a tuple of the structure of the bracketing of the last
interesting statement.

Tuple is in the format defined in _study2().
"""
self._study2()
return self.stmt_bracketing
---

get_last_open_bracket_pos is not called anywhere. TODO remove it.
get_last_stmt_bracketing is called once in hyperparser and could be replaced 
there by 'parser._study2(); parser.stmt_bracketing'. TODO?

Integer lastopenbracketpos is only conditionally set as an instance attribute, 
which masks the class attribute, in _study2 with
if stack:  # of opener indices
self.lastopenbracketpos = stack[-1]

However, self.lastopenbracketpos in only accessed (as 'j') in  
compute_bracket_indent, which is only called when a statement is continued to 
the next line because of an open bracket.  Indeed, the call is guarded by 
assert self.continuation == C_BRACKET  # TODO: move up
So the class binding is never used because it is always masked bebore being 
accessed.  Its value None would raise if it were. (That may have been 
intentional.)  TODO remove it.

Stopping here would break the current tests.  We could make _study2 return the 
index and change test according. Or we can make _study2 always set the 
attribute with (TODO this)
self.lastopenbracketpos = stack[-1] if stack else None
and remove the workaround test lines:
p.lastopenbracketpos = None

Since _study2 unconditionally sets stmt_bracketing as an instance attribute with
self.stmt_bracketing = tuple(bracketing)
and self.stmt_bracketing is only accessed, in the get function above (or 
possibly directly in the future), after such a call, its class setting is also 
useless.  TODO remove it.  No test change needed.

--

___
Python tracker 

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



[issue32820] Add bits method to ipaddress

2018-02-19 Thread Nick Coghlan

Nick Coghlan  added the comment:

The python-ideas discussion didn't turn up any major concerns we hadn't already 
considered, so you're in "wait for PR review" mode now. If you wanted to do a 
self-review in the meantime, then 
https://devguide.python.org/committing/#accepting-pull-requests covers the 
kinds of additional things a reviewer will be looking for.

--

___
Python tracker 

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



[issue32872] backport of #32305 causes regressions in various packages

2018-02-19 Thread Nick Coghlan

Nick Coghlan  added the comment:

+1 from me for making the change 3.7.0+ only - 3.6 isn't doing the right thing, 
but given folks are relying on it doing the wrong thing, then let's leave it 
alone given where it is in its lifecycle.

--

___
Python tracker 

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



[issue32880] IDLE: Fix and update and cleanup pyparse

2018-02-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

set_str sets self.str and self.study_level.  After the first call, attempts to 
access unset instance parse attributes from other modules will raise 
AttributeError.  Removing the unneeded class setting will just add 2 more names 
to the list of things that should not be called directly.  The get_xyz 
functions (get_continuation_type is another) avoid AttributeError (unless 
self.str is not set) and ensure validity.

If set_str is called more than once, instance parse attributes will initially 
be set but invalid.  So it seems they should be either deleted or set to None.  
In the latter case, they should also be set to None initially.  I will look 
more at how the module is used.

--

___
Python tracker 

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



[issue32881] pycapsule:PyObject * is NULL pointer

2018-02-19 Thread zhaoya

New submission from zhaoya :

i have question:call,c-->python-->c. 
1.the c pointer void* abc="123" by pycapsule in the c code.
..
void* lpContext = "abc";
PyObject * lpPyContext = PyCapsule_New(lpContext, "Context",NULL);
..
PyTuple_SetItem(pArgs, 1, lpPyContext);
PyObject* pyResult = PyObject_CallObject(pFunc, pArgs);

2.c call python:

in the python code:
import ctypes
pycapsule = ctypes.windll.LoadLibrary("C:\Users\zhaoya16975\Documents\Visual 
Studio 2017\Projects\cpython\Release\pycapsule.dll")
def test( lpContext,lpRequest,lpAnswer):
print lpContext
pycapsule.hello()
pycapsule.GetContext(lpContext)
.
the lpContest is ""
but,i can't lpContext in the pycapsule.GetContest:
the capsule is null poniter,the GetContext no execute!!

void* FUNCTION_CALL_MODE GetContext(PyObject  *capsule) {
printf(" GetContext..\n");
//if (!PyCapsule_IsValid((PyObject *)capsule, "Context")) {
//  printf(" the Capsule Context is no Valid\n");
//  return NULL;
//}
//return PyCapsule_GetPointer((PyObject *)capsule, "Context");
return NULL;

}


i hope c call python  pass void* ,and python call c pass void* ,but the capsule 
call no success.

--
components: Windows
messages: 312399
nosy: paul.moore, steve.dower, tim.golden, zach.ware, zhaoya
priority: normal
severity: normal
status: open
title: pycapsule:PyObject * is NULL pointer
type: crash
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



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5547

___
Python tracker 

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



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd by Benjamin Peterson 
(Alexey Izbyshev) in branch 'master':
closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
https://github.com/python/cpython/commit/b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd


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



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread miss-islington

Change by miss-islington :


--
pull_requests: +5548

___
Python tracker 

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



[issue32859] os.dup2() tests dup3() availability on each call

2018-02-19 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset bab4fe320ad2e24c1084fd57d2059ef342688aa9 by Benjamin Peterson 
(Miss Islington (bot)) in branch '3.7':
closes bpo-32859: Don't retry dup3() if it is not available at runtime (GH-5708)
https://github.com/python/cpython/commit/bab4fe320ad2e24c1084fd57d2059ef342688aa9


--

___
Python tracker 

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