[issue36205] Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions

2019-08-25 Thread Ned Deily


Ned Deily  added the comment:

Raynmond:

> Something in the release build process is triggering this behavior (perhaps 
> PGO).

The difference is explained in msg33731. When 3.7+ is built on macoS 10.11.x+ 
and earlier, clock_gettime is not available and the PEP 564 refactored code 
falls back to using getrusage as it did correctly prior to 3.7.  But there 
seems to be a bug in the 3.7 refactored fallback code that gives a result about 
twice as big as seen in the results of either the proposed test case in PR 
12287 or, more simply, the test code in the StackOverflow issue cited above 
(https://stackoverflow.com/questions/55008397/python-3-5-vs-3-7-process-time).  
The pre-PEP 564 code in 3.6.x and earlier works correctly regardless on what 
version of macOS Python was built. 

Since this problem has apparently been around since 3.7.0 with the 
implementation of PEP 564, it should not act as a release blocker for 3.8.0.  
But it *really* needs to be fixed.

Victor, could you please find some time to look at this?  Thanks!

--
assignee:  -> vstinner
priority: release blocker -> critical
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



[issue37945] test_locale failing

2019-08-25 Thread Eryk Sun


Eryk Sun  added the comment:

local.normalize is generally wrong in Windows. It's meant for POSIX systems. 
Currently "tr_TR" is parsed as follows:

>>> locale._parse_localename('tr_TR')
('tr_TR', 'ISO8859-9')

The encoding "ISO8859-9" is meaningless to Windows. Also, the old CRT only ever 
supported either full language/country names or non-standard abbreviations -- 
e.g. either "Turkish_Turkey" or "trk_TUR". Having locale.getdefaultlocale() 
return ISO two-letter codes (e.g. "en_GB") was fundamentally wrong for the old 
CRT. (2.7 will die with this wart.)

3.5+ uses the Universal CRT, which does support standard ISO codes, but only in 
BCP 47 [1] locale names of the following form:

language   ISO 639
["-" script]   ISO 15924
["-" region]   ISO 3166-1

BCP 47 locale names have been preferred by Windows for the past 13 years, since 
Vista was released. Windows extends BCP 47 with a non-standard sort-order field 
(e.g. "de-Latn-DE_phoneb" is the German language with Latin script in the 
region of Germany with phone-book sort order). Another departure from strict 
BCP 47 in Windows is allowing underscore to be used as the delimiter instead of 
hyphen. 

In a concession to existing C code, the Universal CRT also supports an encoding 
suffix in BCP 47 locales, but this can only be either ".utf-8" or ".utf8". 
(Windows itself does not support specifying an encoding in a locale name, but 
it's Unicode anyway.) No other encoding is allowed. If ".utf-8" isn't 
specified, a BCP 47 locale defaults to the locale's ANSI codepage. However, 
there's no way to convey this in the locale name itself. Also, if a locale is 
Unicode only (e.g. Hindi), the CRT implicitly uses UTF-8 even without the 
".utf-8" suffix.

The following are valid BCP 47 locale names in the CRT: "tr", "tr.utf-8", 
"tr-TR", "tr_TR", "tr_TR.utf8", or "tr-Latn-TR.utf-8". But note that 
"tr_TR.1254" is not supported.

The following shows that omitting the optional "utf-8" encoding in a BCP 47 
locale makes the CRT default to the associated ANSI codepage. 

>>> locale.setlocale(locale.LC_CTYPE, 'tr_TR')
'tr_TR'
>>> ucrt.___lc_codepage_func()
1254

C ___lc_codepage_func() queries the codepage of the current locale. We can 
directly query this codepage for a BCP 47 locale via GetLocaleInfoEx:

>>> cpstr = (ctypes.c_wchar * 6)()
>>> kernel32.GetLocaleInfoEx('tr-TR',
... LOCALE_IDEFAULTANSICODEPAGE, cpstr, len(cpstr))
5
>>> cpstr.value
'1254'

If the result is '0', it's a Unicode-only locale (e.g. 'hi-IN' -- Hindi, 
India). Recent versions of the CRT use UTF-8 (codepage 65001) for Unicode-only 
locales:

>>> locale.setlocale(locale.LC_CTYPE, 'hi-IN')
'hi-IN'
>>> ucrt.___lc_codepage_func()
65001

Here are some example locale tuples that should be supported, given that the 
CRT continues to support full English locale names and non-standard 
abbreviations, in addition to the new BCP 47 names:

('tr', None)
('tr_TR', None)
('tr_Latn_TR, None)
('tr_TR', 'utf-8')

('trk_TUR', '1254')
('Turkish_Turkey', '1254')

The return value from C setlocale can be normalized to replace hyphen 
delimiters with underscores, and "utf8" can be normalized as "utf-8". If it's a 
BCP 47 locale that has no encoding, GetLocaleInfoEx can be called to query the 
ANSI codepage. UTF-8 can be assumed if it's a Unicode-only locale. 

As to prefixing a codepage with 'cp', we don't really need to do this. We have 
aliases defined for most, such as '1252' -> 'cp1252'. But if the 'cp' prefix 
does get added, then the locale module should at least know to remove it when 
building a locale name from a tuple.

[1] https://tools.ietf.org/rfc/bcp/bcp47.txt

--

___
Python tracker 

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



[issue13653] reorder set.intersection parameters for better performance

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The anti-correlation algorithm seems like a plausible heuristic but it can't 
really know more than the user does about the semantic content of the sets.  
Also as Terry pointed out, this will have user visible effects.

This likely should be published as a blog post or recipe.  A user can already 
control the pairing order and do this or something like it themselves.  It is 
more of a technique for using sets that it is a core set algorithm (it reminds 
me of using associativity to optimize chained matrix multiplications, though 
than can be done precisely rather than heuristically).

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



[issue37824] IDLE: Handle Shell input warnings properly.

2019-08-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I pulled the part of PR 15311 that works, stop turning Shell SyntaxWarnings 
into SyntaxErrors, into PR-15500, to get it into b4.  I will update the former 
after merging the latter.

--
stage: patch review -> 

___
Python tracker 

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



[issue37824] IDLE: Handle Shell input warnings properly.

2019-08-25 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +15189
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15500

___
Python tracker 

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



[issue37934] Docs: Clarify NotImplemented use cases

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

It is not the purpose of the docs to list use cases.  Mostly we say what 
something does or how it is defined.  As Vedran says, how people use it is 
their own business.

Also, please be careful expanded the docs.  They quickly become a promise.  Per 
Doc/reference/introduction.rst, "It is dangerous to add too many implementation 
details to a language reference document --- the implementation may change, and 
other implementations of the
same language may work differently."

--
nosy: +rhettinger
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue37934] Docs: Clarify NotImplemented use cases

2019-08-25 Thread Vedran Čačić

Vedran Čačić  added the comment:

Well, it is the _intended_ use of NotImplemented. Of course you can use it 
whenever you want, just as you can use Ellipsis whenever you want. But I don't 
think docs should encourage that.

--
nosy: +veky

___
Python tracker 

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



[issue37946] Add the Bessel functions of the first and second kind to the math module

2019-08-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> If they are provided by the C lib, I would love to see them exposed by Python.

Check PR 15497 for an initial version of exposing the libm functions if they 
are available.

> I don't know if they should be treated as optional/platform dependent, or if 
> we should provide an independent implementation.

Even if we want to provide an independent implementation, I would suggest to 
separate the two steps and starting to expose the underliying ones if they are 
available.

--

___
Python tracker 

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



[issue37946] Add the Bessel functions of the first and second kind to the math module

2019-08-25 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

If they are provided by the C lib, I would love to see them exposed by Python.

If they aren't, I don't know if they should be treated as optional/platform 
dependent, or if we should provide an independent implementation. I guess the 
easy way is to just make it optional.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue37947] symtable_handle_namedexpr does not adjust correctly the recursion level

