[issue37812] Make implicit returns explicit in longobject.c (in CHECK_SMALL_INT)

2019-08-23 Thread Greg Price


Change by Greg Price :


--
pull_requests: +15140
pull_request: https://github.com/python/cpython/pull/15448

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Removed the bogus test -- it was a cut-and-paste error from a scratch file.

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset ef3ccd737020a0bb49ea0bfe48069f89bb5370a1 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-19119: Remove invalid test and rename a misnamed test (GH-15442) (GH-15447)
https://github.com/python/cpython/commit/ef3ccd737020a0bb49ea0bfe48069f89bb5370a1


--

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15139
pull_request: https://github.com/python/cpython/pull/15447

___
Python tracker 

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



[issue19119] duplicate test name in Lib/test/test_heapq.py

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 4101181fd87c2fab6456663d3c8cc99377cf0463 by Raymond Hettinger in 
branch 'master':
bpo-19119: Remove invalid test and rename a misnamed test (GH-15442)
https://github.com/python/cpython/commit/4101181fd87c2fab6456663d3c8cc99377cf0463


--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread Abhilash Raj


Abhilash Raj  added the comment:

I manually created a backport PR for 3.5 and added Larry as a reviewer.

https://github.com/python/cpython/pull/15446

--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread Abhilash Raj


Change by Abhilash Raj :


--
pull_requests: +15138
pull_request: https://github.com/python/cpython/pull/15446

___
Python tracker 

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



[issue14010] deeply nested itertools objects segfault

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Armin]
> It's just one of many places where CPython does a recursion 
> without checking the recursion depth.  CPython still works, 
> based on the resonable assumption that doing such a recursion
> here is obscure.

I agree with that assessment and am going to close this as something we can 
live with (or least have lived with successfully for a long time).  AFAICT, 
this situation doesn't arise in practical code.

It is possible to slow down the language by adding a variant of recursion 
checks to every call to an iterator.  But this just makes the language pay a 
code complexity cost and performance cost for something that doesn't really 
affect real users.  People typically choose itertools for their speed 
(otherwise, plain generators can be clearer).  We shouldn't work against the 
needs of those users.

A robust, clean, and performant solution wouldn't be easy but would likely 
involve some general purpose stack overflow protection that periodically makes 
sure there is enough stack remaining for C Python to function correctly.

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread Ned Deily


Ned Deily  added the comment:

xtreak, would you be willing to make the PR for 3.5?  That will make it easier 
for Larry to decide whether to include it in a 3.5 security release.

--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread Ned Deily


Ned Deily  added the comment:


New changeset f1f9c0c532089824791cfc18e6d6f29e1cd62596 by Ned Deily 
(GeeTransit) in branch '3.6':
[3.6] bpo-37461: Fix typo (inifite -> infinite) (#15432)
https://github.com/python/cpython/commit/f1f9c0c532089824791cfc18e6d6f29e1cd62596


--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread George Zhang


Change by George Zhang :


--
pull_requests: +15137
pull_request: https://github.com/python/cpython/pull/15432

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread Ned Deily


Ned Deily  added the comment:


New changeset 799e4e527019d9429fdef12d08a0c03b08a1fb59 by Ned Deily 
(GeeTransit) in branch '3.7':
[3.7] bpo-37461: Fix typo (inifite -> infinite) (GH-15430)
https://github.com/python/cpython/commit/799e4e527019d9429fdef12d08a0c03b08a1fb59


--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-08-23 Thread George Zhang


Change by George Zhang :


--
pull_requests: +15136
pull_request: https://github.com/python/cpython/pull/15430

___
Python tracker 

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



Re: How to record the console's content in the interpreter?

2019-08-23 Thread jfong
eryk sun於 2019年8月24日星期六 UTC+8上午2時53分56秒寫道:
> On 8/23/19, jf...@ms4.hinet.net  wrote:
> >
> > it won't show output from print command, and "print" is the most
> > command used in a module when a response was needed
> 
> ConEmu is an alternate console for Windows that allows logging all
> console output to a file:
> 
> https://conemu.github.io/en/AnsiLogFiles.html

Thank you for introducing this alternate console for Windows. I have downloaded 
the portable version and will give it a try soon.

--Jach
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to record the console's content in the interpreter?

2019-08-23 Thread jfong
Terry Reedy於 2019年8月23日星期五 UTC+8下午7時27分50秒寫道:
> On 8/23/2019 3:42 AM, jf...@ms4.hinet.net wrote:
> 
> > Say I like to record everything showing in the console into a file
> > after I start a debug session, and stop it when finished. It's not
> > a console redirection. I still need to see what is going on during
> > the session.
> 
> > After a quick try on IPython 6.5.0, I saw only the commands I had typed, 
> > not include the output of those commands:-(
> 
> IDLE saves exactly what you see in the window, including with a shell 
> session.  One can also select and paste into a new editor window and 
> then save.
> 
> 
> 
> -- 
> Terry Jan Reedy

IDLE is the closest one to the command console I currently use. The mouse used 
in its shell really helps on my requirement:-) Thank you for reminding.

--Jach
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue19119] duplicate test name in Lib/test/test_heapq.py

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15135
pull_request: https://github.com/python/cpython/pull/15442

___
Python tracker 

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



[issue35235] Access violation on alloc in Windows x86-64 python, pymalloc_alloc

2019-08-23 Thread Victor Milovanov


Victor Milovanov  added the comment:

In my case it always happens in pymalloc_alloc when size == 5, e.g. when 
accessing usedpools[10].
Specifically freeblock pointer in usedpools[10] is wy off (essentially, 
seemingly random number looking like 0xX000) where it is supposed to be 
(e.g. very far from usedpools[10]). Surprisingly, all the other fields in 
usedpool[10] seem to have normal values.

