[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

I confirm the crash using attached bug1.py (first example, completed) and 
bug2.py (second example).

--
Added file: https://bugs.python.org/file47144/bug1.py

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

Changes by STINNER Victor :


Added file: https://bugs.python.org/file47145/bug2.py

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread Stefan Behnel

Stefan Behnel added the comment:

Thanks for confirming, Victor.
I hadn't realised that the first update of expat was already back in June. That 
means it's not ruled out yet as a source of this crash. Bisecting is probably a 
good idea.

--

___
Python tracker 

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



[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-18 Thread Stefan Behnel

Stefan Behnel added the comment:

Question: Do you think it's ok to change the signature of _PyType_Lookup() in 
this way by adding an error flag, or should I add a new function instead?

There is no performance difference to PR 3279 since gcc should optimise this 
flag properly away in most cases, so it's not a question about performance but 
about backwards compatibility. It's an internal, private function, which 
suggests that it should be ok, but it's not my decision. Cython calls it in a 
couple of cases, which I will obviously adapt in the next release, if the 
signature change is accepted.

Should the "no MRO after readying" error case be kept? It's the only 
non-exception error case, setting the error flag to 1. It seems ok to ignore 
this case, so it's not really an error, somehow. I would change it to return 0 
(instead of 1), and thus change the error flag to simply "-1 on error (with 
exception set), 0 on success". Opinions?

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

The bug is at this line:

Breakpoint 6, xmlparser_gc_clear (self=0x77e28c08) at 
/home/haypo/prog/python/master/Modules/_elementtree.c:3414


static int
xmlparser_gc_clear(XMLParserObject *self)
{
EXPAT(ParserFree)(self->parser);   // <--- HERE
...
}

This function calls XML_ParserFree() twice on the same parser object. The first 
call is fine and frees the memory. Since we now use Python memory allocators, 
XML_ParserFree() fills the freed memory with 0xDB byte pattern (when Python is 
in debug mode).

The second XML_ParserFree() call uses freed memory (filled with 0xDB in debug 
mode).

Call 1: a GC collection

Breakpoint 6, xmlparser_gc_clear (self=0x77e28c08) at 
/home/haypo/prog/python/master/Modules/_elementtree.c:3414
(gdb) up
#1  0x00446636 in delete_garbage (collectable=0x7fffd9a0, 
old=0x9b8f90 <_PyRuntime+432>) at Modules/gcmodule.c:759
(gdb) up
#2  0x00446ade in collect (generation=2, n_collected=0x7fffda30, 
n_uncollectable=0x7fffda28, nofail=0) at Modules/gcmodule.c:911
(gdb) cont
Continuing.


Call 2: xmlparser_dealloc()

Breakpoint 6, xmlparser_gc_clear (self=0x77e28c08) at 
/home/haypo/prog/python/master/Modules/_elementtree.c:3414
(gdb) up
#1  0x70038cb8 in xmlparser_dealloc (self=0x77e28c08) at 
/home/haypo/prog/python/master/Modules/_elementtree.c:3435


IMHO it's an obvious bug in Python. The question is more why/how the code 
didn't crash before? :-)

--

___
Python tracker 

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



[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-18 Thread Stefan Behnel

Changes by Stefan Behnel :


--
pull_requests: +3632

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

Python 2.7 is not affected because it doesn't implement tp_clear (it doesn't 
have xmlparser_gc_clear()), only xmlparser_dealloc() calls 
EXPAT(ParserFree)(self->parser).

I'm unable to reproduce the bug in Python 3.5 nor 3.6.

bug2.py creates a reference cycle the "except etree.ParseError as exc: e = exc  
# must keep local reference!" which requires to trigger a garbage collection to 
clear the "parser" variable.

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread Stefan Behnel

Stefan Behnel added the comment:

> The question is more why/how the code didn't crash before? :-)

Typical case of a Schroedinbug.

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PR 3639 adapts the receipt from [1]. I'm not sure that it doesn't add 
regressions on low-DPI displays.

[1] https://wiki.tcl.tk/8488

--

___
Python tracker 

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



[issue17960] Clarify the required behaviour of locals()

2017-09-18 Thread Nick Coghlan

Changes by Nick Coghlan :


--
keywords: +patch
pull_requests: +3635
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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

New submission from Ashok Bakthavathsalam:

"abcde".rindex("") returns 5
"a".rindex("") returns 1 

This is not documented anywhere in the Python documentation.

--
components: Library (Lib)
messages: 302418
nosy: kgashok
priority: normal
severity: normal
status: open
title: Documentation for return value for string.rindex is missing when search 
string is empty
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-18 Thread Nick Coghlan