2019-08-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +15188
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15499

___
Python tracker 

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



[issue37947] symtable_handle_namedexpr does not adjust correctly the recursion level

2019-08-25 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The symtable_handle_namedexpr function does not adjust correctly the recursion 
level when exiting (also, is actually not returning anything in a function 
defined as non-void but the return value is not used so is not technically 
undefined behavior).

--
components: Interpreter Core
messages: 350478
nosy: pablogsal
priority: normal
severity: normal
status: open
title: symtable_handle_namedexpr does not adjust correctly the recursion level
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



[issue37946] Add the Bessel functions of the first and second kind to the math module

2019-08-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +15187
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15497

___
Python tracker 

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



[issue37946] Add the Bessel functions of the first and second kind to the math module

2019-08-25 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

After repeatedly having to add 3rd party libraries only for the these functions 
or having to implement them myself quick and dirty based on numerical 
integration, I suggest add the Bessel functions of the first and second kind to 
the math module. These functions tend to appear a lot (but not restricted to) 
when evaluating systems that are defined on cylindrical geometries, 
restrictions or approximations (like the proximate solution to Kepler's 
equation as a truncated Fourier sine series) and many other special functions 
can be described as series involving them.

Based on the fact that many libc implementations include them I think the 
cost-benefit of exposing them when available is acceptable.

--
components: Extension Modules
messages: 350477
nosy: mark.dickinson, pablogsal, rhettinger
priority: normal
severity: normal
status: open
title: Add the Bessel functions of the first and second kind to the math module
type: enhancement
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



[issue32847] Add DirectoryNotEmptyError subclass of OSError

2019-08-25 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
keywords: +patch
pull_requests: +15186
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15496

___
Python tracker 

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



[issue37884] Optimize Fraction() and statistics.mean()

