[issue36398] A possible crash in structseq.c's structseq_repr()

2019-03-21 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue36398] A possible crash in structseq.c's structseq_repr()

2019-03-21 Thread Zackery Spytz


New submission from Zackery Spytz :

If the first PyUnicode_DecodeUTF8() call fails in structseq_repr(), 
_PyUnicodeWriter_Dealloc() will be called on an uninitialized _PyUnicodeWriter.

--
components: Interpreter Core
messages: 338584
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: A possible crash in structseq.c's structseq_repr()
type: crash
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



[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2019-03-21 Thread Yongzhi Pan


Change by Yongzhi Pan :


--
nosy: +fossilet

___
Python tracker 

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



[issue31369] re.RegexFlag is not included in __all__

2019-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I concur with David. This is an imlementation detail. No need to prefix it with 
a _ if the module uses __all__for public names.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36397] re.split() incorrectly splitting on zero-width pattern

2019-03-21 Thread Matthew Barnett


Matthew Barnett  added the comment:

>From the docs:

"""If capturing parentheses are used in pattern, then the text of all groups in 
the pattern are also returned as part of the resulting list."""

The pattern does contain a capture, so that's why the result has additional '1' 
and '2'.

Presumably, Java's split doesn't do that.

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



[issue36397] re.split() incorrectly splitting on zero-width pattern

2019-03-21 Thread Elias Tarhini


New submission from Elias Tarhini :

I believe I've found a bug in the `re` module -- specifically, in the 3.7+ 
support for splitting on zero-width patterns. Compare Java's behavior...

jshell> "1211".split("(?<=(\\d))(?!\\1)(?=\\d)");
$1 ==> String[3] { "1", "2", "11" }

...with Python's:

>>> re.split(r'(?<=(\d))(?!\1)(?=\d)', '1211')
['1', '1', '2', '2', '11']

(The pattern itself is pretty straightforward in design, but regex syntax can 
cloud things, so to be totally clear: it finds any point that follows a digit 
and precedes a *different* digit.)

* Tested on 3.7.1 win10 and 3.7.0 linux.

--
components: Regular Expressions
messages: 338581
nosy: Elias Tarhini, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: re.split() incorrectly splitting on zero-width pattern
type: behavior
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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +12444
stage: commit review -> patch review

___
Python tracker 

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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-21 Thread Terry J. Reedy


New submission from Terry J. Reedy :

The fgBg param of idlelib.config.GetHighlight() is used in only one idlelib 
call.  Two other places could use it, but instead subscript the returned dict.  
Remove the parameter, make the function always return a dict and not a color, 
and have the one fgBg call use a subscript.

--
assignee: terry.reedy
components: IDLE
messages: 338580
nosy: terry.reedy
priority: normal
severity: normal
stage: commit review
status: open
title: Remove fgBg param of idlelib.config.GetHighlight()
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