Changes by Nick Coghlan :


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

___
Python tracker 

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



[issue31021] Clarify programming faq.

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

So, what is the resolution on this?

--
nosy: +kgashok

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Changes by Ashok Bakthavathsalam :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-18 Thread Nick Coghlan

Nick Coghlan added the comment:

https://github.com/python/cpython/pull/3640/files includes a more 
automated-tested-friendly version of Armin's deterministic reproducer (the 
generator loop uses range() to generator a separate loop counter, and then the 
test checks that the incremented closure variable matches that loop counter), 
together with a fix based on the idea of putting actual cell objects into 
frame.f_locals while a trace hook is running. It turned out a lot of the 
necessary machinery was already there, since CPython already uses a common pair 
of utility functions (map_to_dict/dict_to_map) to handle fast locals, cell 
variables, and nonlocal variables.

PEP 558 still needs another editing pass before I send it to python-dev,  and 
the PR needs some additional test cases to explicitly cover the expected 
locals() and frame.f_locals semantics at different scopes when a Python-level 
trace hook is installed, but I'm happy now that this is a reasonable and 
minimalistic way to resolve the original problem.

--
stage: patch review -> 

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

Also, "".rindex("") returns 0

--

___
Python tracker 

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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-18 Thread Nick Coghlan

Changes by Nick Coghlan :


--
dependencies: +Clarify the required behaviour of locals()

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

string.find() also exhibits the same behaviour.

"abcde".find("") -> 5 which also is not documented anywhere.

--

___
Python tracker 

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



[issue17960] Clarify the required behaviour of locals()

2017-09-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Status update: I've posted an initial PR to issue 30744 that relies on the 
trace hook semantic change proposed in the PEP to resolve the trace hook/cell 
reference incompatibility reported there.

That provides confidence that it really is only the semantics of *trace hooks* 
that we need to change, rather than anything about locals() or frame.f_locals 
in general.

So the next steps will be to do a final editing pass on the current PEP to 
account for the reference implementation, and then send it to python-dev for 
official review and pronouncement.

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is documented.

"Return the highest index in the string where substring sub is found,"

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31503] Enhance dir(module) to be informed by __all__ by updating module.__dir__

2017-09-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Yes, that's one of the goals of the feature: to allow module authors to decide 
if they want tab completion for all attributes, or just the public API.

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

>> The question is more why/how the code didn't crash before? :-)
>
> Typical case of a Schroedinbug.

I don't believe in the chaos :-)

I ran a "git bisect" since January 1st, 2017. Attached bug2.py started to crash 
since the following commit related to bpo-29049.
---
5a625d0aa6a6d9ec6574ee8344b41d63dcb9897e is the first bad commit
commit 5a625d0aa6a6d9ec6574ee8344b41d63dcb9897e
Author: INADA Naoki 
Date:   Sat Dec 24 20:19:08 2016 +0900

Issue #29049: Call _PyObject_GC_TRACK() lazily when calling Python function.

Calling function is up to 5% faster.
---

This change is also correct. It's more that the change showed a bug which was 
hidden before.

It's just that now the garbage collector breaks the reference cycle differently 
since frames tracked differently by the GC.

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

