[issue41446] New demo, using a web api

2020-08-01 Thread Mariatta


Mariatta  added the comment:

Thanks for your interest in adding this to CPython but I think this demo does 
not belong in CPython repository. Perhaps it should be written as a demo for 
helioviewer API and be part of helioviewer documentation. We already have a 
documentation for urllib for how to make API calls.

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



[issue41449] An article on Python 3 stdout and stderr output buffering

2020-08-01 Thread tedder


Change by tedder :


--
nosy: +tedder

___
Python tracker 

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



[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.10

2020-08-01 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue40979] typing module docs: keep text, add subsections

2020-08-01 Thread Luciano Ramalho

Luciano Ramalho  added the comment:

I have incorporated Guido's suggestions and added additional subsections to 
make it easier to navigate the page.

I also added notes that fix the issue https://bugs.python.org/issue40978 — 
"Document that typing.SupportsXXX protocols are runtime checkable"

--

___
Python tracker 

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



[issue40978] Document that typing.SupportsXXX protocols are runtime checkable

2020-08-01 Thread Luciano Ramalho


Luciano Ramalho  added the comment:

I have added a note about the protocols decorated with `@runtime_checkable` to 
the `Procools` section of the reorganized `typing.rst` in 
https://bugs.python.org/issue40979.

I also expanded the note about the caveats of `@runtime_checkable` in its entry 
in `Functions and decorators` section, giving `SupportsFloat` as an example 
issue.

--

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Okay, marking this as closed.

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



[issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6

2020-08-01 Thread Ned Deily


Ned Deily  added the comment:

Thank you for the report and for the analysis. As you probably know, Python 3.6 
is now in the security phase of its life cycle so generally only fixes for 
security-related issues are provided at this point. This issue doesn't seem to 
fall into that category. If you have a workaround for 3.6.x, documenting it is 
probably the best available option. I'm going to close this as "wont fix".

https://www.python.org/downloads/

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

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Tim Peters


Tim Peters  added the comment:

That text is fine, if you feel something needs to be said at all. I really 
don't. A Pareto distribution of this kind with parameter <= 1.0 has infinite 
expected value - VERY long tail. Anyone who knows what they're doing already 
knows that. The reason the implementation can't "blow up" for parameters >= 
(roughly) 0.1 isn't that IEEE doubles have such a large dynamic range but 
rather that they can't represent a number < 1.0 larger than 1 - 2**-53 (so u = 
1 - random.random() is always at least 2**-53). The actual distribution has 
infinite expected value nonetheless, but the implementation is incapable of 
generating any of its very large values (which, while very rare, are also very 
large).

--

___
Python tracker 

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



[issue41075] IDLE: Better support history navigation

2020-08-01 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +epaine

___
Python tracker 

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



[issue41075] IDLE: Better support history navigation

2020-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Yes, history works fine with the current bindings to alt-p and alt-n, or with 
binding to up or down, but not with binding to modifier-up/down.

--

___
Python tracker 

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



[issue41075] IDLE: Better support history navigation

2020-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

History and up/down is apart of #2704.  It has patches that include the up/down 
change, but I don't expect to use any of them as they are.

I tried Shift/Control/Alt - Up/Down and none worked.  Rebinding just Up/Down 
did (in Shell only, leaving up/down unchanged in Editor).  But not having 
up/down work to move between lines in the Shell multiline statement entry area 
is not acceptable to me.  I don't know if modifiers can never work with up/down 
or if there is something that would make it work.

--
nosy:  -epaine
stage: resolved -> 
status: closed -> open
title: Make support of navigating through prev. commands in IDLE more 
conspicuous -> IDLE: Better support history navigation
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



[issue2704] IDLE: Patch to make PyShell behave more like a Terminal interface

2020-08-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#41075 is specifically about history navigation.  I tried Shift/Control/Alt - 
Up/Down and none worked.  Rebinding just Up/Down did (in Shell, with Editor 
unchanged).  But not having up/down work to move between lines in the Shell 
multiline statement entry area is not acceptable to me.  Two additional idea 
from the new issue: a) Add history commands to context menu to make them more 
discoverable; b) When statement has SyntaxError, put Error message in box and 
let user edit bad code directly, as in Editor.