2019-08-25 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Sat, Aug 24, 2019 at 10:09:40AM +, Serhiy Storchaka wrote:

> Could you please explain what is wrong in adding a helper function 
> which will help to convert different types of numbers to integer ratio 
> correctly?
> 
> Currently you need to write a complex code if you need to convert a 
> general number to integer ratio:

When I first wrote the statistics module, I found that converting to
fractions was a bottleneck. I spent some time tweaking the private 
_exact_ratio() function which is why the code is so hairy.

Being able to simplify and speed up that conversion would be great, and 
I thank Serhiy for looking at this.

But I am concerned about the API, writing a *private* helper function in 
the math module, but then using it in the statistics module as if it 
were public. That will surely encourage people to do the same, and 
before long this private helper will have to be treated as public.

--

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-08-25 Thread Eryk Sun


Eryk Sun  added the comment:

The function's doc string also needs to be updated to use the correct field 
names: "user", "system", "children_user", "children_system", and "elapsed".

> And we can also add a link to MSDN.

os.times calls GetProcessTimes [1]. The user and kernel process times are 
incremented in clock ticks, i.e. in integer multiples of the system clock 
interrupt time. QueryUnbiasedInterruptTime [2] could thus be used for the value 
of `elapsed`. 

(Windows doesn't implement a process tree for the children_user and 
children_system values. It has jobs, which are similar to Linux control groups, 
but jobs aren't applicable here. POSIX doesn't have anything like Windows jobs 
or Linux cgroups.)

[1] 
https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getprocesstimes
[2] 
https://docs.microsoft.com/en-us/windows/win32/api/realtimeapiset/nf-realtimeapiset-queryunbiasedinterrupttime

--
nosy: +eryksun

___
Python tracker 

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



[issue23933] Struct module should accept arrays

2019-08-25 Thread Kyle Stanley


Change by Kyle Stanley :


--
nosy: +mark.dickinson, meador.inge

___
Python tracker 

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



[issue23933] Struct module should accept arrays

2019-08-25 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
title: Struct module should acept arrays -> Struct module should accept arrays

___
Python tracker 

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



[issue37827] IDLE: Have the shell mimic terminal handling of \r and \b control characters in outputs

2019-08-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

I agree -- this was added to Emacs a long time ago and it makes a big 
difference for people (like myself) who do a lot of work in Emacs shell 
windows. I imagine it's the same for IDLE.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2019-08-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +15183, 15184
pull_request: https://github.com/python/cpython/pull/15492

___
Python tracker 

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



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2019-08-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +15183, 15184, 15185
pull_request: https://github.com/python/cpython/pull/15492

___
Python tracker 

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



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2019-08-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +15183
pull_request: https://github.com/python/cpython/pull/15492

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2019-08-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 31ea447ffe591736af1d7a3178c0f7ca3eb50d70 by Berker Peksag (Miss 
Islington (bot)) in branch '3.7':
bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups 
(GH-14976)
https://github.com/python/cpython/commit/31ea447ffe591736af1d7a3178c0f7ca3eb50d70


--

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-08-25 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Kyle, thanks for the fix.
> I have basically the same change in my PR but with test and news note.

No problem, that works for me. I was mostly just trying to help with resolving 
some of the release blockers for 3.8b4.

--

___
Python tracker 

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



[issue37806] Infinite recursion with typing.get_type_hints

2019-08-25 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue37945] test_locale failing

2019-08-25 Thread Tim Golden


Tim Golden  added the comment:

Just to save you looking, the code in 
https://github.com/python/cpython/blob/master/Modules/_localemodule.c#L107 
converts the 2-tuple to lang.encoding form so the C module is seeing 
"en_GB.cp1252"

--

___
Python tracker 

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



[issue37945] test_locale failing

2019-08-25 Thread Tim Golden


Tim Golden  added the comment:

Ok; so basically this doesn't work:


import locale
locale.setlocale(locale.LC_CTYPE, locale.getdefaultlocale())


It gives "locale.Error: unsupported locale setting" which comes from 
https://github.com/python/cpython/blob/master/Modules/_localemodule.c#L107

(For locale.getdefaultlocale() you could substitute locale.getlocale() or 
simply ("en_GB", "cp1252")). On my machine it raises that exception on Python 
2.7.15, 3.6.6 and on master. 

Interestingly, none of the other tests in test_locale appear to exercise the 
2-tuple 2nd param to setlocale. When you call setlocale and it returns the 
previous setting, it's a single string, eg "en_GB" etc. Passing that back in 
works. But when you call getlocale, it returns the 2-tuple, eg ("en_GB", 
"cp1252"). But all the other tests use the setlocale-returns-current trick for 
their setup/teardown.

I've quickly tested on 3.5 on Linux and the 2-tuple version works ok. I assume 
it's working on buildbots or we'd see the Turkish test failing every time. So 
is there something different about my C runtime, I wonder?

--

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2019-08-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15182
pull_request: https://github.com/python/cpython/pull/15494