I could not find any place in obmalloc.c where this value would be set, so it 
seems to be a memory corruption caused by something else.

--

___
Python tracker 

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



[issue35235] Access violation on alloc in Windows x86-64 python, pymalloc_alloc

2019-08-23 Thread Victor Milovanov


Victor Milovanov  added the comment:

This reproduces stably for me when running unit tests in Python.NET project at 
commit 5e276d9.

--
nosy: +Victor Milovanov

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-08-23 Thread Open Close


Open Close  added the comment:

For me, since GH-14080, It's been fixed. (arch linux)

--

___
Python tracker 

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



[issue34259] Improve docstring of list.sort

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue17794] Add a key parameter to PriorityQueue

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Starting in Python 3.7, dataclasses made it trivially easy to work around this 
issue.  The PriorityQueue docs have a worked out example of how to do this: 
https://docs.python.org/3/library/queue.html#queue.PriorityQueue

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



[issue9985] difflib.SequenceMatcher has slightly buggy and undocumented caching behavior

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This was fixed for Python 2.7 and Python 3.4 and later.

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



Re: installation 3.7.3

2019-08-23 Thread MRAB

On 2019-08-23 15:33, Marilynn Huret wrote:

Having problems trying to install 3.7.3 with IDLE on a windows 7. When I
try to run it, get a message that a .DLL is missing

Am reviewing a book for Manning -"hello World" by Sande, third edition
and have tried different install options
Can you help?


Which DLL?

If it's complaining about this "api-ms-win-crt-runtime-l1-1-0.dll", then
you need the Windows Universal C Runtime:

http://www.microsoft.com/en-us/download/details.aspx?id=48234
--
https://mail.python.org/mailman/listinfo/python-list


installation 3.7.3

2019-08-23 Thread Marilynn Huret
   Having problems trying to install 3.7.3 with IDLE on a windows 7. When I
   try to run it, get a message that a .DLL is missing

   Am reviewing a book for Manning -"hello World" by Sande, third edition 
   and have tried different install options
   Can you help?

   Thank you

   Marilynn Huret
   aka mhuret
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Newbie question about Python syntax

2019-08-23 Thread Cameron Simpson

On 23Aug2019 13:49, Paul St George  wrote:

Context:
I am using Python to interrogate the value of some thing in Blender 
(just as someone else might want to use Python to look at an email in 
a Mail program or an image in Photoshop).


Assumptions:
So, I want to look at the attribute of an instance of a class called 
CompositorNodeMapValue. The code in the Python tutorial seems to be 
for creating an instance of a class, but I assume Blender (in my case) 
has already created the instance that I want to interrogate.


That would be the expectation. And to interrogate it, you need that 
instance to hand in a variable.



Question:
If this is so, should I find the code to get a list of the instances 
that have been made (maybe using inspect?) and then, when I have its 
name, the attributes of the one that interests me?


Have you not got one of these handed to you from something?

Or are you right at the outside with some "opaque" blender handle or 
something? (Disclaimer: I've never used Blender.)


You can inspect objects with the inspect module. You can also be more 
direct. Given an object "o", you can do an assortment of things:


dir(o) gets a list of its attribute names.

help(o) prints out the docstring, somewhat rendered.

o.__dict__ is usually a dict mapping attribute names to their values.

type(o) gets you its type, so "print(type(o))" or 
"print(type(o).__name__)" can be handy.


A crude probe function (untested):

 def probe(o):
   print(o)
   for attr, value in sorted(o.__dict__.items()):
 print(" ", attr, type(value).__name__, value)

Enjoy,
Cameron Simpson  (formerly c...@zip.com.au)

"Are we alpinists, or are we tourists" followed by "tourists! tourists!"
   - Kobus Barnard  in rec.climbing,
 on things he's heard firsthand
--
https://mail.python.org/mailman/listinfo/python-list


[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-23 Thread Dong-hee Na


Dong-hee Na  added the comment:

> There's one more step.  Can you please amend to the tests to run both the
> pure python and C versions.

Sure, I will take look at it!

--

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
versions: +Python 3.8

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for doing the work one this.  Nice work :-)

There's one more step.  Can you please amend to the tests to run both the pure 
python and C versions.  See Lib/test/test_heapq.py for an example of how to 
this.

--

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 5779c536321e1405b4c17654a85b8f9221be765e by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) 
(GH-15441)
https://github.com/python/cpython/commit/5779c536321e1405b4c17654a85b8f9221be765e


--

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 0a18ee4be7ba215f414bef04598e0849504f9f1e by Raymond Hettinger 
(Dong-hee Na) in branch 'master':
bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266)
https://github.com/python/cpython/commit/0a18ee4be7ba215f414bef04598e0849504f9f1e


--

___
Python tracker 

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



[issue37798] Add C fastpath for statistics.NormalDist.inv_cdf()

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15134
pull_request: https://github.com/python/cpython/pull/15441

___
Python tracker 

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



[issue18078] threading.Condition to allow notify on a specific waiter

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Marking this as closed/rejected for the reasons listed above.

Thank you all for the thoughtful and intelligent discussion.

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



[issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue22001] containers "same" does not always mean "__eq__".

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue37933] faulthandler causes segfaults

2019-08-23 Thread Thomas Caswell


Change by Thomas Caswell :


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

___
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-23 Thread Kyle Stanley


New submission from Kyle Stanley :