--

___
Python tracker 

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



[issue41402] email: ContentManager.set_content calls nonexistent method encode() on bytes

2020-08-01 Thread Johannes Reiff


Johannes Reiff  added the comment:

Thanks! Is there anything I need to do regarding the Python 3.8 and 3.9 
backports?

--

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

How about this wording?

If alpha is smaller than 0.1, an occasional OverflowError can
arise when the variate exceeds the range of Python float.

I like using 0.1 because it's easy and gives us some wiggle room.  The actual 
cutoff is lower:

>>> alpha = 0.05079
>>> sys.float_info.epsilon ** (-1.0 / alpha)

>>> alpha = 0.05078
>>> sys.float_info.epsilon ** (-1.0 / alpha)
Traceback (most recent call last):
   File "", line 1, in 
 sys.float_info.epsilon ** (-1.0 / alpha)
1.590779741838475e+308

--

___
Python tracker 

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



[issue41455] Python Devguide differs from python docs

2020-08-01 Thread Yaroslac


New submission from Yaroslac :

As I can see here 
https://github.com/python/devguide/blob/master/garbage_collector.rst#collecting-the-oldest-generation

> the GC only triggers a full collection of the oldest generation if the ratio 
> long_lived_pending / long_lived_total is above a given value (hardwired to 
> 25%)

But in the python docs here 
https://docs.python.org/3.10/library/gc.html#gc.set_threshold

> When the number of allocations minus the number of deallocations exceeds 
> threshold0, collection starts. Initially only generation 0 is examined. If 
> generation 0 has been examined more than threshold1 times since generation 1 
> has been examined, then generation 1 is examined as well. Similarly, 
> threshold2 controls the number of collections of generation 1 before 
> collecting generation 2.

So, which one is correct?

--
assignee: docs@python
components: Documentation
messages: 374665
nosy: Yaroslav, docs@python
priority: normal
severity: normal
status: open
title: Python Devguide differs from python docs
type: resource usage
versions: Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue41454] while loop bug on list

2020-08-01 Thread Dexter Ramos


Dexter Ramos  added the comment:

Thank you Mr. Erick Smith. Now I know. I also tried to find the hard way like 
this:

finding nemo-
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4] --->index
[4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6] --->original list
 / --->started at index 0 with value of 
4
[1, 2, 5, 7, 2, 8, 9, 5, 3, 2, 6, 4] --->1st iteration, all 4's are removed 
then appended so the index adjusted
/--->next at index 1 with a value of 2 
(whereas value 1 was skipped which had index 1 originally; this is not seen on 
the output because it has no duplicate)
[1, 5, 7, 8, 9, 5, 3, 6, 4, 2] --->3rd iteration
   / --->next at index 2 with value of 7; value 
5 was skipped which had the index 2 originally; cause found!
[1, 5, 8, 9, 5, 3, 6, 4, 2, 7] --->4th ...
...
---nemo found---
Credits to you.

Here is the new working code:
---code
bunchofnumbers = [4, 1, 2, 5, 7, 4, 2, 8, 9, 5, 3, 2, 4, 6]
for eachnumber in bunchofnumbers.copy():
while eachnumber in bunchofnumbers:
bunchofnumbers.remove(eachnumber)
bunchofnumbers.append(eachnumber)
bunchofnumbers.sort()
---end of code-
OUTPUT:
[1, 2, 3, 4, 5, 6, 7, 8, 9]
print(bunchofnumbers)

--

___
Python tracker 

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



[issue41454] while loop bug on list

2020-08-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

You're mutating the list while iterating over it, which is causing the behavior 
you're seeing. This isn't a bug.

See for example 
https://stackoverflow.com/questions/6260089/strange-result-when-removing-item-from-a-list