[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-21 Thread Cameron Simpson


Cameron Simpson  added the comment:

New PR 12490 attached with a fix for test_pdb. More extensive comments are in 
the leading comment on the PR itself. - Cameron

--

___
Python tracker 

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



[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

2019-03-21 Thread Cameron Simpson


Change by Cameron Simpson :


--
pull_requests: +12442

___
Python tracker 

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



[issue14817] pkgutil.extend_path has no tests

2019-03-21 Thread Windson Yang


Windson Yang  added the comment:

I would like to work on this and make a PR.

--
nosy: +Windson Yang
type:  -> enhancement
versions: +Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-03-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +bquinlan, pitrou

___
Python tracker 

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



[issue36395] Add deferred single-threaded/fake executor to concurrent.futures

2019-03-21 Thread Brian McCutchon


New submission from Brian McCutchon :

Currently, it is possible to make a basic single-threaded executor for unit 
testing:

class FakeExecutor(futures.Executor):

  def submit(self, f, *args, **kwargs):
future = futures.Future()
future.set_result(f(*args, **kwargs))
return future

  def shutdown(self, wait=True):
pass

However, this evaluates the provided function eagerly, which may be undesirable 
for tests. It prevents the tests from catching a whole class of errors (those 
where the caller forgot to call .result() on a future that is only desirable 
for its side-effects). It would be great to have an Executor implementation 
where the function is only called when .result() is called so tests can catch 
those errors.

I might add that, while future.set_result is documented as being supported for 
unit tests, a comment in the CPython source says that Future.__init__() "Should 
not be called by clients" 
(https://github.com/python/cpython/blob/master/Lib/concurrent/futures/_base.py#L317),
 suggesting that even the above code is unsupported and leaving me wondering 
how I should test future-heavy code without using mock.patch on everything.

-- Alternatives that don't work --

One might think it possible to create a FakeFuture to do this:

class FakeFuture(object):

  def __init__(self, to_invoke):
self._to_invoke = to_invoke

  def result(self, timeout=None):
return self._to_invoke()

However, futures.wait is not happy with this:

futures.wait([FakeFuture(lambda x: 1)])  # AttributeError: 'FakeFuture' object 
has no attribute '_condition'

If FakeFuture is made to extend futures.Future, the above line instead hangs:

class FakeFuture(futures.Future):

  def __init__(self, to_invoke):
super(FakeFuture, self).__init__()
self._to_invoke = to_invoke

  def result(self, timeout=None):
return self._to_invoke()

I feel like I shouldn't have to patch out wait() in order to get good unit 
tests.

--
messages: 338576
nosy: Brian McCutchon
priority: normal
severity: normal
status: open
title: Add deferred single-threaded/fake executor to concurrent.futures
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



[issue18249] Incorrect and incomplete help docs for close() method

2019-03-21 Thread Andrés Delfino

Andrés Delfino  added the comment:

Closing with Victor Stinner's approval.

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



[issue36394] test_multiprocessing_spawn fails on Windows7 3.x buildbot

2019-03-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue36394] test_multiprocessing_spawn fails on Windows7 3.x buildbot

2019-03-21 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

https://buildbot.python.org/all/#/builders/58/builds/2098/steps/3/logs/stdio

Process Process-2:
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py",
 line 302, in _bootstrap
self.run()
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\multiprocessing\process.py",
 line 99, in run
self._target(*self._args, **self._kwargs)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 4585, in child
join_process(p)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 88, in join_process
support.join_thread(process, timeout=TIMEOUT)
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py",
 line 2244, in join_thread
raise AssertionError(msg)
AssertionError: failed to join the thread in 30.0 seconds
Timeout (0:15:00)!


==
FAIL: test_abort (test.test_multiprocessing_spawn.WithManagerTestBarrier)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\_test_multiprocessing.py",
 line 1765, in test_abort
self.assertEqual(len(results2), self.N-1)
AssertionError: 5 != 4
--
Ran 344 tests in 717.841s
FAILED (failures=1, skipped=40)
1 test failed again:
test_multiprocessing_spawn
== Tests result: FAILURE then FAILURE ==
388 tests OK.

Looks like a race condition, new builds are OK.

--
components: Tests, Windows
messages: 338573
nosy: pablogsal, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn fails on Windows7 3.x buildbot
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



[issue31495] Wrong offset with IndentationError ("expected an indented block")

2019-03-21 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I've retested this under 3.8 and the caret is now positioned at the first 
character in the line, therefore I'm closing this issue as resolved.

--
nosy: +cheryl.sabella
resolution:  -> works for me
stage:  -> resolved
status: open -> closed
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



[issue36256] parser module fails on legal input

2019-03-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue36256] parser module fails on legal input

2019-03-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 00eb97b4a7d9a73b88ed7c76faee4e49204d5a00 by Pablo Galindo (Miss 
Islington (bot)) in branch '3.7':
bpo-36256: Fix bug in parsermodule when parsing if statements (GH-12488)
https://github.com/python/cpython/commit/00eb97b4a7d9a73b88ed7c76faee4e49204d5a00


--

___
Python tracker 

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



[issue36256] parser module fails on legal input

2019-03-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12440

___
Python tracker 

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



[issue32679] concurrent.futures should store full sys.exc_info()

2019-03-21 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +bquinlan, pitrou
versions:  -Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue36256] parser module fails on legal input

2019-03-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9ad15d27361eaa47b77600c7c00a9787a894 by Pablo Galindo in 
branch 'master':
bpo-36256: Fix bug in parsermodule when parsing if statements (GH-12477)
https://github.com/python/cpython/commit/9ad15d27361eaa47b77600c7c00a9787a894


--

___
Python tracker 

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



[issue36393] python user define function is replacing variable value

2019-03-21 Thread Zachary Ware


Change by Zachary Ware :


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



[issue36393] python user define function is replacing variable value

2019-03-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is expected behavior. Please read : 
https://docs.python.org/3/faq/programming.html#why-are-default-values-shared-between-objects
 . Default values are defined when function is created and not for every 
function call and you are having a reference to the returned list that is 
mutated. Also please use a better name for default since list is a built-in 
datatype and can cause confusion.

--
nosy: +xtreak

___
Python tracker 

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



[issue31470] Py_Initialize documentation wrong

2019-03-21 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Issue 32124 changed the documentation to define the C functions that are safe 
to call before Py_Initialize.  I am going to close this with that as a 
superseder.  Please reopen this if that issue didn't address all the concerns.  
Thanks!

--
nosy: +cheryl.sabella
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Document functions safe to be called before Py_Initialize()

___
Python tracker 

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



[issue36393] python user define function is replacing variable value

2019-03-21 Thread Hardik


New submission from Hardik :

I have created function "listappend():"with two arguments.Function can append 
list value with each function call and return updated value. I am trying to 
store this updated value into variable which I can but when I call listappend() 
to update it changes the stored variable value every time when I call a 
function.

You can see in below given example, list value is [10,20,30] and I have stored 
with value 40 in varible x.
so now x is [10,20,30,40]. I called function with new list value with [50] now 
it become [10,20,30,40,50]
and the value of x is replaced with new value.  Even if you store x into a new 
variable and call listappend() again with new value then it will replace the 
value of new variable.  
 
>>> def listappend(a,list=[]):  
... list.append(a)
... return list
... 
>>> listappend(10) 
[10]
>>> listappend(20) 
[10, 20]
>>> listappend(30) 
[10, 20, 30]
>>> x = listappend(40) 
>>> print(x)
[10, 20, 30, 40]
>>> y = listappend(50) 
>>> print(y)
[10, 20, 30, 40, 50]
>>> z = listappend(60) 
>>> print(z)
[10, 20, 30, 40, 50, 60]
>>> print(x)  
[10, 20, 30, 40, 50, 60]
>>> print(y)  
[10, 20, 30, 40, 50, 60]
>>> print(z)
[10, 20, 30, 40, 50, 60]
>>>