___
Python tracker 

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



[issue29553] Argparser does not display closing parentheses in nested mutex groups

2019-08-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset da27d9b9dc44913ffee8f28d9638985eaaa03755 by Berker Peksag 
(Flavian Hautbois) in branch 'master':
bpo-29553: Fix ArgumentParser.format_usage() for mutually exclusive groups 
(GH-14976)
https://github.com/python/cpython/commit/da27d9b9dc44913ffee8f28d9638985eaaa03755


--

___
Python tracker 

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



[issue37806] Infinite recursion with typing.get_type_hints

2019-08-25 Thread hongweipeng


Change by hongweipeng :


--
keywords: +patch
pull_requests: +15181
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15493

___
Python tracker 

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



[issue37835] typing.get_type_hints wrong namespace for forward-declaration of inner class

2019-08-25 Thread Netzeband


Netzeband  added the comment:

I think I found a better workaround (by accident).

I was debugging another issue with get_type_hints for the case that this 
function is used inside the __new__ method of a metaclass and with methods of 
the class to define. Here the same issue happens: Forward declared type names 
are not inside the namespace of the function.

However, inside the __new__ method of the metaclass, you already know the name 
of the class you want to define and you know the class-object to define. With 
this information it is very easy to add the missing reference to the 
__globals__ list of all methods found in the namespace. 

So the workaround is to use a metaclass, which adds the class-name and 
class-object to the global namespace of the methods of this class. It works 
also in case of classes, which are inherited, from a class, which uses this 
metaclass.

This leads also to a non-workaround solution: Why is the own class not always 
inside the __globals__ list of the methods? Is there a reason? Or is this just 
a missing feature of the python-core?

What are you thinking about this solution? Do you see any issues or 
corner-cases with that?

Working code is attached to this ticket (metaclass_workaround.py)

--
Added file: https://bugs.python.org/file48562/metaclass_workaround.py

___
Python tracker 

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



[issue37945] test_locale failing

2019-08-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, xtreak, zach.ware

___
Python tracker 

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



[issue34014] loop.run_in_executor should propagate current contextvars

2019-08-25 Thread Viktor Kovtun


Viktor Kovtun  added the comment:

Hey, as I see there is no new API yet.

Can we take a look again on 3) ?

I'll be happy to update PR 9688

--

___
Python tracker 

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



[issue37945] test_locale failing

2019-08-25 Thread Tim Golden


New submission from Tim Golden :

On a Win10 machine I'm consistently seeing test_locale (and test__locale) fail. 
I'll attach pythoninfo.

==
ERROR: test_getsetlocale_issue1813 (test.test_locale.TestMiscellaneous)
--
Traceback (most recent call last):
  File "C:\Users\tim\work-in-progress\cpython\lib\test\test_locale.py", line 
531, in test_getsetlocale_issue1813
locale.setlocale(locale.LC_CTYPE, loc)
  File "C:\Users\tim\work-in-progress\cpython\lib\locale.py", line 604, in 
setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting

--
assignee: tim.golden
components: Library (Lib)
files: pythoninfo.txt
messages: 350466
nosy: tim.golden
priority: normal
severity: normal
status: open
title: test_locale failing
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file48561/pythoninfo.txt

___
Python tracker 

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



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2019-08-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests:  -15179

___
Python tracker 

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



[issue17083] can't specify newline string for readline for binary files

2019-08-25 Thread Géry

Change by Géry :


--
nosy: +maggyero

___
Python tracker 

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