The documentation (https://docs.python.org/3/library/stdtypes.html#str.find) 
does not describe what will be the behaviour if the substring is "". 

And by the way, as per 
https://docs.python.org/3/reference/expressions.html#membership-test-operations,
 

Empty strings are always considered to be a substring of any other 
string, so "" in "abc" will return True.

Returning an invalid index value, although confusing, should at least be 
documented in some form.

--

___
Python tracker 

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



[issue31505] assertion failure in _json.make_encoder() in case of a bad encoder() argument

2017-09-18 Thread Oren Milman

New submission from Oren Milman:

The following code causes an assertion failure:

import _json
def _bad_encoder(*args):
return None

enc = _json.make_encoder(None, None, _bad_encoder, None,
 'foo', 'bar', None, None, None)

enc(obj='spam', _current_indent_level=4)


This is because encoder_new() (in Modules/_json.c) assumes that the received
encoder() argument is a function that returns a string, and stores it in the
new PyEncoderObject.
When encoder_encode_string() is called (by encoder_listencode_obj()), it
returns whatever the stored encoder() returned, assuming it returned a string.
Then, encoder_listencode_obj() passes this value to _steal_accumulate(), which
passes it to _PyAccu_Accumulate(), which asserts it is a string.


Similarly, the following code also causes an assertion failure (only the obj
argument is different):

import _json
def _bad_encoder(*args):
return None

enc = _json.make_encoder(None, None, _bad_encoder, None,
 'foo', 'bar', None, None, None)

enc(obj={'spam': 42}, _current_indent_level=4)


In this case, encoder_listencode_dict() passes whatever encoder_encode_string()
returned, to _PyAccu_Accumulate(), which asserts it is a string.

--
components: Extension Modules
messages: 302428
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: assertion failure in _json.make_encoder() in case of a bad encoder() 
argument
type: crash
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



[issue29049] Lazy GC tracking frame

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

FYI this optimization triggered a bug in the tp_clear slot of ElementTree 
parsers, bug which was hidden for years in Python 3: bpo-31499.

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

Attached PR 3641 fixes bug1.py and bug2.py crashes.

Sadly, I failed to write a reliable unit test using bug2.py. The bug requires 
to trigger the garbage collector in a specific order which depends on how 
frames are tracked by the GC...

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



[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-18 Thread Oren Milman

Changes by Oren Milman :


--
title: assertion failure in _json.make_encoder() in case of a bad encoder() 
argument -> assertion failure in json, in case _json.make_encoder() received a 
bad encoder() argument

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Martin Panter

Martin Panter added the comment:

The behaviour for searching for empty strings in Python is inconsistent; see 
Issue 24243. IMO the behaviour for the (r)find/index methods is sensible, but 
it is worth making the documentation explicit.

The returned indexes you have given (5, 1, and 0) are valid for slicing.

--
nosy: +martin.panter

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

def test_issue31499(self):
def test():
...
test()
test.support.gc_collect()

--

___
Python tracker 

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



[issue31496] IDLE: test_configdialog failed

2017-09-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

On windows, hs.see(start), followed or not by update_idletasks(), has no effect.

Does the fix for #31500 fix this also?

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy Storchaka: I tried your pattern, but failed to write a reliable unit 
test. Can you please write a full patch / test?

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Changes by Ashok Bakthavathsalam :


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

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The documentation doesn't mention empty string specially because there is 
nothing special with empty string.

Returned index value is valid. "abcde"[5:5] == "".

Issue24243 is about the case of end < start. Not this case.

I don't see a bug here.

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

I am not saying that there is a bug. As Martin points out, "it is worth making 
the documentation explicit."

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: https://bugs.python.org/file47146/test_issue31499.diff

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

How about 

"abcde"[5]
Traceback (most recent call last):
  File "python", line 1, in 
IndexError: string index out of range

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

5 is not valid index of character, but it is valid index of substring.

IMHO documenting explicitly miscellaneous particular cases which are not 
exceptions of general rules just adds a noise. This makes the documentation 
larger and decrease the chance that it will be read.

--
nosy: +r.david.murray, rhettinger

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Nick Coghlan

New submission from Nick Coghlan:

As described in 
https://blog.lerner.co.il/favorite-terrible-python-error-message/, object_new 
and object_init currently have "object" hardcoded in the error messages they 
raise for excess parameters:


>>> class C: pass
... 
>>> C(10)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object() takes no parameters
>>> c = C()
>>> c.__init__(10)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: object.__init__() takes no parameters

This hardcoding makes sense for the case where that particular method has been 
overridden, and the interpreter is reporting an error in the subclass's call up 
to the base class, rather than in the call to create an instance of the 
subclass:

>>> class D:
... def __init__(self, *args):
... return super().__init__(*args)
... 
>>> D(10)
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __init__
TypeError: object.__init__() takes no parameters


However, it's misleading in the case where object_new is reporting an error 
because it knows object_init hasn't been overridden (or vice-versa), and hence 
won't correctly accept any additional arguments: in those cases, it would be 
far more useful to report "type->tp_name" in the error message, rather than 
hardcoding "object".

If we split the error message logic that way, then the first two examples above 
would become:

>>> class C: pass
... 
>>> C(10)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C() takes no parameters
>>> c = C()
>>> c.__init__(10)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: C.__init__() takes no parameters

while the subclassing cases would be left unchanged.

--
messages: 302439
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Improve the error message logic for object_new & object_init

___
Python tracker 

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



[issue31496] IDLE: test_configdialog failed

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, the fix for issue31500 doesn't affect this issue.

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Nick Coghlan

Changes by Nick Coghlan :


--
components: +Interpreter Core
stage:  -> needs patch
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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Nick Coghlan

Changes by Nick Coghlan :


--
keywords: +easy (C)

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

test_issue31499.diff: Oh great, it works (to reproduce the crash). I modified 
your test and included it in my PR, I added you as a co-author of my PR ;-)

--

___
Python tracker 

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



[issue31507] email.utils.parseaddr has no docstring

2017-09-18 Thread Mark Dickinson

New submission from Mark Dickinson:

While demonstrating email.utils.parseaddr in a recent training course, I 
discovered it had no docstring (see below). This looks as though it should be 
an easy fix for a first-time contributor.

taniyama:Desktop mdickinson$ ipython
Python 3.6.2 (default, Jul 24 2017, 13:17:39) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from email.utils import parseaddr

In [2]: parseaddr?
Signature: parseaddr(addr)
Docstring: 
File:  
/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/email/utils.py
Type:  function

--
components: Library (Lib)
keywords: easy
messages: 302442
nosy: mark.dickinson
priority: normal
severity: normal
status: open
title: email.utils.parseaddr has no docstring
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31505] assertion failure in json, in case _json.make_encoder() received a bad encoder() argument