--
components: macOS
files: logical Er
messages: 338568
nosy: HardikPatel, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: python user define function is replacing variable value
type: enhancement
versions: Python 3.7
Added file: https://bugs.python.org/file48227/logical Er

___
Python tracker 

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



[issue31369] re.RegexFlag is not included in __all__

2019-03-21 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@ethan.furman, since you had originally added RegexFlag in #28082, do have an 
opinion on this?  Thanks.

--
nosy: +cheryl.sabella, ethan.furman
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



[issue36392] IPv4Interface Object has no attributte prefixlen

2019-03-21 Thread SilentGhost


Change by SilentGhost :


--
nosy: +pmoody

___
Python tracker 

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



[issue32142] heapq.heappop - documentation misleading or doesn't work

2019-03-21 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue35528] [DOC] [LaTeX] Sphinx 2.0 uses GNU FreeFont as default for xelatex

2019-03-21 Thread Cheryl Sabella


Change by Cheryl Sabella :


--
nosy: +mdk

___
Python tracker 

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



[issue36392] IPv4Interface Object has no attributte prefixlen

2019-03-21 Thread Eddgar Rojas


New submission from Eddgar Rojas :

The python the Class IPv4Interface  on the ipaddress module when I try to use 
the .prefixlen attribute it says that do not exist but is i have access by 
using ._prefixlen 

if i have on the IPv4Interface class the .netmask attribute and the .nethost 
attribute Why not the .prefixlen attribute?, 

I reported like a bug as i think that attribute should appear on the 
IPv4Interface Class

Below test I did 

>>> import ipaddress as ip
>>> addr = ip.ip_interface('192.168.1.1/24')
>>> addr.prefixlen
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'IPv4Interface' object has no attribute 'prefixlen'
>>> addr.netmask
IPv4Address('255.255.255.0')

>>> addr._prefixlen
24

--
components: Library (Lib)
messages: 338566
nosy: Eddgar Rojas
priority: normal
severity: normal
status: open
title: IPv4Interface Object has no attributte prefixlen
type: behavior
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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> The proposed PR adds two compile time options: HAVE_UNICODE_WCHAR_CACHE and 
> USE_UNICODE_WCHAR_CACHE

I don't think this is a good approach.  Most projects and developers don't 
recompile Python.  It's especially a chore when you have many dependencies with 
C extensions, because you'll have to recompile them all as well.

I would recommend simply removing that cache.

--
nosy: +pitrou

___
Python tracker 

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



[issue35941] ssl.enum_certificates() regression

2019-03-21 Thread Nikolaos Rangos


Nikolaos Rangos  added the comment:

Hello Steve, I reopened the PR from my code base. I will wait for this PR to be 
processed and afterwards continue with submitting patches.

--

___
Python tracker 

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



[issue35941] ssl.enum_certificates() regression

2019-03-21 Thread Nikolaos Rangos


Change by Nikolaos Rangos :


--
pull_requests: +12439
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



[issue30903] IPv4Network's hostmask attribute doesn't returns string value as mentioned in Documentation.

2019-03-21 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Thank you for the report.  This was fixed as part of PR6021.  There was no bpo 
ticket for that pull request.

--
nosy: +cheryl.sabella
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



[issue35978] test_venv fails in Travis with GCC

2019-03-21 Thread Xavier de Gaye


Change by Xavier de Gaye :


--
nosy: +xdegaye

___
Python tracker 

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



[issue24222] Idle 2.7 -c, -r compile with print as function.

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue24028] Idle: add doc subsection on calltips

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue24028] Idle: add doc subsection on calltips

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -python-dev

___
Python tracker 

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



[issue27239] Make idlelib.macosx self-contained.

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE
nosy:  -python-dev

___
Python tracker 

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



[issue27365] Allow non-ascii chars in IDLE NEWS.txt (for contributor names)

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue22726] Idle: add help to config dialogs

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue27437] IDLE tests must be able to set user configuration values.

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue27380] IDLE: add base Query dialog with ttk widgets

2019-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue36085] Enable better DLL resolution

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:

I added some logging for the AppVeyor build at 
https://ci.appveyor.com/project/python/cpython/builds/23258953

Looks like the offending DLLs are:
- perf-MSSQL$SQL2017-sqlctr14.0.1000.169.dll
- perf-MSSQL$SQL2016-sqlctr13.1.4474.0.dll

Since the events are pulled out in reverse order, I assume the first one is the 
problem. I'll see if I can ping the MSSQL team and find out if they know what's 
going on.

--

___
Python tracker 

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



[issue35978] test_venv fails in Travis with GCC

2019-03-21 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



[issue35941] ssl.enum_certificates() regression

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:

I don't know about your other PRs, and I don't deny they may have been 
neglected for some time, but you only allowed 12 hours on this one between 
receiving a review and closing it. Our team of volunteers have limited time 
(typically 0-8 hours/week) to work on CPython, and a lot of that gets taken up 
with blocking issues - we simply cannot drop everything for every issue or 
contribution that comes in.