[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2019-08-25 Thread Géry

Change by Géry :


--
nosy: +maggyero

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-08-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
keywords: +patch
pull_requests: +15180
pull_request: https://github.com/python/cpython/pull/15492

___
Python tracker 

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



[issue37944] Adjacent escape character in json.load()

2019-08-25 Thread Origami Tobiichi


Origami Tobiichi  added the comment:

I'm sorry that I remove you from list, actually it's my first time to commit an 
issue on there and I'm afraid I used it wrong.

--
nosy: +xtreak

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-08-25 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Kyle, thanks for the fix.
I have basically the same change in my PR but with test and news note.

--

___
Python tracker 

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



[issue34679] asyncio.add_signal_handler call fails if not on main thread

2019-08-25 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

The issue is related to Python 3.8 and master only. 3.6-3.7 are not affected

--
versions: +Python 3.9 -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



[issue34769] _asyncgen_finalizer_hook running in wrong thread

2019-08-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
pull_requests: +15179
pull_request: https://github.com/python/cpython/pull/15492

___
Python tracker 

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



[issue24479] Support LMMS project files in mimetypes.guess_type

2019-08-25 Thread Dong-hee Na


Dong-hee Na  added the comment:

@vstiner

I'd like to work on this issue.
My plan is adding mime-types as 'mmp' to 'application/x-lmms-project'  and 
'mmpz' to 'application/x-lmms-project' 
What do you think?

--
nosy: +corona10

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-25 Thread Nick Coghlan


Nick Coghlan  added the comment:

Merged for 3.8b4 after Emily's review.

Thanks to all involved in the PEP update and change discussion!

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-25 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 6ca030765db49525f16b8fabff4153238148b58d by Nick Coghlan in 
branch '3.8':
[3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details 
(GH-15491)
https://github.com/python/cpython/commit/6ca030765db49525f16b8fabff4153238148b58d


--

___
Python tracker 

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



[issue37938] refactor PyLong_As*() functions

2019-08-25 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-25 Thread Nick Coghlan


Change by Nick Coghlan :


--
pull_requests: +15178
pull_request: https://github.com/python/cpython/pull/15491

___
Python tracker 

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



[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-25 Thread Sergey Fedoseev


Sergey Fedoseev  added the comment:

These last results are invalid :-)

I thought that I was checking _PyLong_FromUnsignedChar() on top of GH-15192, 
but that wasn't true. So the correct results for LTO build are:

$ python -m perf timeit -s "from collections import deque; consume = 
deque(maxlen=0).extend; b = bytes(2**20)" "consume(b)" 
--compare-to=../cpython-master/venv/bin/python
/home/sergey/tmp/cpython-master/venv/bin/python: . 6.93 ms 
+- 0.04 ms
/home/sergey/tmp/cpython-dev/venv/bin/python: . 3.96 ms +- 
0.01 ms
Mean +- std dev: [/home/sergey/tmp/cpython-master/venv/bin/python] 6.93 ms +- 
0.04 ms -> [/home/sergey/tmp/cpython-dev/venv/bin/python] 3.96 ms +- 0.01 ms: 
1.75x faster (-43%)

But the most important thing is that using PyLong_FromUnsignedLong() instead of 
_PyLong_FromUnsignedChar() on top of GH-15192 is producing the same results: 
striter_next() uses small_ints[] directly. However that's not true for 
bytearrayiter_next(): PyLong_FromUnsignedLong() is called there. I think that's 
due to how code is profiled so I'm satisfied with these results more or less.

I'm closing existing PR and probably will close this issue soon after GH-15192 
will be merged.

--

___
Python tracker 

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



[issue37944] Adjacent escape character in json.load()

2019-08-25 Thread Origami Tobiichi


Origami Tobiichi  added the comment:

I hope I have given enough infomations. And I'm not good at English, please 
forgive some of my spell wrong, thanks.

--

___
Python tracker 

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



[issue37944] Adjacent escape character in json.load()

2019-08-25 Thread Origami Tobiichi


Origami Tobiichi  added the comment:

I tried something like this:
```python
print(r'{"foo": "\\\""}') 
print('{"foo": "\\\""}')
print(json.loads(r'{"foo":"\\\""}'))
```
On my machine it output like this:
```
{"foo": "\\\""}
{"foo": "\""}
{'foo': '\\"'}
```

But in most of online json parser, string `{"foo": "\\\""}` will be parsed as 
`{"foo":"\""}`

I'm not a specialist of JSON at all. If the standard of JSON hasn't said 
anything of it, please point it out in Python's Document at least.

When I ask my friend to run the code, he got the same result as me. And my 
friend is using lastest Arch Linux at that time(2019/08/26).

My python version: 3.7.4
System version: Linux 4.19.66-1-MANJARO

--
nosy:  -xtreak
title: About json.load(s -> Adjacent escape character in json.load()

___
Python tracker 

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



[issue37944] About json.load(s

2019-08-25 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Can you please add a description to explain the report?

--
nosy: +xtreak

___
Python tracker 

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



[issue37757] TargetScopeError not raised for comprehension scope conflict

2019-08-25 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 5dbe0f59b7a4f39c7c606b48056bc29e406ebf78 by Nick Coghlan in 
branch 'master':
bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15131)
https://github.com/python/cpython/commit/5dbe0f59b7a4f39c7c606b48056bc29e406ebf78


--

___
Python tracker 

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



[issue37944] About json.load(s

2019-08-25 Thread Origami Tobiichi


Change by Origami Tobiichi :


--
components: Extension Modules
nosy: Origami Tobiichi
priority: normal
severity: normal
status: open
title: About json.load(s
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



[issue37940] Add xml.tool to pretty print XML like json.tool

2019-08-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There are several modules that expose some of their uses through command line 
like json.tool, zipfile, tarfile, gzip, webbrowser etc. The initial proposal 
was to expose the newly added indent function over the command line to provide 
the same guarantees and semantics. The lxml link lead me to have xpath search 
looks more useful to me. I understand that there was always discussion over 
writing few lines of Python code to do the task and to achieve it via command 
line. Recent addition were around 

* --json-lines added to json.tool in issue31553 
* Add --fast, --best to gzip CLI in issue34969

There were similar discussion where improvements were merged on a case by case 
basis as seen to be a good use case. Some where more on the side of rejection 
like --indent to specify indentation length for json.tool in issue29636. There 
was no xml.tool in the past so there is more consideration to this. I see it 
good that xml also can expose some of its tasks via command line and not to be 
left just because it never had a command line interface from the start. The 
command line API also exposes only the functions already present so I see the 
maintenance cost to be minimal with indent and xpath search in this case. I 
will leave it to you as per the examples and use cases mentioned. If it needs a 
wider discussion on posting to python-ideas/discourse I would be okay to start 
a thread .

--

___
Python tracker 

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



[issue30162] Add _PyTuple_Empty and make PyTuple_New(0) never failing

2019-08-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Closed because several commenters found things to not like about it.

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

___
Python tracker 

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



[issue34880] About the "assert" bytecode

2019-08-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Zackery for your contribution.

> where ".AssertionError" is a name-mangled free variable and is assigned once 
> the module is executed.

But this still allows to overriding builtin AssertionError before importing a 
module. And this solution would be much more complex that adding a new opcode.

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



[issue37914] class timedelta, support the method hours and minutes in field accessors

2019-08-25 Thread Elinaldo Monteiro


Elinaldo Monteiro  added the comment:

I am closed my issue.

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

___
Python tracker 

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



[issue36917] ast.NodeVisitor no longer calls visit_Str

2019-08-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +15177
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15490

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-08-25 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Serhiy,

This sounds good.

I will update the PR.

--

___
Python tracker 

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



[issue37805] json.dump(..., skipkeys=True) has no unit tests

2019-08-25 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue31706] urlencode should accept generator as values for mappings when doseq=True

2019-08-25 Thread Tal Einat


Tal Einat  added the comment:

IMO the benefit here is very small and not worth the added complexity 
(implementation + tests + docs + maintenance).

--
nosy: +taleinat

___
Python tracker 

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



[issue37805] json.dump(..., skipkeys=True) has no unit tests

2019-08-25 Thread Dong-hee Na


Change by Dong-hee Na :


--
keywords: +patch
pull_requests: +15176
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15489

___
Python tracker 

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



[issue2506] Add mechanism to disable optimizations

2019-08-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are different optimizations on different levels (AST, bytecode 
generation, peepholer), would be nice to control them separately. This means 
that we should pass a bitset to the compiler.

--

___
Python tracker 

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



[issue25026] (FreeBSD/OSX) Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).

2019-08-25 Thread Dong-hee Na


Dong-hee Na  added the comment:

Can I take a look at this issue?
Is there anything should I care about except update clinic?
Thanks!

--
nosy: +corona10

___
Python tracker 

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



[issue37802] micro-optimization of PyLong_FromSize_t()

2019-08-25 Thread Sergey Fedoseev


Sergey Fedoseev  added the comment:

Previous benchmarks results were obtained with non-LTO build.

Here are results for LTO build:

$ python -m perf timeit -s "from itertools import repeat; _len = repeat(None, 
0).__length_hint__" "_len()" --compare-to=../cpython-master/venv/bin/python 
--duplicate=1000
/home/sergey/tmp/cpython-master/venv/bin/python: . 14.9 ns 
+- 0.2 ns
/home/sergey/tmp/cpython-dev/venv/bin/python: . 13.1 ns +- 
0.5 ns
Mean +- std dev: [/home/sergey/tmp/cpython-master/venv/bin/python] 14.9 ns +- 
0.2 ns -> [/home/sergey/tmp/cpython-dev/venv/bin/python] 13.1 ns +- 0.5 ns: 
1.13x faster (-12%)

$ python -m perf timeit -s "from itertools import repeat; _len = repeat(None, 
2**10).__length_hint__" "_len()" --compare-to=../cpython-master/venv/bin/python 
--duplicate=1000
/home/sergey/tmp/cpython-master/venv/bin/python: . 22.1 ns 
+- 0.1 ns
/home/sergey/tmp/cpython-dev/venv/bin/python: . 20.9 ns +- 
0.4 ns
Mean +- std dev: [/home/sergey/tmp/cpython-master/venv/bin/python] 22.1 ns +- 
0.1 ns -> [/home/sergey/tmp/cpython-dev/venv/bin/python] 20.9 ns +- 0.4 ns: 
1.05x faster (-5%)

$ python -m perf timeit -s "from itertools import repeat; _len = repeat(None, 
2**30).__length_hint__" "_len()" --compare-to=../cpython-master/venv/bin/python 
--duplicate=1000
/home/sergey/tmp/cpython-master/venv/bin/python: . 23.3 ns 
+- 0.0 ns
/home/sergey/tmp/cpython-dev/venv/bin/python: . 21.6 ns +- 
0.1 ns
Mean +- std dev: [/home/sergey/tmp/cpython-master/venv/bin/python] 23.3 ns +- 
0.0 ns -> [/home/sergey/tmp/cpython-dev/venv/bin/python] 21.6 ns +- 0.1 ns: 
1.08x faster (-8%)