2017-09-18 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

Look at my suggested changes. It doesn't add noise, IMHO.

All I am saying is that the explicit behaviour needs to be documented. 
I unnecessarily wasted at least 3-4 hours on this "undocumented" behavior.

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Ashok Bakthavathsalam added the comment:

@Storchaka, 

You say `5` is related to the substring. Pray, explain how 5 is related to a 
null substring? Also, from https://bugs.python.org/msg243710, as per the great 
Hettinger:

   Though this is closed as not a bug, feel free to add an example or a 
   mention in the documentation.  Keep it short though.  

That's all I am asking to be included.

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Not sure this is easy issue. It requires taking to account many different cases 
and analyzing many arguments checking code scattered around many files.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Nick Coghlan

Nick Coghlan added the comment:

Fortunately, the logic is already well encapsulated: there's a "if (excess_args 
&& (case A || case B)) {... report error ...}" check at the start of each of 
object_new and object_init, where "case A" = "the other function in the 
object_new/object_init pair has *not* been overriden" and "case B" is "this 
function *has* been overridden".

That means the only change needed is to include the type name in an updated 
error message in case A, while retaining the current error messages for case B.

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset e727d41ffcd91b21ce82026ec8c8381d34a16209 by Victor Stinner in 
branch 'master':
bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (#3641)
https://github.com/python/cpython/commit/e727d41ffcd91b21ce82026ec8c8381d34a16209


--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3639

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It is not so easy to make an error message conforming with error messages for 
similar types. This may require changing error messages in other code.

First, "takes no arguments" instead of "takes no parameters".

For normal __new__ and __init__ you never got "takes no arguments". They  take 
at least one argument -- a class or an instance.

>>> tuple.__new__(tuple, 1, 2, 3, 4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: tuple expected at most 1 arguments, got 4
>>> list.__init__([], 1, 2, 3, 4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: list expected at most 1 arguments, got 4
>>> class C:
... def __new__(cls): return object.__new__(cls)
... def __init__(self): pass
... 
>>> C.__new__(C, 1, 2, 3, 4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __new__() takes 1 positional argument but 5 were given
>>> C.__init__(C(), 1, 2, 3, 4)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __init__() takes 1 positional argument but 5 were given

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Ashok Bakthavathsalam

Changes by Ashok Bakthavathsalam :


--
type: behavior -> enhancement

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 8afd7ab12d7f8915b549cf04af384b495ec73d22 by Victor Stinner (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31499, xml.etree: Fix xmlparser_gc_clear() crash (GH-3641) (#3645)
https://github.com/python/cpython/commit/8afd7ab12d7f8915b549cf04af384b495ec73d22


--

___
Python tracker 

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



[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2017-09-18 Thread Leonardo Francalanci

Leonardo Francalanci added the comment:

That works!
But when I said "also with close_fds=True", I meant that I tried WITHOUT 
overriding stdin, stdout, and stderr AND setting close_fds=True, but it didn't 
work. What worked was not overriding stdin/out/err and adding

os.set_inheritable(0, False)
os.set_inheritable(1, False)
os.set_inheritable(2, False)

before the call (no need to set close_fds)

--

___
Python tracker 

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



[issue31499] ElementTree crash while cleaning up ParseError

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

The bug is now fixed in Python 3.6 and master. Thanks for the bug report and 
analysis, Stefan Behnel!

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



[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread Denis Osipov

Denis Osipov added the comment:

If it's really a bug I could make PR with changes in timemodule.c (in 
gettmarg() and checktm() functions). But I'm not sure that it's not intended 
behavior.

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Nick Coghlan

Nick Coghlan added the comment:

For this issue, I'm not proposing to make any change other than to solve the 
specific problem reported in the blog post: when the method itself isn't 
overridden, then the error message should report the name of the most derived 
class, not "object", to help users more readily find the likely source of their 
problem (a missing "__init__" method definition).

Making these custom errors consistent with Python 3's otherwise improved 
argument unpacking errors would be a separate issue (and I agree *that* change 
wouldn't qualify as being easy).

--

___
Python tracker 

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



[issue31503] Enhance dir(module) to be informed by __all__ by updating module.__dir__

2017-09-18 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-18 Thread STINNER Victor

New submission from STINNER Victor:

0:33:11 load avg: 4.82 [ 44/405/1] test_ttk_guionly passed -- running: 
test_subprocess (504 sec)
/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
beginning 6 repetitions
123456
/buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
./buildbot/buildarea/3.x.ware-gentoo-x86.refleak/build/Lib/tkinter/test/test_ttk/test_widgets.py:1562:
 UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
.

--
components: Tkinter
messages: 302454
nosy: gpolo, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: 
Deprecated API of Treeview.selection() should be removed" warnings
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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Vedran Čačić

Vedran Čačić added the comment:

This is nonsense. 'abcde'[7:7] is also ''. So the maximal index in fact doesn't 
exist. What do you think exactly is the property that differentiates 5 from 7 
here?

--
nosy: +veky

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

I saw these warnings on:
http://buildbot.python.org/all/builders/x86%20Gentoo%20Refleaks%203.x/builds/96/steps/test/logs/stdio

Extract of the pythoninfo:

tkinter.TCL_VERSION: 8.6
tkinter.TK_VERSION: 8.6
tkinter.info_patchlevel: 8.6.6

--

I can reproduce the warning locally:

test_selection (tkinter.test.test_ttk.test_widgets.TreeviewTest) ... 
/home/haypo/prog/python/master/Lib/tkinter/test/test_ttk/test_widgets.py:1562: 
UserWarning: Deprecated API of Treeview.selection() should be removed
  'Deprecated API of Treeview.selection() should be removed')
ok

--

___
Python tracker 

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



[issue31021] Clarify programming faq.

2017-09-18 Thread R. David Murray

R. David Murray added the comment:

I think there is nothing to do here unless Mark likes my suggestion and/or 
someone comes up with an even better improvement.

--

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a reminder to me to remove a deprecated API (see issue27319).

--

___
Python tracker 

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



[issue10496] Python startup should not require passwd entry

2017-09-18 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue31507] email.utils.parseaddr has no docstring

2017-09-18 Thread Krzysztof Warunek

Krzysztof Warunek added the comment:

As well as `parsedate_to_datetime`... I'll work on that

--
nosy: +kwarunek

___
Python tracker 

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



[issue31443] Possibly out of date C extension documentation

2017-09-18 Thread Christian Heimes

Christian Heimes added the comment:

I think it's svnmerge of this commit, which talks about VS 2005. It might have 
been required to support VS 2003 and 2005.

```
 r59290 | christian.heimes | 2007-12-03 14:47:29 +0100 (Mon, 03 Dec 2007) | 3 
lines

  Applied my patch #1455 with some extra fixes for VS 2005
  The new msvc9compiler module supports VS 2005 and VS 2008. I've also fixed 
build_ext to support PCbuild8 and PCbuild9 and backported my fix for xxmodule.c 
from py3k. The old code msvccompiler is still in place in case somebody likes 
to build an extension with VS 2003 or earlier.
  I've also updated the cygwin compiler module for VS 2005 and VS 2008. It 
works with VS 2005 but I'm unable to test it with VS 2008. We have to wait for 
a new version of cygwin.
```

--

___
Python tracker 

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



[issue31507] email.utils.parseaddr has no docstring

2017-09-18 Thread Rohit Balasubramanian

Rohit Balasubramanian added the comment:

I have submitted a pull request for the changes to email.utils.parseaddr.

--
keywords: +patch
nosy: +rohitb
pull_requests: +3640
stage:  -> patch review

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2017-09-18 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What do you expect for:

class C: pass

object.__new__(C, 1)
C.__new__(C, 1)

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The TkFixedFont initially used in Shell and editor has its size set to 10 if 
initially negative. Users can only replace this with a real font, not another 
of tk's abstract fonts.

On windows, the sizes of the nearly 20 fonts touched by the patch range from 8 
to 12.  So no possible regression there.  If the sizes on Linux were in the 
range -8 to -12, then the effect is to replace the size with numbers around 10 
instead of exactly 10 (as IDLE currently does).  But from what you said on the 
patch, the negative numbers are not exactly the negative of their real size, 
but are tuned for positioning.

Cheryy, Louie, and Ned: the patch needs to be test on multiple *nix machines, 
especially on OSX, to make sure it does not mess up on standard monitors.  A 
quick 'git pr 3639' and 'python -m test.test_idle' would be helpful.

--
nosy: +csabella, louielu, ned.deily

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Tests run on Ubuntu.  The menubar is bigger now though, so it's default is
different than before.  Maybe that was the only way to fix it, but it's now
about twice as big as the shell font.

--

___
Python tracker 

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



[issue31508] Running test_ttk_guionly logs "test_widgets.py:1562: UserWarning: Deprecated API of Treeview.selection() should be removed" warnings

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

> This is a reminder to me to remove a deprecated API (see issue27319).

Running tests should not log deprecation warnings.

Either remove the code, or make the warning quiet, no? :-)

--

___
Python tracker 

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



[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread R. David Murray

R. David Murray added the comment:

You have to remember that the most useful way to think about python slice 
indexes is that they point between characters. Consider, for example, that you 
have a starting index of something, and you are looking backward in the string 
for a trailing delimiter:

  >>> x = 'this is  of something'
  >>> x.rfind('>', 9)
  22
  >>> x[9:22]
  'weird example'

So the above is why 5 is different from 7: 5 is the index that you would use in 
a slice if you wanted the string that ended before the match...and the match in 
the null string case is the end of the string.  That is, Python is being 
consistent in this degenerate case.

--

___
Python tracker 

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



[issue31509] test_subprocess hangs randomly on AMD64 Windows10 3.x

2017-09-18 Thread STINNER Victor

New submission from STINNER Victor:

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

0:49:36 [401/405] test_osx_env passed
0:49:38 [402/405] test_fractions passed -- running: test_subprocess (31 sec)
0:49:51 [403/405] test_importlib passed -- running: test_subprocess (44 sec)
0:49:53 [404/405] test_pwd skipped -- running: test_subprocess (46 sec)
test_pwd skipped -- No module named 'pwd'

command timed out: 1200 seconds without output running 
['Tools\\buildbot\\test.bat', '-x64', '-j2', '--timeout', '900'], attempting to 
kill
program finished with exit code 1
elapsedTime=4198.024000

See also bpo-30885.

--
messages: 302467
nosy: haypo
priority: normal
severity: normal
status: open
title: test_subprocess hangs randomly on AMD64 Windows10 3.x
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



[issue31507] email.utils.parseaddr has no docstring

2017-09-18 Thread R. David Murray

R. David Murray added the comment:

Mark: re your training course...if you aren't trying to stay compatible with 
python2, note that python3 has a much more sophisticated address parser now, 
that gets called automatically if you use the new policies.

--
components: +email
nosy: +barry, r.david.murray

___
Python tracker 

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



[issue31510] test_many_processes() of test_multiprocessing_spawn failed on x86-64 Sierra 3.x

2017-09-18 Thread STINNER Victor

New submission from STINNER Victor:

The process was killed (SIGKILL).

See also bpo-30356.

http://buildbot.python.org/all/builders/x86-64%20Sierra%203.x/builds/765/steps/test/logs/stdio

==
FAIL: test_many_processes 
(test.test_multiprocessing_spawn.WithProcessesTestProcess)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-sierra/build/Lib/test/_test_multiprocessing.py",
 line 505, in test_many_processes
self.assertEqual(p.exitcode, -signal.SIGTERM)
AssertionError: -9 != -15

--
components: Tests
messages: 302469
nosy: haypo
priority: normal
severity: normal
status: open
title: test_many_processes() of test_multiprocessing_spawn failed on x86-64 
Sierra 3.x
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



[issue30356] test_mymanager_context() of test_multiprocessing_spawn: manager._process.exitcode=-15 on x86 Windows7 3.x

2017-09-18 Thread STINNER Victor

STINNER Victor added the comment:

Similar issue: bpo-31510.

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Attached screen prints of configdialog.  It's messed up.

--
Added file: https://bugs.python.org/file47147/configdialog_new.png

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Cheryl Sabella

Changes by Cheryl Sabella :


Added file: https://bugs.python.org/file47148/configdialogkeys_old.png

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Cheryl Sabella

Changes by Cheryl Sabella :


Removed file: https://bugs.python.org/file47147/configdialog_new.png

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Cheryl Sabella

Changes by Cheryl Sabella :


Added file: https://bugs.python.org/file47149/configdialogkeys_new.png

___
Python tracker 

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



[issue31498] Default values for zero in time.strftime()

2017-09-18 Thread R. David Murray

R. David Murray added the comment:

Generally we're just reporting whatever the platform strftime does.  Is that 
what happens in this case?

--
nosy: +belopolsky, r.david.murray

___
Python tracker 

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



[issue31511] test_normalization: test.support.open_urlresource() doesn't handle urllib.error.URLError timeout

2017-09-18 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20Debian%20PGO%203.x/builds/1316/steps/test/logs/stdio

==
FAIL: test_main (test.test_normalization.NormalizationTest)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/urllib/request.py",
 line 1316, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_normalization.py",
 line 42, in test_main
check=check_version)
urllib.error.URLError: 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/var/lib/buildbot/slaves/enable-optimizations-bot/3.x.gps-debian-profile-opt.nondebug/build/Lib/test/test_normalization.py",
 line 47, in test_main
self.fail(f"Could not retrieve {TESTDATAURL}")
AssertionError: Could not retrieve 
http://www.pythontest.net/unicode/10.0.0/NormalizationTest.txt

--
components: Tests
messages: 302473
nosy: haypo
priority: normal
severity: normal
status: open
title: test_normalization: test.support.open_urlresource() doesn't handle 
urllib.error.URLError timeout
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



[issue31370] Remove support for threads-less builds

2017-09-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> eventlet also uses dummy_threading

Not sure what you mean by that.  eventlet uses the regular try/except import 
dance around "import threading":

https://github.com/eventlet/eventlet/blob/master/eventlet/support/dns/entropy.py#L20-L23
https://github.com/eventlet/eventlet/blob/master/eventlet/support/dns/resolver.py#L23-L26

As for portage, Arfrever fixed it :-)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=504f66b0e25281e4465ebeceb799c3e54ff2b884

That said, I am not against bringing dummy_threading back, though it would 
sound rather weird to use it unconditionally...

--

___
Python tracker 

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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-18 Thread Nathaniel Smith

Nathaniel Smith added the comment:

Doesn't this proposal break every debugger, including pdb?

--

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2017-09-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
keywords: +patch
pull_requests: +3641
stage: resolved -> patch review

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2017-09-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

https://github.com/python/cpython/pull/3648 restores dummy_threading and 
_dummy_thread, but deprecates them.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2017-09-18 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +3642
stage: resolved -> patch review

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2017-09-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thank you Cheryl.  That is enough to reject the patch is it is now.

The negative sizes are pixels.  I think it might be better to multiply them by 
a systems specific factor, but only when needed.

One might wish that the scaling should be handled automatically, in tkinter if 
not in tk itself.  But it was mentioned in one of the links that displays do 
not always report their dpi correctly.

One possibility is a tkinter calibration app that displays a 500 or 1000 pixel 
line (user selects) and asks the user to input the physical length (centimeters 
or inches).  (Some games do something similar with brightness.)

To check whether a tkinter scaling app could be used, I sized Serhiy's image so 
that the sample font in the Settings Font tab matched the sample font in a real 
box.  The system font around it is tiny but readable, especially with a 
magnifier.

This is a tkinter issue, not only an IDLE issue, but IDLE is a good test app, 
with realistically complex dialogs. Lacking a Python-wide fix, something could 
be added to the Font tab -- for instance a dpi multiplier that defaults to one. 
 It would only be used if not 1.0.

I reread config.IdleConf.GetFont.  Rather than manipulate one of tk's default 
fonts ('TkFixedFont'), it creates a normal font sized in points.  It uses 
'TkFixedFont' as a handy key for finding a system-specific sure-to-exist fixed 
pitch font: "actualFont = Font.actual(f)", where f is a TkFixedFont instance.  
Thus it does not affect the dialogs.

It would be helpful to know if HiDPI screens on Windows have a problem.

#31496 is about test_configdialog failing on the same HiDPI screen.

--

___
Python tracker 

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



[issue31496] IDLE: test_configdialog failed

2017-09-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If the test only fails with a HiDPI screen, then it must somehow be related.  
But if the highlight sample is normal size, like the font sample in
https://bugs.python.org/file47141/Screenshot_20170917_213616.png
then the relationship must not be as simple as I was thinking.

--

___
Python tracker 

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



[issue31036] building the python docs requires the blurb module

2017-09-18 Thread Ned Deily

Ned Deily added the comment:

P.S. I just noticed that I forgot to credit Brett here as the source (from 
superseded PR 2953) of a good portion of the last round of PRs.  Thanks!

--

___
Python tracker 

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



[issue31440] wrong default module search path in help message

2017-09-18 Thread Steve Dower

Steve Dower added the comment:

I don't have time right this second to write it all up, but I did so in the 
past at https://docs.python.org/3/using/windows.html#finding-modules

Hopefully the answer you need is somewhere in that. Module search paths are 
complicated (but eric.snow is going to make it possible to use Python code to 
derive the search path at startup... right Eric? Right? :) )

--
nosy: +eric.snow

___
Python tracker 

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



[issue31484] Cache single-character strings outside of the Latin1 range

2017-09-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Judging by the numbers, this optimization does not sound worth the hassle.  It 
is quite rare to iterate over all characters in a long text while doing so 
little work with them that the cost of iteration is significant.

By the way:

> Sorry for using the word hieroglyphs for Chinese characters. I didn't know 
> how they are named in English.

I think the word you were looking for is "ideogram".

--
nosy: +pitrou

___
Python tracker 

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



[issue31512] Add non-elevated symlink support for dev mode Windows 10

2017-09-18 Thread Vidar Fauske

New submission from Vidar Fauske:

As explained in this Microsoft blogpost 
(https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/), it is 
possible on newer versions of Windows 10 for non-privileged users to create 
symlinks when the machine is in developer mode. However, to ensure backwards 
compatibility, this behavior requires a flag to be passed to the 
CreateSymbolicLink function.

I think this is something that Python can benefit from having. It would go from 
"symlinks on Windows rarely work" to "symlinks on Windows work in developer 
mode (and rarely otherwise)".

I've attached a proof of concept patch to enable this behavior (a Windows 10 
machine with the 'Creators Update' is required to test it). In summary, it 
enables the flag by default, and updates enable_symlink to prevent lacking 
privilege from disabling symlinks on machines in developer mode.

--
components: Library (Lib), Windows
files: devsymlink.patch
keywords: patch
messages: 302482
nosy: paul.moore, steve.dower, tim.golden, vidartf, zach.ware
priority: normal
severity: normal
status: open
title: Add non-elevated symlink support for dev mode Windows 10
type: enhancement
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47150/devsymlink.patch

___
Python tracker 

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



[issue31233] socketserver.ThreadingMixIn leaks running threads after server_close()

2017-09-18 Thread Ned Deily

Changes by Ned Deily :


--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue31151] socketserver.ForkingMixIn.server_close() leaks zombie processes

2017-09-18 Thread Ned Deily

Changes by Ned Deily :


--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue31170] Update to expat 2.2.4 (expat: utf8_toUtf8 cannot properly handle exhausting buffer)