In the documentation for the NotImplemented constant 
(https://docs.python.org/3/library/constants.html#NotImplemented), the only use 
case mentioned is for binary special methods, (such as object.__eq__(other)). 
However, based on a conversation in a recent PR 
(https://github.com/python/cpython/pull/15327#discussion_r316561140), there 
seems be several other use cases as well.  It's quite useful to utilize when 
it's desired to express that a particular operation is not supported, without 
raising an error.

Expanding upon the use cases will provide readers an idea of other cases in 
which the constant could be useful. Also, the current wording could potentially 
come across as implying that the _only_ use case for the constant is for binary 
special methods, and as far as I'm aware, that is not the case.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 350333
nosy: aeros167, docs@python, eric.araujo, ezio.melotti, mdk, willingc
priority: normal
severity: normal
stage: needs patch
status: open
title: Docs: Clarify NotImplemented use cases
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



Re: Style suggestions/critiques

2019-08-23 Thread DL Neil

On 24/08/19 7:15 AM, Michael F. Stemper wrote:

On 20/08/2019 21.57, DL Neil wrote:

On 21/08/19 9:11 AM, Michael F. Stemper wrote:

I recently wrote a couple of modules (more to come) to help me
use the tikz package in TeX/LaTeX. Since it's all to do with
drawing, I have a lot of points in R^2. Being unimaginative, I



This all seems reasonably simple and intuitive (to me). However,
in order to actually do some manipulation, I have stuff like:

...


This approach eliminates the ad hoc unpacking that I had been doing
and made the accesses to particular items more explicit.

Using this approach involves slightly more typing than my original
approach, which allowed:
^^^ Origin = 0,0
^^^ wayright = 7,0


Most programmers subscribe to the belief: that code is read more often 
than it is written. Of course, the behavioral aspect of writing code so 
that it can be read, may be less evident...


Inevitably, what makes sense to you, may seem obscure to A.N.Other.


> But, that's not really much more typing, and it'll help me keep in
> mind what things are what.

Surely, understanding the "model", is key to a good solution?



My existing code has a function Intersection(line1,line2) that
calculates where line1 and line2 intersect (assuming that there
is a unique such point). To me, this seems to be the proper
pardigm, since it's clear that line1 and line2 are peers in the
intersection function.


(To me) You've a good grasp on what is required, because you've realised 
important (levels of) relationships between the components of the problem.


There are both purists and pragmatists in this world, I have to beware 
"paralysis by analysis"!




Am I being too fastidious here? Is there any reason that an
idiom such as line1.Intersect( line2 ) would be preferable?


Let's replace the word "fastidious", which may convey ideas of excessive 
zeal, with "questioning". Thus: how else will you learn?


I'm not going to try to answer - as I've said 'here' before, I'm not an 
OOP-native, and often pick-up ideas/correction from others with clearer 
insights...


That said, 'looking around' live-code you will find both approaches, 
even within the PSL.



Remember, an object comprises both "data-attributes" and 
"method-attributes" (such formed a recent discussion, over on the 
Python-Tutor Discussion List). Accordingly, I'd put "intersection" 
within the Line object.


Thought 1: I find it easier to have the code 'all together' (within the 
Line class) cf having a separate "helper function" (albeit that likely 
residing within the same Python module). See also recent discussion 
'here', wherein I related from module import-ing a class, but forgetting 
to also import a 'helper'. (try to be nice to the 'grey hair' - he can't 
help it!)


Thought 2: whilst the (possibly) intersecting lines are "peers", within 
an English sentence ("subject", "verb", "object"), we would express one 
as the "subject" and the second as the "object". Accordingly, there is 
no difficulty is asking the same question in Python: (if/where) do 
I/self intersect with that other line/slope?


Accordingly, something like "find_intersection( self, other_line )" 
conveys meaning (to me). The fact is, "self" and "other_line" are both 
of the same object ("is-a" relationship to Line), ie "peers", and the 
code identifies that! Once again, stating the problem in English (or 
?human-language) and then writing it in Python...



Back to the philosophical level: always keep 'the big picture' in mind - 
if you are only coding a couple of lines and to solve a single question, 
it is literally "throw-away code". Who cares what it looks-like - as 
long as it works! However, if you intend to add a list of other analyses 
beyond 'intersection', then build your base-code/base-objects with that 
in-mind. (please recall earlier comment, that it may/not be worth making 
Cartesian points into an object!)


Small confession/admission/illustration/'object' lesson:
I coded a Point object, then later wanted a Vector. "Oh look" says 
lazy-boy, I could (mis-)use Point - they're both x-y pairs after-all... 
Later, along came the need for a "translation" function and delta-x, 
delta-y pairs. You guessed it, I over-over-loaded Point to the point 
(hah!) where I managed to confuse myself with my own over-clever-ness. 
That said, it was easy to "re-factor". Thus created a simple x-y base 
(or "super-class") from which (Cartesian) Point, Vector, Delta 
(whatever) could be derived/"sub-classed", and then the various methods 
applicable to each could be separated from each-other. The worst part, 
was going-through the entire system looking for evidence of my earlier, 
?over-clever, misdeeds. (blessings on modern text-editors which will 
search an entire directory of code at a time) However, thereafter, 
readability improved and progress accelerated...


Whilst OOP can sometimes seem like more work, or more "typing", (or 
consuming more resources) its central tenet is "re-use"! Yes, one 

[issue37585] Comparing PyDictValues does not give expected results

2019-08-23 Thread Kyle Stanley


Change by Kyle Stanley :


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



[issue37933] faulthandler causes segfaults

2019-08-23 Thread Thomas Caswell


Change by Thomas Caswell :


--
components: +Extension Modules -Library (Lib)

___
Python tracker 

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



[issue37933] faulthandler causes segfaults

2019-08-23 Thread Thomas Caswell


New submission from Thomas Caswell :

Changing faulthandler to only allocate it's stack when use causes python to 
segfault with

import faulthandler
faulthandler.cancel_dump_traceback_later()

https://bugs.python.org/issue37851 https://github.com/python/cpython/pull/15358

--
components: Library (Lib)
messages: 350332
nosy: tcaswell, vstinner
priority: normal
severity: normal
status: open
title: faulthandler causes segfaults
type: crash
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



[issue37932] ConfigParser.items(section) with allow_no_value returns empty strings

2019-08-23 Thread Sean Robertson


New submission from Sean Robertson :

Hello and thanks for reading.

I've also experienced this in Python 3.7, and I believe it to be around since 
3.2.

The allow_no_value option of ConfigParser allows None values when 
(de)serializing configuration files. Yet calling the "items(section)" method of 
a ConfigParser returns empty strings for values instead of None. See below for 
an MRE.

Thanks,
Sean

Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from configparser import ConfigParser
>>> a = ConfigParser(allow_no_value=True)
>>> a.add_section('foo')
>>> a.set('foo', 'bar')
>>> a.items('foo')
[('bar', '')]
>>> a.items('foo', raw=True)
[('bar', None)]
>>> a.get('foo', 'bar')
>>> list(a['foo'].items())
[('bar', None)]

--
components: Library (Lib)
messages: 350331
nosy: Sean Robertson
priority: normal
severity: normal
status: open
title: ConfigParser.items(section) with allow_no_value returns empty strings
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



Re: Let the copyfilepath.py to support chinese file path name.

2019-08-23 Thread DL Neil

On 24/08/19 2:36 AM, Hongyi Zhao wrote:

Hi,

The following is a gedit plugin which provides a way to copy the current
file path to the clipboard.

https://github.com/willianveiga/gedit-copy-file-path/blob/master/
copyfilepath.py

But, I try and find that it doesn't support the path/file names including
chinese characters.

In this case, it will give messy code like this:

dnsmasq/archive/dnsmasq-全功�

How to fix it?


Does "it will give" mean:
- this is what is returned from the gtk clipboard, or
- this is the fileNM which appears in an errmsg?

Please copy-paste the calling code, source data fileNM, and resulting 
errmsgs/output.



NB I only took the quickest look at the code.

A first thought is that this code may have originated in Python2 days. 
In which case there may be pertinent differences between how things were 
done 'then' (ASCII byte-characters) and how they are done now (Unicode 
characters). Also, in the Python3 world, many file/pathNM libraries will 
respond (slightly differently) depending upon whether their input is in 
(Unicode) characters or bytes.


Is it worth experimenting by throwing some test-data at the object?
- fileNM as Unicode string
- fileNM as bytes
- fileNM in (narrow) ASCII
- fileNM including Kanji (or...)
How does it react differently.

A second issue is that whilst Python negotiated a clear-cut difference 
between Unicode and 'the ?bad, old days'; OpSys and file systems do/did 
not! (Hence the first question, above) I have run into trouble with 
(European language) non-ASCII characters originating on a MSFT platform 
not being properly accepted by 'modern' Python file/path libraries 
(under Linux - although the OpSys likely doesn't matter). The fileNMs 
become mangled during the decode() step - to the point of no-repair.



In debugging this issue, recommend separating what the clip-board is/not 
handling, and what the file system might be mangling, ie locate the 
ACTUAL point of error and separate that from later consequences!

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


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

2019-08-23 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> FWIW, the entire point of us having recently added as_integer_ratio() methods 
> to so many concrete classes is to avoid the need for helper functions in 
> favor of a simple try/except around a single call.

But what about PEP 3141? The fractions.Fraction constructor accepts 
numbers.Rational instances, which do not necessarily have an as_integer_ratio() 
method. We can't just drop support for that (*). So in practice you do need to 
check both as_integer_ratio() and the PEP 3141 numerator/denominator 
properties. It seems useful to have a helper function for this.

(*) Unless you want to deprecate PEP 3141. This may be less crazy than it 
sounds, especially given Guido van Rossum's reaction on 
https://discuss.python.org/t/pep-3141-ratio-instead-of-numerator-denominator/2037/25?u=jdemeyer

--

___
Python tracker 

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



Re: Style suggestions/critiques

2019-08-23 Thread Michael F. Stemper
On 20/08/2019 21.57, DL Neil wrote:
> On 21/08/19 9:11 AM, Michael F. Stemper wrote:
>> I recently wrote a couple of modules (more to come) to help me
>> use the tikz package in TeX/LaTeX. Since it's all to do with
>> drawing, I have a lot of points in R^2. Being unimaginative, I

>> This all seems reasonably simple and intuitive (to me). However,
>> in order to actually do some manipulation, I have stuff like:
>> # Unpack the lines
>> l1p1,l1p2 = line1
>> l1x1,l1y1 = l1p1
>> l1x2,l1y2 = l1p2
>> l2p1,l2p2 = line2
>> l2x1,l2y1 = l2p1
>> l2x2,l2y2 = l2p2

> Assuming that the code does-stuff with/to lines, eg rotate the line 0.2
> radians about some nominated rotational-center; maybe construct a class, eg
> 
> class Line():
> def __init__( self, starting_point, ending_point ):
>     self.starting_point = starting_point
>     self.ending_point = ending_point
> def rotate( self, angle, center ):
>     ...
> 
> The same could also be said for a Point class. However, if they are
> 'only' Cartesian coordinates and no methods ever apply(???), then maybe
> named-tuples or a dict?

Played briefly with a dict and decided that it was ugly, too. However,
the following objects seem nice to me:

class Point( ):
  def __init__( self, x, y ):
self.x = float(x)
self.y = float(y)

class Line( ):
  def __init__( self, p1, p2 ):
self.p1 = p1
self.p2 = p2
  def Slope( self ):
# Proof of concept only. Won't work on vertical lines
return (self.p1.y-self.p2.y)/(self.p1.x-self.p2.x)

In use:

^^^ Origin = Point(0,0)
^^^ wayright = Point(7,0)
^^^ xaxis = Line(Origin,wayright)
^^^ identity = Line(Origin,Point(1,1))
^^^ xaxis.Slope()
-0.0
^^^ identity.Slope()
1.0
^^^

(I've changed the 3*'>' prompt to 3*'^' to avoid confusing
news clients.)

This approach eliminates the ad hoc unpacking that I had been doing
and made the accesses to particular items more explicit.

Using this approach involves slightly more typing than my original
approach, which allowed:
^^^ Origin = 0,0
^^^ wayright = 7,0

But, that's not really much more typing, and it'll help me keep in
mind what things are what.

My existing code has a function Intersection(line1,line2) that
calculates where line1 and line2 intersect (assuming that there
is a unique such point). To me, this seems to be the proper
pardigm, since it's clear that line1 and line2 are peers in the
intersection function.

Am I being too fastidious here? Is there any reason that an
idiom such as line1.Intersect( line2 ) would be preferable?


-- 
Michael F. Stemper
Exodus 22:21
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-08-23 Thread Eryk Sun


Eryk Sun  added the comment:

Alternatively, instead of special casing the file type and spinning on 
PeekNamedPipe, the workaround could be based on a multiple-object wait that 
includes the child process handle. In this case, communicate() would always 
call _communicate in Windows, regardless of the timeout or number of pipes -- 
because simplistically calling either self.stdout.read() or self.stderr.read() 
could hang. 

The implementation would be moderately complicated. If we stop waiting on the 
reader threads because the process exited, we can give the threads a short time 
to finish reading and close the files -- maybe 250 ms is enough. But if they 
haven't exited at this time, we can't simply raise a TimeoutExpired exception 
if the call hasn't actually timed out.  To finish the _communicate call, we 
would have to cancel the pending reads and join() the threads.

We can force a reader thread to exit by canceling the read via WINAPI 
CancelIoEx. However, _readerthread has to be modified to support this. It could 
be implemented as a loop that calls _winapi.ReadFile to read the output in 
chunks that get appended to the buffer list. The read loop would break for 
either ERROR_BROKEN_PIPE or ERROR_OPERATION_ABORTED (canceled). 

The final step in _communicate would be to concatenate the partial reads. If 
it's text mode, it would also have to decode the bytes and translate newlines. 
The POSIX implementation of _communicate has to do this, so we already have a 
_translate_newlines method for this case.

Note that _winapi.WaitForMultipleObjects is interruptible in the main thread 
via Ctrl+C, which is a bonus improvement since Thread.join() can't be 
interrupted in Windows.

--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset af84a88ef8b3288da528d2f52b7d3fbafb8dc8a6 by Victor Stinner in 
branch '3.8':
bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431) (GH-15435)
https://github.com/python/cpython/commit/af84a88ef8b3288da528d2f52b7d3fbafb8dc8a6


--

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 3921d12174c1998d9df7a08d036a7fef2d587a64 by Miss Islington (bot) 
in branch '3.8':
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
https://github.com/python/cpython/commit/3921d12174c1998d9df7a08d036a7fef2d587a64


--

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset f8dc3e85ab01e1b0345738670dcb3993da7ec436 by Miss Islington (bot) 
in branch '3.7':
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
https://github.com/python/cpython/commit/f8dc3e85ab01e1b0345738670dcb3993da7ec436


--
nosy: +miss-islington

___
Python tracker 

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



[issue37930] make fails when compiling Python 2.6 from source (posixmodule.c)

2019-08-23 Thread Ned Deily


Ned Deily  added the comment:

Python 2.6 reached end-of-life in 2013, six years ago, and has not received any 
non-security bug fixes since 2010.  We strongly recommend thst you migrate to a 
modern, supported version of Python, if not Python 3.7, then at least Python 
2.7 which itself will reach end-of-life in 2020.

--
nosy: +ned.deily
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



Re: How to record the console's content in the interpreter?

2019-08-23 Thread eryk sun
On 8/23/19, jf...@ms4.hinet.net  wrote:
>
> it won't show output from print command, and "print" is the most
> command used in a module when a response was needed

ConEmu is an alternate console for Windows that allows logging all
console output to a file:

https://conemu.github.io/en/AnsiLogFiles.html
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37916] distutils: allow overriding of the RANLIB command on macOS (darwin)

2019-08-23 Thread Ned Deily


Change by Ned Deily :


--
components: +Distutils
nosy: +dstufft, eric.araujo

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15132
pull_request: https://github.com/python/cpython/pull/15438

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15131
pull_request: https://github.com/python/cpython/pull/15437

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread Steve Dower


Steve Dower  added the comment:


New changeset 5be666010e4df65dc4d831435cc92340ea369f94 by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
https://github.com/python/cpython/commit/5be666010e4df65dc4d831435cc92340ea369f94


--

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread Steve Dower


Steve Dower  added the comment:

Thanks, Eryk. In that case, I'll merge the PR.

Since Python 3.9 will not support Windows 7, we can remove it from master as 
soon as the backports are done :)