$ python -m perf timeit -s "from itertools import repeat; _len = repeat(None, 
2**60).__length_hint__" "_len()" --compare-to=../cpython-master/venv/bin/python 
--duplicate=1000
/home/sergey/tmp/cpython-master/venv/bin/python: . 24.4 ns 
+- 0.1 ns
/home/sergey/tmp/cpython-dev/venv/bin/python: . 22.7 ns +- 
0.1 ns
Mean +- std dev: [/home/sergey/tmp/cpython-master/venv/bin/python] 24.4 ns +- 
0.1 ns -> [/home/sergey/tmp/cpython-dev/venv/bin/python] 22.7 ns +- 0.1 ns: 
1.08x faster (-7%)

--

___
Python tracker 

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



[issue37940] Add xml.tool to pretty print XML like json.tool

2019-08-25 Thread Stefan Behnel


Stefan Behnel  added the comment:

I agree that formatting is not a use case by itself. I like the idea of XPath 
grepping, though, especially *without* pretty printing, i.e. one result per 
line.

I admit that there is no strong reason for adding such a command line tool to 
the stdlib, though.

--

___
Python tracker 

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



[issue34880] About the "assert" bytecode

2019-08-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ce6a070414ed1e1374d1e6212bfbff61b6d5d755 by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)
https://github.com/python/cpython/commit/ce6a070414ed1e1374d1e6212bfbff61b6d5d755