If you'd like to restore your branch and reopen the PR, we will get to it 
eventually (unfortunately, all my CPython time today has been taken up by 
writing comments like this, so it won't be today).

Or if someone else would like to make their own PR then we'll look at that one.

--

___
Python tracker 

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



[issue35978] test_venv fails in Travis with GCC

2019-03-21 Thread miss-islington


miss-islington  added the comment:


New changeset b0967fe4ed2e0e15f14ea574f82970a3fd4a5556 by Miss Islington (bot) 
in branch '3.7':
bpo-35978: Correctly skips venv tests in venvs (GH-12220)
https://github.com/python/cpython/commit/b0967fe4ed2e0e15f14ea574f82970a3fd4a5556


--
nosy: +miss-islington

___
Python tracker 

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



[issue35978] test_venv fails in Travis with GCC

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:


New changeset 8bba81fd55873148c65b7d0e6a6effbd63048c76 by Steve Dower in branch 
'master':
bpo-35978: Correctly skips venv tests in venvs (GH-12220)
https://github.com/python/cpython/commit/8bba81fd55873148c65b7d0e6a6effbd63048c76


--

___
Python tracker 

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



[issue35978] test_venv fails in Travis with GCC

2019-03-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12438

___
Python tracker 

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



[issue35941] ssl.enum_certificates() regression

2019-03-21 Thread nr


nr  added the comment:

To be honest, I think the patch is worth to be merged including other patches I 
submitted. Yet I believed it was better to close the pull request because I put 
quite some time into researching and programming the solutions but nobody 
really cared so I stopped. All I received from my work was a "Awaiting merge" 
screen on my laptop. It was really discouraging to see how things work here in 
the python development community so I decided to leave instead of waiting a 
month or more and at the end looking at the "Awaiting to merge" screen or being 
rejected again. Thanks Christian for asking why I closed the PR at last. Just 
look at the date when the patch was submitted until it was put into awaiting 
patch mode again then you see what I mean. If anybody still wants me to submit 
patches please say so instead of completely ignoring me and my work.

--

___
Python tracker 

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



[issue35644] venv doesn't work on Windows when no venvlauncher executable present

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:

Doesn't seem to be anything to fix upstream here.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue36343] Certificate added to Win Store not available

2019-03-21 Thread Christian Herdtweck


Christian Herdtweck  added the comment:

Sorry, right, that is the issue I meant. Continuing there.

--

___
Python tracker 

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



[issue35941] ssl.enum_certificates() regression

2019-03-21 Thread Christian Herdtweck


Christian Herdtweck  added the comment:

Hi, I encountered this problem as well. May I know why you have withdrawn your 
pull request?

--
nosy: +christian-intra2net

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-21 Thread miss-islington


miss-islington  added the comment:


New changeset b058a97c90c3144cc602b719483572916b3918bb by Miss Islington (bot) 
in branch '3.7':
bpo-36245: Avoid problems when building in a directory containing spaces. 
(GH-12241)
https://github.com/python/cpython/commit/b058a97c90c3144cc602b719483572916b3918bb


--
nosy: +miss-islington

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:


New changeset 7ee88bf3e59493137a775368165c5c5fe1ed7f46 by Steve Dower (Jess) in 
branch 'master':
bpo-36245: Avoid problems when building in a directory containing spaces. 
(GH-12241)
https://github.com/python/cpython/commit/7ee88bf3e59493137a775368165c5c5fe1ed7f46


--

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12437

___
Python tracker 

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



[issue36245] PCBuild/build.bat errors, probably from space characters in paths

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:

Fixed for 3.7 and master.

If it needs to go into 2.7 then someone will need to backport it manually.

--
stage: patch review -> backport needed
versions:  -Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue35941] ssl.enum_certificates() regression

2019-03-21 Thread Steve Dower


Change by Steve Dower :


--
assignee: steve.dower -> 
stage: patch review -> needs patch

___
Python tracker 

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



[issue36343] Certificate added to Win Store not available

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:

Yeah, this is a dup of issue35941. I'm not sure why the contributor withdrew 
their PR, but it seems that is what happened.

--
components: +Windows
nosy: +paul.moore, tim.golden, zach.ware
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> ssl.enum_certificates() regression

___
Python tracker 

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



[issue36315] Unable to install Python 3.7.2

2019-03-21 Thread Steve Dower


Steve Dower  added the comment:

It looks like something on your system "cleaned up" the installer while it was 
still running. Sometimes this can be AV or system policies, but there's nothing 
we can fix in the installer for it.

Here are some things you can try (one at a time):

* disable any antivirus scanners while you install
* right-click the installer and select "Run as Administrator" before you start
* deselect the "Install launcher for All Users" option (which should avoid 
needing to elevate)

--

___
Python tracker 

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



[issue36312] Invalid flag for some code page decoders

2019-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue35866] concurrent.futures deadlock

2019-03-21 Thread Hugh Redelmeier


Hugh Redelmeier  added the comment:

I've filed a Fedora bug report that points to this one: 


--

___
Python tracker 

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



[issue36368] server process of shared_memory shuts down if KeyboardInterrupt

2019-03-21 Thread Pierre Glaser


Pierre Glaser  added the comment:

Done.

--

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests:  -12435

___
Python tracker 

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



[issue36368] server process of shared_memory shuts down if KeyboardInterrupt

2019-03-21 Thread Pierre Glaser


Change by Pierre Glaser :


--
pull_requests: +12436
stage:  -> patch review

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-21 Thread Pierre Glaser


Change by Pierre Glaser :


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

___
Python tracker 

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