Also, when reporting bugs in the future, please include the output you got, and 
how it differs from what you expected. It's difficult to guess.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue41451] Cannot subclass typing.Generic with __weakref__ slot in Python 3.6

2020-08-01 Thread Joshua Bronson


Joshua Bronson  added the comment:

Thanks so much, @oremanj! Indeed, merely subscripting the class triggers the 
bug, and your 'del slots' workaround does the trick!

For completeness, there is an updated (yet more minimal) repro below/attached.


"""Repro for Python 3.6 slots + weakref + typing.Generic subclass bug."""

from typing import Generic, TypeVar
from weakref import ref


T = TypeVar("T")

class MyGeneric(Generic[T]):
"""MyGeneric works as expected.

>>> example = MyGeneric()
>>> example
<__main__.MyGeneric object at ...>
>>> example._other
<__main__.MyGeneric object at ...>
>>> example._other._other

>>> from pickle import dumps, loads
>>> pickled = dumps(example)
>>> roundtripped = loads(pickled)
>>> roundtripped
<__main__.MyGeneric object at ...>

"""

__slots__ = ("_other", "__weakref__")

def __init__(self) -> None:
self._init_other()

def _init_other(self) -> None:
other = self.__class__.__new__(self.__class__)
other._other = ref(self)
self._other = other

def __getstate__(self) -> dict:
"""Needed to enable pickling due to use of __slots__ and weakrefs."""
return {}

def __setstate__(self, _) -> None:
"""Needed because use of __slots__ would prevent unpickling 
otherwise."""
self._init_other()


# Merely the following is enough to trigger the bug on Python 3.6:
MyGeneric[T]

# This works around the issue if run first (thanks @oremanj):
del MyGeneric.__slots__  # does not actually 'unslot' the class


if __name__ == "__main__":
import doctest
doctest.testmod(optionflags=doctest.ELLIPSIS)

--
Added file: https://bugs.python.org/file49357/bpo41451-repro-min+workaround.py

___
Python tracker 

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



[issue41454] while loop bug on list

2020-08-01 Thread Dexter Ramos


New submission from Dexter Ramos :

The output should have no duplicates but it has. When I added another "5" on 
the list it goes okay and is still okay if I add more. But when there is only 
two 5's it won't do its job.

--
components: Windows
files: app.py
messages: 374661
nosy: Dexter Ramos, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: while loop bug on list
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49356/app.py

___
Python tracker 

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



[issue29269] test_socket failing in solaris

2020-08-01 Thread Dennis Clarke


Dennis Clarke  added the comment:

Well here we are in 2020 and Solaris systems are still running just fine. In 
fact, some big Fujitsu SPARC systems are running in production for years and 
years and also, no surprise, this test still fails horrifically on old stable 
Solaris 10. Python is turning into a piece of supposedly open source software 
with many commercial interests with their hands inside of it. I am not sure how 
to get this bug fixed but I can certainly report that it is still broken in 
3.7.8 on a very stable and reliable platform.

--
nosy: +blastwave
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue41421] Random.paretovariate sometimes raises ZeroDivisionError for small alpha

2020-08-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 5c3270939c09e4c8e80fd26449b718a998701912 by Raymond Hettinger in 
branch 'master':
bpo-41421: Algebraic simplification for random.paretovariate() (GH-21695)
https://github.com/python/cpython/commit/5c3270939c09e4c8e80fd26449b718a998701912


--

___
Python tracker 

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



[issue41447] Resource Tracker in Multiprocessing Shared Memory not working correctly

2020-08-01 Thread Ned Deily


Change by Ned Deily :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue41445] Adding configure temporary files to gitignore

2020-08-01 Thread fj92f3jj923f923


fj92f3jj923f923  added the comment:

Closing it as not important :)

--
resolution:  -> not a bug
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



[issue41452] Inefficient BufferedReader.read(-1)

2020-08-01 Thread Ma Lin


Ma Lin  added the comment:

Some underlying stream has fast-path for .readall().
So close this issue.

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