--

___
Python tracker 

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



[issue37942] Generate correct error check for PyFloat_AsDouble

2019-08-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

How large is benefit from special casing exact floats?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-08-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Section 3p is OS specific (Debian and derivatives). `man 3 times` works as well.

But the manpages-posix-dev is not installed by default, so changing this will 
add a regression on Linux.

I thank that it would be better to add both references, times(2) and times(3). 
And we can also add a link to MSDN.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36670] regrtest: win_utils decodes typeperf output from the wrong encoding (test suite broken due to cpu usage feature on win 10/ german)

2019-08-25 Thread Lorenz Mende


Change by Lorenz Mende :


--
keywords: +patch
pull_requests: +15175
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/15488

___
Python tracker 

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



[issue37940] Add xml.tool to pretty print XML like json.tool

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think this should be done:

* Guido didn't want Python to grow into a collection
  of command-line tools
* Browsers like Chrome already provide XML viewers
* If you pretty print JSON, you don't change its meaning,
  but for XML, it adds "text" and "tail" at non-leaf nodes.
  And if leaf text is indented and/or line-wrapped, that
  also changes the stored values.

--

___
Python tracker 

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



[issue37940] Add xml.tool to pretty print XML like json.tool

2019-08-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Thanks Stefan for the link. XPath support sounds cool to me given that there is 
already support in stdlib. It could help with filtering using xml.tool itself 
instead of passing the output to another command to filter. My initial approach 
was to take it from command line --xpath argument and apply it to root node to 
pretty print the elements that match the XPath query. I have pushed the xpath 
changes also to https://github.com/tirkarthi/cpython/tree/bpo14465-xml-tool. I 
will try to add docstrings with xpath examples and tests to raise a PR for this.

# Sample XML

$ python -m xml.tool /tmp/person.xml

  
Idly
  
  
Dosa
  


# Select person with name as Kate

$ python -m xml.tool --xpath './person[@name="Kate"]' /tmp/person.xml

  Idly


# Get all unavailable breakfast items

python -m xml.tool --xpath './/breakfast[@available="false"]' /tmp/person.xml
Dosa


It could also mask the traceback to return error when the XPath is invalid and 
raises exception.


# Error messages

$ python -m xml.tool --xpath './person/[breakfast='Dosa']' /tmp/person.xml
invalid predicate
$ python -m xml.tool --xpath './/[breakfast=Dosa]' /tmp/person.xml
invalid descendant

--

___
Python tracker 

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



[issue37905] Improve docs for NormalDist

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

* Removed external links in overlap() docs
* Removed "same heights" example
* Chose more stable parameters for the Monte Carlo model
* Made the example reproducible by recording a seed value

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



[issue37905] Improve docs for NormalDist

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 970548c00b366dcb8eb0c2bec0ffcab30ba03aee by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-37905: Improve docs for NormalDist (GH-15486) (GH-15487)
https://github.com/python/cpython/commit/970548c00b366dcb8eb0c2bec0ffcab30ba03aee


--

___
Python tracker 

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



[issue37905] Improve docs for NormalDist

2019-08-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15174
pull_request: https://github.com/python/cpython/pull/15487

___
Python tracker 

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



[issue37905] Improve docs for NormalDist

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 8371799e300475c8f9f967e900816218d3500e5d by Raymond Hettinger in 
branch 'master':
bpo-37905: Improve docs for NormalDist (GH-15486)
https://github.com/python/cpython/commit/8371799e300475c8f9f967e900816218d3500e5d