[issue36268] Change default tar format to modern POSIX 2001 (pax) for better portability/interop, support and standards conformance

2019-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution!

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



[issue36268] Change default tar format to modern POSIX 2001 (pax) for better portability/interop, support and standards conformance

2019-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset e680c3db80efc4a1d637dd871af21276db45ae03 by Serhiy Storchaka (CAM 
Gerlach) in branch 'master':
bpo-36268: Change default tar format to pax from GNU. (GH-12355)
https://github.com/python/cpython/commit/e680c3db80efc4a1d637dd871af21276db45ae03


--

___
Python tracker 

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



[issue36391] XSS in bugs.python.org 404 error page

2019-03-21 Thread SilentGhost


SilentGhost  added the comment:

Thanks for the report, Hanno. The active bugtracker for this instance seems to 
be available at https://github.com/python/bugs.python.org/issues (not that 
anything gets done there, but it won't be here either).

--
nosy: +SilentGhost -docs@python
resolution:  -> third party
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



[issue36085] Enable better DLL resolution

2019-03-21 Thread Zachary Ware


Zachary Ware  added the comment:

I've found AppVeyor's support forum (https://help.appveyor.com/) to be fairly 
responsive; it may be worth asking them about the issue there.

--

___
Python tracker 

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



[issue36391] XSS in bugs.python.org 404 error page

2019-03-21 Thread Hanno Boeck


New submission from Hanno Boeck :

There's an XSS on the 404 error page:

https://bugs.python.org/%3Cimg%20src=x%20onerror=alert(1)%3E

(For lack of a webpage / bug tracker category I chose "Documentation" as the 
closest category I could find)

--
assignee: docs@python
components: Documentation
messages: 338543
nosy: docs@python, hanno
priority: normal
severity: normal
status: open
title: XSS in bugs.python.org 404 error page
type: security

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

> It is better to not use assert(foo && bar). Use instead two separate asserts: 
> assrte(foo) and assert(bar).

Hum, I looked at my PR and I'm not sure that I added such new assertion.

Note: "assert" on calling assert(_PyDict_CheckConsistency(mp)) is only used to 
remove the call in release build, but the function always return 1. The 
function does uses assert() or _PyObject_ASSERT() internally with a different 
line number and the exact failing expression.

Do you want me to enhance existing _PyDict_CheckConsistency() assertions in the 
same PR?

--

___
Python tracker 

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



[issue33622] Fix and improve errors handling in the garbage collector

2019-03-21 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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is better to not use assert(foo && bar). Use instead two separate asserts: 
assrte(foo) and assert(bar).

--

___
Python tracker 

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



[issue36387] Refactor getenvironment() in _winapi.c

2019-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue36387] Refactor getenvironment() in _winapi.c

2019-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-03-21 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Refactoring the methods was relatively straight forward, but I did have some 
questions:

1.  The name `formatregion` could probably be improved.
2.  The `classifyws` method is a module level method in editor.  It's needed in 
`formatregion` also, so I made a copy (bad!).  I would have liked to create a 
`utils.py` for this, but maybe there's a better place for it?  It doesn't just 
operate on text widgets as it is just a string function.  I'm sure there's an 
obvious choice that I'm missing.  See also #4 below.
3.  `tabwidth` and `indentwidth` in `formatregion` are getting the values from 
the editor window.  I thought about adding those to the init for FormatRegion, 
but then they would need to be updated if config changed.  Not sure which way 
would be better.
4.  Other methods in editor might be candidates for moving, such as the 
auto-indent methods (search on `### begin autoindent code ###` in editor) and 
specifically `smart_indent_event`.  Moving more of the indent code to a 
separate module helps with #2 and #3 above, but I wasn't sure how much of the 
text formatting should be moved.  I thought it best to start with the minimal 
change.

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure if I should include an unit test. WIP patch for that:

diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 350ef77163..9c0d0cf41a 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4718,6 +4718,18 @@ negative_refcount(PyObject *self, PyObject 
*Py_UNUSED(args))
 #endif
 
 
+static PyObject *
+corrupted_object(PyObject *self, PyObject *Py_UNUSED(args))
+{
+PyObject *obj = PyList_New(0);
+if (obj == NULL) {
+return NULL;
+}
+obj->ob_type = NULL;
+return obj;
+}
+
+
 static PyMethodDef TestMethods[] = {
 {"raise_exception", raise_exception, METH_VARARGS},
 {"raise_memoryerror",   raise_memoryerror,   METH_NOARGS},
@@ -4948,6 +4960,7 @@ static PyMethodDef TestMethods[] = {
 #ifdef Py_REF_DEBUG
 {"negative_refcount", negative_refcount, METH_NOARGS},
 #endif
+{"corrupted_object", corrupted_object, METH_NOARGS},
 {NULL, NULL} /* sentinel */
 };
 


Tested manually using this script:
---
import gc, _testcapi, sys

gc.enable_object_debugger(1)
x = _testcapi.corrupted_object()
y = []
y = None
# Debugger should trigger here
x = None
---

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, _PyType_CheckConsistency() fails on the following assertion during Python 
finalization:

ASSERT(type->tp_mro != NULL && PyTuple_Check(type->tp_mro));

Error:
---
/home/vstinner/prog/python/master/python: No module named asyncio.__main__; 
'asyncio' is a package and cannot be directly executed
Objects/typeobject.c:149: _PyType_CheckConsistency: Assertion "(type->tp_mro != 
((void *)0) && ((PyObject*)(type->tp_mro))->ob_type))->tp_flags & ((1UL << 
26))) != 0))" failed
Enable tracemalloc to get the memory block allocation traceback