--
assignee:  -> steve.dower

___
Python tracker 

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



[issue37549] os.dup() fails for standard streams on Windows 7

2019-08-23 Thread Eryk Sun


Eryk Sun  added the comment:

> Should we add a version check as well [1]? I'm not totally comfortable 
> with bitmasking a handle here, but if we only do this additional 
> check on Win7 then I'm okay with it.

A version check should not be necessary. For file objects, setting both handle 
tag bits has always been a reserved signature for console pseudohandles. Here's 
the definition in the published console code:

https://github.com/microsoft/terminal/blob/b726a3d05d35928becc8313f6ac5536c9f503645/dep/Console/winconp.h#L460

It's mostly vestigial in Windows 8+ due to the addition of the ConDrv console 
device. Code that routed calls to LPC-based implementations when passed a 
console pseudohandle has all been removed. The only remaining use I know of is 
in the console attach code. If a process is started with STARTF_USESTDHANDLES, 
then AllocConsole() will only replace handles that are NULL or console 
pseudohandles. The docs for GetStdHandle explain this:

Attach/detach behavior

When attaching to a new console, standard handles are always replaced
with console handles unless STARTF_USESTDHANDLES was specified during
process creation.

If the existing value of the standard handle is NULL, or the existing
value of the standard handle looks like a console pseudohandle, the
handle is replaced with a console handle.