--

___
Python tracker 

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



[issue37905] Improve docs for NormalDist

2019-08-25 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
keywords: +patch
pull_requests: +15173
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15486

___
Python tracker 

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



[issue23423] XPath Support in ElementTree doc omission

2019-08-25 Thread Stefan Behnel


Stefan Behnel  added the comment:

Already fixed in later versions of the documentation:
https://docs.python.org/3/library/xml.etree.elementtree.html#supported-xpath-syntax

Note that Py3.4 is no longer maintained.

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



[issue23423] XPath Support in ElementTree doc omission

2019-08-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +scoder

___
Python tracker 

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



[issue37837] add internal _PyLong_FromUnsignedChar() function

2019-08-25 Thread Greg Price


Greg Price  added the comment:

Very interesting, thanks!

It looks like with LTO enabled, this optimization has no effect at all.

This change adds significant complexity, and it seems like the hoped-for payoff 
is entirely in terms of performance on rather narrowly-focused microbenchmarks. 
 In general I think that sets the bar rather high for making sure the 
performance gains are meaningful enough to justify the increase in complexity 
in the code.

In particular, I expect most anyone running Python and concerned with 
performance to be using LTO.  (It's standard in distro builds of Python, so 
that covers probably most users already.)  That means if the optimization 
doesn't do anything in the presence of LTO, it doesn't really count. ;-)

---

Now, I am surprised at the specifics of the result! I expected that LTO would 
probably pick up the equivalent optimization on its own, so that this change 
didn't have an effect. Instead, it looks like with LTO, this microbenchmark 
performs the same as it does without LTO *before* this change. That suggests 
that LTO may instead be blocking this optimization.

In that case, there may still be an opportunity: if you can work out why the 
change doesn't help under LTO, maybe you can find a way to make this 
optimization happen under LTO after all.

--

___
Python tracker 

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



[issue36205] Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

If it matters, I'm on Mojave 10.14.6

--

___
Python tracker 

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



[issue37929] IDLE: OK sometimes fails to close configdialog

2019-08-25 Thread Tal Einat


Tal Einat  added the comment:

Fixed.

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



[issue36205] Python 3.7 and 3.8 process_time is not reported correctly when built on older macOS versions

2019-08-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Something in the release build process is triggering this behavior (perhaps 
PGO).

I observe the bug on the python.org official 3.8b3 release, official 3.7 
release, but not in the official 3.6 release:

$ python3.8 ~/time_compare.py
Python ('v3.8.0b3:4336222407', 'Jul 29 2019 09:46:03') Clang 6.0 
(clang-600.0.57)
CPU Time: 14.632004 Wall Clock: 7.318585415  Distance: 750
$ python3.7 ~/time_compare.py
Python ('v3.7.4:e09359112e', 'Jul  8 2019 14:54:52') Clang 6.0 (clang-600.0.57)
CPU Time: 16.405296 Wall Clock: 8.2081501  Distance: 750
$ python3.6 ~/time_compare.py
Python ('v3.6.8:3c6b436a57', 'Dec 24 2018 02:04:31') GCC 4.2.1 Compatible Apple 
LLVM 6.0 (clang-600.0.57)
CPU Time: 8.645299 Wall Clock: 8.647321333999571  Distance: 7


However, when I do my own fresh build for 3.8b3, the problem disappears:

$ py ~/time_compare.py
Python ('tags/v3.8.0b3:4336222407', 'Aug 24 2019 23:08:57') Clang 10.0.1 
(clang-1001.0.46.4)
CPU Time: 7.446087 Wall Clock: 7.447327639  Distance: 750

I build with the following process:

make distclean
./configure --with-openssl=$(brew --prefix openssl)
make

--
nosy: +rhettinger

___
Python tracker 

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



[issue37929] IDLE: OK sometimes fails to close configdialog

2019-08-25 Thread miss-islington


miss-islington  added the comment:


New changeset e266d062e017b122b9741db2bd5fb99742378623 by Miss Islington (bot) 
in branch '3.8':
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
https://github.com/python/cpython/commit/e266d062e017b122b9741db2bd5fb99742378623


--

___
Python tracker 

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



[issue37929] IDLE: OK sometimes fails to close configdialog

2019-08-25 Thread miss-islington


miss-islington  added the comment:


New changeset f2b468dd6d0bdbe2e87c0ca7515800a115e95e54 by Miss Islington (bot) 
in branch '3.7':
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
https://github.com/python/cpython/commit/f2b468dd6d0bdbe2e87c0ca7515800a115e95e54


--
nosy: +miss-islington

___
Python tracker 

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



[issue35855] IDLE squeezer: improve unsqueezing and autosqueeze default

2019-08-25 Thread Tal Einat


Tal Einat  added the comment:

See issue #37827 regarding handling of progress output, as written by 
tensorflow.keras for example.

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