object  : 
type: EnumMeta
refcount: 1
address : 0x9138f0
Fatal Python error: _PyObject_AssertFailed

Current thread 0x77be8740 (most recent call first):
---

gdb traceback:
---
(gdb) where
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x77c0f895 in __GI_abort () at abort.c:79
#2  0x0055bf91 in fatal_error (prefix=0x0, msg=0x68a47d 
"_PyObject_AssertFailed", status=-1) at Python/pylifecycle.c:2088
#3  0x0055bfbd in Py_FatalError (msg=0x68a47d "_PyObject_AssertFailed") 
at Python/pylifecycle.c:2098
#4  0x0047be0f in _PyObject_AssertFailed (obj=, 
expr=0x68d720 "(type->tp_mro != ((void *)0) && 
((PyObject*)(type->tp_mro))->ob_type))->tp_flags & ((1UL << 26))) != 0))", 
msg=0x0, 
file=0x68d632 "Objects/typeobject.c", line=149, function=0x690ba0 
<__func__.14343> "_PyType_CheckConsistency") at Objects/object.c:2197
#5  0x0048ebd8 in _PyType_CheckConsistency (type=0x9138f0) at 
Objects/typeobject.c:149
#6  0x004770a5 in _PyObject_CheckConsistency (op=) at Objects/object.c:35
#7  0x0058de3c in gc_check_object (gc=0x7fffea7a0860) at 
Modules/gcmodule.c:1280
#8  0x0058de90 in _PyGC_CheckAllObjets () at Modules/gcmodule.c:1290
#9  0x0058f4a0 in gc_check_object_debugger () at Modules/gcmodule.c:2007
#10 0x0058f7c7 in PyObject_GC_Del (op=0x7fffea7a27c0) at 
Modules/gcmodule.c:2109
#11 0x00467188 in dict_dealloc (mp=0x7fffea7a27c0) at 
Objects/dictobject.c:1996
#12 0x0047be44 in _Py_Dealloc (op={}) at Objects/object.c:2212
#13 0x00461cce in _Py_DECREF (filename=0x6855a0 "./Include/object.h", 
lineno=533, op={}) at ./Include/object.h:470
#14 0x00461d1c in _Py_XDECREF (op={}) at ./Include/object.h:533
#15 0x00462fef in free_keys_object (keys=0x9120e0) at 
Objects/dictobject.c:580
#16 0x0046284f in dictkeys_decref (dk=0x9120e0) at 
Objects/dictobject.c:324
#17 0x004664f2 in PyDict_Clear (op={}) at Objects/dictobject.c:1722
#18 0x004969b8 in type_clear (type=0x911c50) at 
Objects/typeobject.c:3637
#19 0x00490d03 in subtype_clear (self=) 
at Objects/typeobject.c:1118
#20 0x0058d390 in delete_garbage (collectable=0x7fffcef0, 
old=0x7d2560 <_PyRuntime+416>) at Modules/gcmodule.c:931
#21 0x0058d833 in collect (generation=2, n_collected=0x0, 
n_uncollectable=0x0, nofail=1) at Modules/gcmodule.c:1100
#22 0x0058f175 in _PyGC_CollectNoFail () at Modules/gcmodule.c:1915
#23 0x0054759c in PyImport_Cleanup () at Python/import.c:589
#24 0x0055a442 in Py_FinalizeEx () at Python/pylifecycle.c:1162
#25 0x0055c1e5 in Py_Exit (sts=1) at Python/pylifecycle.c:2188
#26 0x005677fb in handle_system_exit () at Python/pythonrun.c:642
#27 0x00567821 in PyErr_PrintEx (set_sys_last_vars=1) at 
Python/pythonrun.c:652
#28 0x005674c5 in PyErr_Print () at Python/pythonrun.c:548
#29 0x004222f2 in pymain_run_module (modname=0x7db6d0 L"asyncio", 
set_argv0=1) at Modules/main.c:566
#30 0x00422ad6 in pymain_run_python (interp=0x7da350, 
exitcode=0x7fffd254) at Modules/main.c:799
#31 0x00422c6a in pymain_main (args=0x7fffd2a0) at 
Modules/main.c:877
#32 0x00422d4e in _Py_UnixMain (argc=3, argv=0x7fffd3c8) at 
Modules/main.c:922
#33 0x00420796 in main (argc=3, argv=0x7fffd3c8) at 
./Programs/python.c:16
---

Maybe my assumption on tp_mro was wrong. I will remove the assertion.

--

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-03-21 Thread Cheryl Sabella


Change by Cheryl Sabella :


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

___
Python tracker 

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



[issue36390] IDLE: Refactor formatting methods from editor

2019-03-21 Thread Cheryl Sabella


New submission from Cheryl Sabella :

In editor.py, there are several methods (indent, dedent, comment, uncomment, 
tabify, untabify) that are event handlers for formatting text.  To simplify 
testing and to simplify the EditorWindow class, refactor these methods into 
their own method.

This was motivated by issue36219, which is a request for another test 
formatting option.