2017-09-18 Thread Ned Deily

Ned Deily added the comment:

I believe all the branches except 3.5 and 3.4 have been updated so adjusting 
the Versions field accordingly.  All yours, Larry!

--
stage: patch review -> commit review
versions:  -Python 3.3, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2017-09-18 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset b43c4caf81b10e5c7ebaeb3a712c6db584f60bbd by Antoine Pitrou in 
branch 'master':
Restore dummy_threading and _dummy_thread, but deprecate them (bpo-31370) 
(#3648)
https://github.com/python/cpython/commit/b43c4caf81b10e5c7ebaeb3a712c6db584f60bbd


--

___
Python tracker 

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



[issue31513] Document structure of memo dictionary to enable more advanced __deepcopy__ uses

2017-09-18 Thread Josh Rosenberg

New submission from Josh Rosenberg:

At present, the documentation for the copy module doesn't document anything 
about the memo dictionary for deepcopy except to say that it must be received 
by custom __deepcopy__ methods and passed along when calling copy.deepcopy, and 
that it is a "dictionary of objects already copied during the current copying 
pass", without specifying what the keys or values are.

Without providing a documented meaning for the keys and values in the memo 
dict, it's impossible to use it in a supported way for more complex cases (e.g. 
a case where the object must be created partially and memoized prior to 
deepcopying attributes that can self-reference). For an example, see this 
StackOverflow answer's approach to using __deepcopy__: 
https://stackoverflow.com/a/46284091/364696

Officially, the line where it does:

memo[id(self)] = newself = self.__class__(copy.deepcopy(self.id, memo))

is not using documented behavior AFAICT; the fact that the memo dict maps 
id()'s of the original objects to the new instance is undocumented. This 
wouldn't be so bad if there were a documented way to achieve the desired 
result, but in recursive cases like these it's the only way to add deepcopy 
support without also adding pickle support.

I'd suggest documenting the current behavior, assuming the current behavior is 
consistent on all alternate Python implementations; I know id() is a little 
funky elsewhere, but I'm not sure there is any other sane implementation.

--
assignee: docs@python
components: Documentation
messages: 302485
nosy: docs@python, josh.r
priority: normal
severity: normal
status: open
title: Document structure of memo dictionary to enable more advanced 
__deepcopy__ uses

___
Python tracker 

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



  1   2   >