When a parent uses both CREATE_NEW_CONSOLE and STARTF_USESTDHANDLES to
create a console process, standard handles will not be replaced unless
the existing value of the standard handle is NULL or a console
pseudohandle.

I confirmed that this is still relevant in Windows 10 by testing an inherited 
pipe handle in stdout and stderr and manually setting the tag bits in the 
hStdError handle value in STARTUPINFO. The console attach code preserved the 
regular handle in stdout but replaced the console pseudohandle in stderr. So 
the API is still reserving these tag bits in file handles, at least in one 
place, which means they're still reserved in general, even though setting them 
will no longer break a ReadFile call, for one example, like it would in Windows 
7 (in which the API would route the call to the internal ReadConsole 
implementation). 

We've been relying on checking the console pseudohandle tag bits without a 
version check in subprocess.Popen._filter_handle_list for a while now. Console 
pseudohandles have to be removed from the handle list, else CreateProcessW will 
fail.

--

___
Python tracker 

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



[issue14112] tutorial intro talks of "shallow copy" concept without explanation

2019-08-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

With /like/link/ I agree.

--

___
Python tracker 

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



[issue17642] IDLE add font resizing hot keys and wheel

2019-08-23 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I want this too, and part of it should be simple.  Given that I have had a 
never empty backlog of PRs to review for 2 1/2 years, it got forgotten.  There 
was also a tk problem that seemed to block implementation.