--
assignee: terry.reedy
components: IDLE
messages: 338537
nosy: cheryl.sabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Refactor formatting methods from editor
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-21 Thread STINNER Victor


New submission from STINNER Victor :

That's the follow-up of a thread that I started on python-dev in June 2018:

  [Python-Dev] Idea: reduce GC threshold in development mode (-X dev)
  https://mail.python.org/pipermail/python-dev/2018-June/153857.html

When an application crash during a garbage collection, we are usually clueless 
about the cause of the crash. The crash usually occur in visit_decref() on a 
corrupted Python object. Sadly, not only there are too many possible reasons 
which can explain why a Python object is corrupted, but the crash usually occur 
too late after the object is corrupted. Using a smaller GC threshold can help, 
but it's not enough.

It would help to be able to enable a builtin checker for corrupted objects. 
Something that we would triggered by the GC with a threshold specified by the 
user and that would have zero impact on performance when it's not used.

The implementation would be to iterate on objects and ensure that they are 
consistent.

Attached PR is an implementation of this idea. It uses new API that I wrote 
recently:

* _PyObject_ASSERT()
* _PyObject_IsFreed()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()
* _PyDict_CheckConsistency()

If an inconsistency is detected, _PyObject_ASSERT() will call _PyObject_Dump() 
to dump info about the object. This function can crash, but well, anything can 
crash on a memory corruption...

--
components: Interpreter Core
messages: 338536
nosy: pablogsal, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Add gc.enable_object_debugger(): detect corrupted Python objects in the 
GC
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue17234] python-2.7.3-r3: crash in visit_decref()

2019-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

The latest message from the reporter was at 2013-08-25: 6 years ago. I don't 
think that we will be able to continue to investigate the issue, so I close it 
as "out of date".

--
nosy: +vstinner
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

> This is because PyUnicode_DecodeFSDefaultAndSize calls 
> _PyInterpreterState_GET_UNSAFE(), which already documents the potential NULL 
> return value. 

_PyInterpreterState_GET_UNSAFE() is preferred over other functions getting the 
interpreter for best performances. _PyInterpreterState_GET_UNSAFE() is the most 
efficient way to access the interpreter. That's why I was talking about the 
cost of additional checks (to detect API misuage) at runtime.

> Understood, happy for this to be closed. Aware that I was misusing the API :-)

I close the issue.

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



[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread anthony shaw


anthony shaw  added the comment:

This is because PyUnicode_DecodeFSDefaultAndSize calls 
_PyInterpreterState_GET_UNSAFE(), which already documents the potential NULL 
return value. 

/* Get the current interpreter state.

   The macro is unsafe: it does not check for error and it can return NULL.

   The caller must hold the GIL.

   See also _PyInterpreterState_Get()
   and _PyGILState_GetInterpreterStateUnsafe(). */
#define _PyInterpreterState_GET_UNSAFE() (_PyThreadState_GET()->interp)

> Python has a *very large* C API. It doesn't seem worth it to me to modify 
> every single Python function to detect when the API is misused.

Understood, happy for this to be closed. Aware that I was misusing the API :-)

--

___
Python tracker 

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