Specification for hotkey: Cntl/Cmd - -+= decrease/increase font size within 
limits in the current window only.  (The current limits for turtledemo are 6 
and 100.  Change this?  The keys are fixed and cannot be customized. Keys have 
no affect on IdleConf.  Setting font size in dialog continues to set font size 
for all Windows, whether individually set or not.  Should work same for editor 
and text (read-only) windows.

As near as I can tell, these key combinations currently do nothing.  I presume 
they are not bound in the built-in keysets.  Custom keysets are always subject 
to interference when we add new key bindings.  (I don't know that the custom 
key dialog checks against such fixed builtins. Another issue.  Checking custom 
keysets on import is likely a third issue.)

Implementation for hotkey: The desired behavior is the behavior of turtledemo, 
so the same implementation should work.  It is annoying that we need to add it 
separately for editor and text windows.  But refactoring to create a common 
base class would be a lot harder. 

Mousewheel: Currently, in turtledemo, control-wheel changes size on all 
systems.  

Raymond: Should it be cmd-wheel on Mac?

In msg226328 I reported a tk issue blocking both this and line numbers.  We now 
deliver 3.7.4 and 3.8.0 with tk 8.6.9.  We have line numbers because I no 
longer saw the glitchy behavior I remember.  Nor did I see any issue with font 
resizing with turtledemo.

I may include the module browser, etc, with this issue.  Dialogs would be 
another issue.

--

___
Python tracker 

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



[issue26589] Add HTTP Response code 451

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue26589] Add HTTP Response code 451

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 761e5a7c7f57cf2a09106c0afa038f04de6a9ed2 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-26589: Add http status code 451 (GH-15413) (GH-15436)
https://github.com/python/cpython/commit/761e5a7c7f57cf2a09106c0afa038f04de6a9ed2


--

___
Python tracker 

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



[issue9938] Add optional kwargs to argparse

2019-08-23 Thread hai shi


Change by hai shi :


--
title: Improving interactive use of argparse -> Add optional kwargs to argparse

___
Python tracker 

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



Re: How to record the console's content in the interpreter?

2019-08-23 Thread Tomasz Rola
On Thu, Aug 22, 2019 at 07:38:54PM -0700, jf...@ms4.hinet.net wrote:
> Say I like to record everything showing in the console into a file
> after I start a debug session, and stop it when finished. It's not a
> console redirection. I still need to see what is going on during the
> session.
> 

You may be looking for Eshell, but to be sure you have to try, I have
no idea how well this works in Windows. After running your stuff in
it, all session is present in Emacs' buffer (if I undestand it
correctly) and you can do with a buffer however you please (within
limitations of Emacs, which are broad), including save to file:

Eshell is a shell-like command interpreter implemented in Emacs
Lisp. It invokes no external processes except for those requested
by the user. It is intended to be an alternative to the IELM (see
Emacs Lisp Interaction) REPL for Emacs and with an interface
similar to command shells such as bash, zsh, rc, or 4dos.

[

https://www.gnu.org/software/emacs/manual/html_mono/eshell.html

]

-- 
Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature.  **
** As the answer, master did "rm -rif" on the programmer's home**
** directory. And then the C programmer became enlightened...  **
** **
** Tomasz Rola  mailto:tomasz_r...@bigfoot.com **
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26589] Add HTTP Response code 451

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15130
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/15436

___
Python tracker 

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



[issue26589] Add HTTP Response code 451

2019-08-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 8f080b09953a2d862de5c74edf414a54ea3dbea5 by Raymond Hettinger in 
branch 'master':
bpo-26589: Add http status code 451 (GH-15413)
https://github.com/python/cpython/commit/8f080b09953a2d862de5c74edf414a54ea3dbea5