[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm expecting a "this is not a bug, why would the interpreter not be 
> initialized",

this is not a bug, why would the interpreter not be initialized, as documented 
at:
https://docs.python.org/dev/c-api/init.html

> but it would be nice to get a friendly error message since this is a public 
> API.
IF so, am also happy to submit a PR with a fix

Python has a *very large* C API. It doesn't seem worth it to me to modify every 
single Python function to detect when the API is misused.

There is maybe room for some clever tricks for some specific cases. For 
example, modify PyMem_Malloc and PyObject_Malloc default allocators to have an 
implementation with calls Py_FatalError() with a clear error message like 
"Py_Initialize must be called before using the Python C API". I modified Python 
internals to only use PyMem_RawMalloc during early Python initialization, and 
we can reconfigure PyMem_Malloc and PyObject_Malloc during Py_Initialize().

But... according to your backtrace, it wouldn't help for your exact use case: 
call PyUnicode_DecodeFSDefault() before Py_Initialize(). The crash occurs 
before PyMem_Malloc or PyObject_Malloc is called. I don't see any other clever 
tricks which would have no impact on performance when the API is properly used.


... I suggest to close this issue.

--

___
Python tracker 

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



[issue36388] pdb: do_debug installs sys.settrace handler when used inside post_mortem

2019-03-21 Thread daniel hahler


Change by daniel hahler :


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

___
Python tracker 

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



[issue36388] pdb: do_debug installs sys.settrace handler when used inside post_mortem

2019-03-21 Thread daniel hahler

New submission from daniel hahler :

It seems like the "debug" command is not properly handled with "post_mortem()".

It appears due to using `sys.settrace(self.trace_dispatch)` in the end of 
`do_debug`, although no tracing is installed with post_mortem in the first 
place.


More info:

Given the following test script:

```
def exc():
raise Exception()


try:
exc()
except Exception:
import pdb
pdb.post_mortem()
```

The behavior with just "quit" is fine:

```
% python3.8 t_pdb.py
> …/project/t_pdb.py(2)exc()
-> raise Exception()
(Pdb) q
```

But when using `debug` inside of it, it will stop at `cmd.postcmd`, and you 
have to use "continue" twice:

```
% python3.8 t_pdb.py
> …/project/t_pdb.py(2)exc()
-> raise Exception()
(Pdb) debug print(1)
ENTERING RECURSIVE DEBUGGER
> (1)()
((Pdb)) c
1
LEAVING RECURSIVE DEBUGGER
> …/pyenv/3.8-dev/lib/python3.8/cmd.py(159)postcmd()
-> return stop
(Pdb) c
(Pdb) c
```

Also when using `quit` inside of the `debug`:

```
% python3.8 t_pdb.py
> …/project/t_pdb.py(2)exc()
-> raise Exception()
(Pdb) debug print(1)
ENTERING RECURSIVE DEBUGGER
> (1)()
((Pdb)) q
LEAVING RECURSIVE DEBUGGER
> …/pyenv/3.8-dev/lib/python3.8/cmd.py(159)postcmd()
-> return stop
(Pdb) c
(Pdb) c
```

When using `quit` when at `postcmd()` it will even raise `BdbQuit`:

```
% python3.8 t_pdb.py
> …/project/t_pdb.py(2)exc()
-> raise Exception()
(Pdb) debug print(1)
ENTERING RECURSIVE DEBUGGER
> (1)()
((Pdb)) q
LEAVING RECURSIVE DEBUGGER
> …/pyenv/3.8-dev/lib/python3.8/cmd.py(159)postcmd()
-> return stop
(Pdb) q
Traceback (most recent call last):
  File "t_pdb.py", line 6, in 
exc()
  File "t_pdb.py", line 2, in exc
raise Exception()
Exception

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "t_pdb.py", line 9, in 
pdb.post_mortem()
  File "…/pyenv/3.8-dev/lib/python3.8/pdb.py", line 1626, in post_mortem
p.interaction(None, t)
  File "…/pyenv/3.8-dev/lib/python3.8/pdb.py", line 352, in interaction
self._cmdloop()
  File "…/pyenv/3.8-dev/lib/python3.8/pdb.py", line 321, in _cmdloop
self.cmdloop()
  File "…/pyenv/3.8-dev/lib/python3.8/cmd.py", line 139, in cmdloop
stop = self.postcmd(stop, line)
  File "…/pyenv/3.8-dev/lib/python3.8/cmd.py", line 159, in postcmd
return stop
  File "…/pyenv/3.8-dev/lib/python3.8/cmd.py", line 159, in postcmd
return stop
  File "…/pyenv/3.8-dev/lib/python3.8/bdb.py", line 88, in trace_dispatch
return self.dispatch_line(frame)
  File "…/pyenv/3.8-dev/lib/python3.8/bdb.py", line 113, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
```

--
components: Library (Lib)
messages: 338531
nosy: blueyed
priority: normal
severity: normal
status: open
title: pdb: do_debug installs sys.settrace handler when used inside post_mortem
versions: Python 3.9

___
Python tracker 

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



[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2019-03-21 Thread SilentGhost


Change by SilentGhost :


--
nosy: +pmoody
versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.9

___
Python tracker 

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



[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread SilentGhost


Change by SilentGhost :


--
nosy: +vstinner
type:  -> crash

___
Python tracker 

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



[issue36315] Unable to install Python 3.7.2

2019-03-21 Thread Sujoy


Sujoy  added the comment:

Hi Steve,

I have attached the "core_JustForMe" log file

--
Added file: https://bugs.python.org/file48226/Python 3.7.2 
(32-bit)_20190321131450_000_core_JustForMe.log

___
Python tracker 

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



[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread anthony shaw


anthony shaw  added the comment:

I'm expecting a "this is not a bug, why would the interpreter not be 
initialized", but it would be nice to get a friendly error message since this 
is a public API.
IF so, am also happy to submit a PR with a fix

--

___
Python tracker 

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



[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread anthony shaw


anthony shaw  added the comment:

This applies to PyUnicode_EncodeFSDefault as well, it has the same issue

--

___
Python tracker 

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



[issue36387] Refactor getenvironment() in _winapi.c

2019-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.9

___
Python tracker 

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



[issue36346] Prepare for removing the legacy Unicode C API

2019-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Refactor getenvironment() in _winapi.c

___
Python tracker 

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



[issue36387] Refactor getenvironment() in _winapi.c

2019-03-21 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Function getenvironment() in Modules/_winapi.c is used for converting the 
environment mapping to the wchar_t string for passing to CreateProcessW(). It 
performs the following steps:

* Allocate a Py_UCS4 buffer and copy all keys and values, converting them to 
Py_UCS4.
* Create a PyUnicode object from the Py_UCS4 buffer.
* Create a wchar_t buffer from the PyUnicode object (unless it has the UCS2 
kind).

The proposed PR makes it performing a single steps:

* Allocate a wchar_t buffer and copy all keys and values, converting them to 
wchar_t.

This needs less memory allocations and smaller memory consumption. In most 
cases this needs also less and faster memory scans and copies.

In addition, the PR replaces PySequence_Fast C API with faster PyList C API. In 
the past PyMapping_Keys() and PyMapping_Values() could return a tuple in 
unlikely case, but now they always return a list (see issue 28280).

The current code uses the legacy Unicode C API, while the new code uses the 
newer (added in 3.3) wchar_t based Unicode C API, so something similar to this 
change should be made sooner or later.

--
components: Extension Modules
messages: 338527
nosy: lemburg, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Refactor getenvironment() in _winapi.c
versions: Python 3.9

___
Python tracker 

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