--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15129
pull_request: https://github.com/python/cpython/pull/15435

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset 9cbdce3917ab41856b61ac5c0f3c4ac0e203f320 by Miss Islington (bot) 
in branch '3.8':
bpo-36763, doc: Add links in the new C API init doc (GH-15433)
https://github.com/python/cpython/commit/9cbdce3917ab41856b61ac5c0f3c4ac0e203f320


--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 120b707a6d43452e067daa55a8fdca69f9424abc by Victor Stinner in 
branch 'master':
bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431)
https://github.com/python/cpython/commit/120b707a6d43452e067daa55a8fdca69f9424abc


--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15128
pull_request: https://github.com/python/cpython/pull/15434

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1beb7c3de9c3d0e802e4267a11d937e8f024d661 by Victor Stinner in 
branch 'master':
bpo-36763, doc: Add links in the new C API init doc (GH-15433)
https://github.com/python/cpython/commit/1beb7c3de9c3d0e802e4267a11d937e8f024d661


--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15127
pull_request: https://github.com/python/cpython/pull/15433

___
Python tracker 

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



How Bidirectional Neural Networks could be used to predict future data while they need future data?!

2019-08-23 Thread Amirreza Heidari
In the following link I see that Bidirectional LSTM is used to predict the 
future data in time series. I know that a Bidirectional recurrent neural 
network use both past and future data, and therefore for predicting future data 
we need future data1! Can anyone explain me how they work when in a time series 
we are going to predict the future? 

https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

> The first doc should mention somewhere the new doc.

Done in PR 15433.

--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


STINNER Victor  added the comment:

> _PySys_ReadPreInitOptions() code should be moved somewhere closer to 
> PyConfig_Read().

Done in PR 15431.

--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15126
pull_request: https://github.com/python/cpython/pull/15431

___
Python tracker 

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



Using the same data for both validation and prediction in Keras

2019-08-23 Thread Amirreza Heidari
I was reading a tutorial for time series prediction by Neural Networks. I found 
that this code have used the same test data in the following code for 
validation, and later also for prediction. 

history = model.fit(train_X, train_y, epochs=50, batch_size=72, 
validation_data=(test_X, test_y), verbose=2, shuffle=False)

Does it mean that the validation and test data are the same, or there is a 
default percentage to split the data into validation and prediction?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36763] Implementation of the PEP 587

2019-08-23 Thread miss-islington


miss-islington  added the comment:


New changeset a6427cb2a279c4125dc26d468bcbb3374cdc5f41 by Miss Islington (bot) 
in branch '3.8':
bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)
https://github.com/python/cpython/commit/a6427cb2a279c4125dc26d468bcbb3374cdc5f41


--

___
Python tracker 

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



[issue37931] crash reimporting posix after Py_Finalize on mac

2019-08-23 Thread Benoit Hudson


Change by Benoit Hudson :


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

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3842f2997fbd4dc840986aad2bb94656815e243b by Victor Stinner in 
branch 'master':
bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)
https://github.com/python/cpython/commit/3842f2997fbd4dc840986aad2bb94656815e243b


--

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15124
pull_request: https://github.com/python/cpython/pull/15427

___
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-23 Thread Guido van Rossum


Guido van Rossum  added the comment:

The decision has been made to get rid of TargetScopeError and instead just use 
SyntaxError. PEP 572 was updated already. We're just waiting for someone 
(Serhiy?) to review Nick's patch, PR #15131.

--

___
Python tracker 

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



[issue37931] crash reimporting posix after Py_Finalize on mac

2019-08-23 Thread Benoit Hudson


New submission from Benoit Hudson :

On OSX, with --enable-shared, if you shut down python and reinitialize, you can 
get a crash.

Repro steps: see attached crashy.c
gcc -I. -I ../Include/ -L. crashy.c -lpython3.9
./a.out

On OSX, with --enable-shared, you get a crash! On other platforms including on 
OSX static builds, no crash.

Not a regression: it's present in 2.7 (where we actually hit it).

PR incoming, the fix is simple. It has to do with caching (on OSX shared builds 
only) a stale value for the environment when building os.environ the first 
time; if you change the environment, the second initialization reads garbage 
when building os.environ.

--
components: Interpreter Core, macOS
files: crashy.c
messages: 350309
nosy: Benoit Hudson, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: crash reimporting posix after Py_Finalize on mac
type: crash
versions: Python 3.9
Added file: https://bugs.python.org/file48559/crashy.c

___
Python tracker 

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



[issue31727] FTP_TLS errors when use certain subcommands

2019-08-23 Thread Neha Reddy


Neha Reddy  added the comment:

We faced the same issue while trying to copy files to an FTPS server. 
We are trying to connect to a Filezilla server. The type of encryption we are 
using for the FTPS is 'Require explicit FTP over TLS'.

There are the errors that my colleague and I had while trying to use the 
ftp.nlst() or the storbinary() functions in ftplib. 

EOF occurred in violation of protocol (_ssl.c:852)
OSError: [Errno 0] Error
 
After some research on the internet, we found a workaround on stack overflow 
(https://stackoverflow.com/questions/46633536/getting-a-oserror-when-trying-to-list-ftp-directories-in-python)
 

Below is the code for the workaround. hoping this could help resolve the issue 
in the newer version. 
 
import ftplib
from ssl import SSLSocket


class ReusedSslSocket(SSLSocket):
def unwrap(self):
pass


class MyFTP_TLS(ftplib.FTP_TLS):
"""Explicit FTPS, with shared TLS session"""
def ntransfercmd(self, cmd, rest=None):
conn, size = ftplib.FTP.ntransfercmd(self, cmd, rest)
if self._prot_p:
conn = self.context.wrap_socket(conn,
server_hostname=self.host,
session=self.sock.session)  # 
reuses TLS session
conn.__class__ = ReusedSslSocket  # we should not close reused ssl 
socket when file transfers finish
return conn, size

--
nosy: +realnehareddy

___
Python tracker 

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



[issue23878] Missing sanity checks for various C library function calls...

2019-08-23 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
versions: +Python 2.7, Python 3.7, Python 3.8, Python 3.9 -Python 3.4

___
Python tracker 

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



[issue23878] Missing sanity checks for various C library function calls...

2019-08-23 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue36763] Implementation of the PEP 587

2019-08-23 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +15122
pull_request: https://github.com/python/cpython/pull/15423

___
Python tracker 

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



[issue34898] add mtime argument to gzip.compress

2019-08-23 Thread Daniel Himmelstein


Daniel Himmelstein  added the comment:

Any reason not to also expose mtime in the gzip.open API?

--
nosy: +dhimmel

___
Python tracker 

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



[issue26024] Non-ascii Windows locale names

2019-08-23 Thread Vidar Fauske


Vidar Fauske  added the comment:

Thanks. Note that the failing with `
locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())` I mentioned above 
is a different problem, that is tracked in a much older issue: 
https://bugs.python.org/issue10466

--

___
Python tracker 

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



[issue37454] Clarify docs for math.log1p()

2019-08-23 Thread Tim Peters


Tim Peters  added the comment:

> Sometimes you guys make me feel dumb as a rock.

I expect we all do that favor for each other at times ;-)

--

___
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-23 Thread Brett Slatkin


Brett Slatkin  added the comment:

Maybe we should just roll back https://bugs.python.org/issue34687 to fix both 
issues? Otherwise asyncio will be broken on Windows in 3.8. Is general API 
stability more important than performance?

--

___
Python tracker 

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



[issue10466] locale.py resetlocale throws exception on Windows (getdefaultlocale returns value not usable in setlocale)

2019-08-23 Thread Vidar Fauske


Vidar Fauske  added the comment:

Note that this is still an issue on Windows:

>>> import locale
>>> locale.getdefaultlocale()
('en_US', 'cp1252')
>>> locale.setlocale(locale.getdefaultlocale())
Error: unsupported locale setting

--
components: +Windows
nosy: +paul.moore, steve.dower, vidartf, zach.ware
versions: +Python 3.7 -Python 3.1, Python 3.2

___
Python tracker 

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



[issue37930] make fails when compiling Python 2.6 from source (posixmodule.c)

2019-08-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hi Oguz,

Sadly Python 2.6.8 is not supported anymore

--
nosy: +pablogsal

___
Python tracker 

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



[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2019-08-23 Thread Stefan Behnel


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



[issue14465] xml.etree.ElementTree: add feature to prettify XML output

2019-08-23 Thread Stefan Behnel


Stefan Behnel  added the comment:


New changeset b5d3ceea48c181b3e2c6c67424317afed606bd39 by Stefan Behnel in 
branch 'master':
bpo-14465: Add an indent() function to xml.etree.ElementTree to pretty-print 
XML trees (GH-15200)
https://github.com/python/cpython/commit/b5d3ceea48c181b3e2c6c67424317afed606bd39


--

___
Python tracker 

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



Let the copyfilepath.py to support chinese file path name.

2019-08-23 Thread Hongyi Zhao
Hi,

The following is a gedit plugin which provides a way to copy the current 
file path to the clipboard.

https://github.com/willianveiga/gedit-copy-file-path/blob/master/
copyfilepath.py

But, I try and find that it doesn't support the path/file names including 
chinese characters.

In this case, it will give messy code like this:

dnsmasq/archive/dnsmasq-全功�

How to fix it?

Regards
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37830] continue and break in finally with return in try results with segfault

2019-08-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think PR 15320 should be merge as soon as possible at least to fix the 
segfault and stop the release blocker. Anything else can wait IMHO

--

___
Python tracker 

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



[issue37055] Numerous warnings with blake2 module

2019-08-23 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Related to this, the blake2 function (declared as static inline) is not used, 
which makes the Solaris and compilers unhappy. Patch for reference:

--- a/Modules/_blake2/impl/blake2.h
+++ b/Modules/_blake2/impl/blake2.h
@@ -169,11 +169,6 @@
   BLAKE2_API int blake2sp( uint8_t *out, const void *in, const void *key, 
size_t outlen, size_t inlen, size_t keylen );
   BLAKE2_API int blake2bp( uint8_t *out, const void *in, const void *key, 
size_t outlen, size_t inlen, size_t keylen );

-  static inline int blake2( uint8_t *out, const void *in, const void *key, 
size_t outlen, size_t inlen, size_t keylen )
-  {
-return blake2b( out, in, key, outlen, inlen, keylen );
-  }
-
 #if defined(__cplusplus)
 }
 #endif

--
nosy: +pablogsal

___
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-23 Thread Yury Selivanov


Yury Selivanov  added the comment:

Andrew, can you fix ctrl-c/windows issue? I'm basically afk until monday. 

And we're not going to do anything about add_signal_handler in 3.8.

--

___
Python tracker 

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



[issue29535] datetime hash is deterministic in some cases

2019-08-23 Thread Ashwin Ramaswami


Ashwin Ramaswami  added the comment:

Oh, that PR is already there in PR 15269, great!

--

___
Python tracker 

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



[issue36344] install_certificates.command too complicated

2019-08-23 Thread Łukasz Langa

Łukasz Langa  added the comment:

This is marked as a release blocker. The last 3.8 beta is scheduled for Monday. 
Please decide how to proceed ASAP.

--
nosy: +benjamin.peterson, lukasz.langa
priority: deferred blocker -> release blocker

___
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-23 Thread Łukasz Langa

Łukasz Langa  added the comment:

This is marked as a release blocker. The last beta is scheduled for Monday. 
Please decide how to proceed ASAP.

--
priority: deferred blocker -> release blocker

___
Python tracker 

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



  1   2   >