[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-17 Thread song super

song super <2262720...@qq.com> added the comment:

I mean,os.path.join('3', '{:3')  return  '{:3' in 
windows,However,os.path.join('3', '{:3') return  '3/{:3'in linux,output result 
not '3'in windows,why?
for example:
>>> from os.path import join
>>> join('3', '{:3')
output:'{:3'

>>> join('3', '{3')
output:'3\\{3'

I think 'join('3', '{:3') ' output '3\\{:3' in windows

--
nosy: +2262720766

___
Python tracker 

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



[issue41513] Scale by power of two in math.hypot()

2020-08-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here's a much cheaper way to get correctly rounded results almost all of the 
time.  It uses Serhiy's idea for scaling by a power of two, Tim's idea for 
Veltkamp-Dekker splitting, my variant of Neumaier summation, and the paper's 
differential correction.  Together, these allow the algorithm to simulate 
128-bit quad precision throughout.

# Veltkamp-Dekker splitting

def split(x, T27=ldexp(1.0, 27)+1.0):
t = x * T27
hi = t - (t - x)
lo = x - hi
assert hi + lo == x
return hi, lo

# Variant of Neumaier summation specialized
# for cases where |csum| >= |x| for every x.
# Establishes the invariant by setting *csum*
# to 1.0, only adding *x* values of smaller
# magnitude, and subtracting 1.0 at the end.

def zero():  
return 1.0, 0.0 # csum, frac

def add_on(x, state):
csum, frac = state
assert fabs(csum) >= fabs(x)
oldcsum = csum
csum += x
frac += (oldcsum - csum) + x
return csum, frac

def to_float(state):
csum, frac = state
return csum - 1.0 + frac

def hypot(*xs):
max_value = max(xs, key=fabs)
_, max_e = frexp(max_value)
scalar = ldexp(1.0, -max_e)
parts = zero()
for x in xs:
x *= scalar
a, b = split(x)
parts = add_on(a*a, parts)
parts = add_on(2.0*a*b, parts)
parts = add_on(b*b, parts)
result = sqrt(to_float(parts))
a, b = split(result)
parts = add_on(-a*a, parts)
parts = add_on(-2.0*a*b, parts)
parts = add_on(-b*b, parts)
x = to_float(parts) # best float approx to sum(x_i ** 2) - result**2
result += x / (2.0 * result)
return result / scalar

--

___
Python tracker 

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



[issue41560] pathlib.Path.glob fails on empty string

2020-08-17 Thread Alexander Heger


Alexander Heger  added the comment:

In my code, having been translated form use of `os.path` to `pathlib.Path` the 
change in behaviour caused errors and required significant refactoring.  

Why not just return the empty list if there is no match, as is done in other 
cases when there is no match, except when passing the empty string.  For 
example, in my case, the base path already refers to a potentially existing 
file[name] and I then "glob" for appendices to the filename or suffices (or 
neither or both).  So in this case the glob for empty strong would just return 
the file if it exists.

--

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Another possibility would be accept the reality of the switching delay (so all 
the other commands work without extra changes) and working to minimize it by 
setting sys.setswitchinterval() to something ridiculously low and then 
switching it back to the previous value once we are in the thread that we want. 
If this is not enough we could sed modify the Gil-adquire code to do something 
similar to what the Python 2 implementation did when signals arrive that is 
basically switch constantly between threads until the one that we want runs.

--

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-17 Thread William Pickard


William Pickard  added the comment:

Another thing to note Raymond, as I stated before, example C is, from an 
external context, is a plain property object who's "fget" attribute is an 
instance of whatever "lru_cache" returns.

isinstance won't be able to differentiate between example "a" and "c" without 
checking "fget"

--

___
Python tracker 

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



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

We may need to think as well how some commands interest when you are in a 
different thread context. For instance, stepping into something when you are in 
a different thread is equivalent to setting a breakpoints in the next thread 
instruction, so this has the same considerations as the breakpoints. We may 
want to disallow this or to emit some warning in this case.

--

___
Python tracker 

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



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

* Displaying all threads is trivial.

* Stopping all threads is trivial because of the GIL. When pdb runs in a thread 
all other threads cannot execute python code. They can execute native code bit 
there is not much we can do about it.

* Switching threads is the interesting one. The easiest way is to set the pdb 
trace function in the target thread and run until they thread executes python 
code. This has the following considerations:

  - All PSB commands will automatically work on that thread once the trace 
function is executed.
  - There will be a delay between the command and the thread being switched. 
This is due to the fact that we do not control what thread will run and we need 
to wait until the thread executes Python code.
  - Switching to a thread that is blocked on something (on a lock or on C code) 
will hang.

For this reason, this method can work only for setting breakpoints on threads, 
not for 'switching threads'. The breakpoint will work because that's the 
expected behaviour: the day and the possibility of not hitting it is justified 
on the nature of the breakpoint.

For switching threads, the best way would be to 'virtually switch threads'. 
This means that somehow we switch internally to the thread stack but we keep 
executing on the main thread, we merely switch our internal context.

--

___
Python tracker 

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



[issue41523] functools.cached_property does not satisfy the property check

2020-08-17 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I recommend closing this.

As Serhiy pointed out, they are profoundly different.  Currently, a user can 
rely on the isinstance() check to differentiate them.  So, changing the 
behavior would be a regression.

AFAICT, a user would not be able to deduce anything useful from the 
isinstance() check returning True in all three cases.  Essentially, all they 
have in common is the concept of caching; otherwise, the mechanisms and 
implications are entirely unrelated.

--
nosy: +rhettinger

___
Python tracker 

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



[issue41573] Correct wrong sentences in General FAQ

2020-08-17 Thread wyz23x2


wyz23x2  added the comment:

GH-21915 submitted.

--

___
Python tracker 

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



[issue41573] Correct wrong sentences in General FAQ

2020-08-17 Thread wyz23x2


Change by wyz23x2 :


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

___
Python tracker 

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



[issue41573] Correct wrong sentences in General FAQ

2020-08-17 Thread wyz23x2


New submission from wyz23x2 :

Release candidate is "rc" not "c";
Python 2.x is not supported anymore.

--
assignee: docs@python
components: Documentation
messages: 375583
nosy: docs@python, wyz23x2
priority: normal
severity: normal
status: open
title: Correct wrong sentences in General FAQ
versions: Python 3.10, 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



[issue41541] [PATCH] Make pty.spawn set window size

2020-08-17 Thread Soumendra Ganguly


Soumendra Ganguly  added the comment:

Further note: login_tty will also enable us to set slave termios from the 
parent process in pty.spawn.

Due to the fact that reviewing patches can be overwhelming, v0.5 removes a lot 
of stuff and instead simply performs window resize by calling ioctl TIOCSWINSZ 
on the master end of the pty. Still works as expected.

--
Added file: https://bugs.python.org/file49402/pty.diff

___
Python tracker 

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



[issue41572] Documentation wording fix on Lib/asyncio/transports.py

2020-08-17 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +21030
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21914

___
Python tracker 

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



[issue30493] Increase coverage of base64

2020-08-17 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 2.0 -> 3.0
pull_requests: +21029
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/21913

___
Python tracker 

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



[issue41572] Documentation wording fix on Lib/asyncio/transports.py

2020-08-17 Thread Cleber Rosa


New submission from Cleber Rosa :

The docstring on asyncio.transports.BaseTransport.close() is missing a verb.

--
assignee: docs@python
components: Documentation
messages: 375581
nosy: cleber.gnu, docs@python
priority: normal
severity: normal
status: open
title: Documentation wording fix on Lib/asyncio/transports.py
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
Removed message: https://bugs.python.org/msg375580

___
Python tracker 

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



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
title: Allow pdb to switch to a different thread -> Implement thread-related 
commands in pdb

___
Python tracker 

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



[issue41571] Allow pdb to switch to a different thread

2020-08-17 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

Unfortunately, the thread experience with pdb is not as good as it could be due 
to the lack of thread-related commands. In other debuggers like gdb, is common 
to be able to do some of the following operations:

* list all threads
* switch the context to a different thread.
* Stop all threads when attaching.
* Place a breakpoint in a specific thread.

I think the user experience will improve considerably if we could implement at 
least these features (and maybe some others that we deem useful).

--
messages: 375579
nosy: pablogsal
priority: normal
severity: normal
status: open
title: Allow pdb to switch to a different thread
versions: Python 3.10

___
Python tracker 

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



[issue41571] Implement thread-related commands in pdb

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will start preparing some pull requests unless someone has any concerns about 
this

--

___
Python tracker 

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



[issue41571] Allow pdb to switch to a different thread

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
components: +Library (Lib)

___
Python tracker 

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



[issue41555] re.sub replaces twice

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue41560] pathlib.Path.glob fails on empty string

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> This is not the desired or expected behaviour, which would be to just return 
> `path` if it exists. 

That's the expected behaviour if the call is successful (it does not violate 
any pre-condition.

> This behaviour is also inconsistent with the documentation which states

Not IMHO, what the documentation is described is the happy path/successful 
call. If the pattern is invalid, it can perfectly raise and error and the 
documentation will still be true.

> And it is in contrast to the behaviour of glob.glob, which is just fine with 
> the empty string, returning an empty list.

This is the point that is interesting to discuss. Why is this behavior 
desirable? In my view, it can be the source of bugs if the user is not aware 
that what is placing there is an empty string. When is useful to pass something 
that can be an empty string?+

--
nosy: +pablogsal

___
Python tracker 

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



[issue1524081] logging using the SysLog handler fails if locale is set

2020-08-17 Thread Greg Price


Greg Price  added the comment:

For the record because this issue is mentioned in a comment in 
logging/handlers.py and people are sometimes confused by it today:

> This happens because in that particular locale,
> "INFO".lower() != "info"

Since Python 3, this no longer happens: str.lower() and friends do not depend 
on the current locale.

Specifically, the lower() and similar methods on Unicode strings (now "str", 
previously "unicode") were always independent of the current locale.  The 
corresponding methods on byte strings (now "bytes", previously "str") did have 
this locale-dependent behavior, but that was replaced in commit 
6ccd3f2dbcb98b33a71ffa6eae949deae797c09c, in 2007.

See also #37848, for a 2019 discussion of potentially adding an optional 
parameter to use an *explicit* locale.

--
nosy: +Greg Price

___
Python tracker 

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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread miss-islington


miss-islington  added the comment:


New changeset e3cafebb5cb2bc4df03afb03fa206a37d076d7ee by Miss Islington (bot) 
in branch '3.9':
bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907)
https://github.com/python/cpython/commit/e3cafebb5cb2bc4df03afb03fa206a37d076d7ee


--

___
Python tracker 

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



[issue40756] Second argument of LoggerAdapter.__init__ should default to None

2020-08-17 Thread Arturo Escaip


Arturo Escaip  added the comment:

Done.

--

___
Python tracker 

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



[issue40756] Second argument of LoggerAdapter.__init__ should default to None

2020-08-17 Thread Arturo Escaip


Change by Arturo Escaip :


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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +21027
pull_request: https://github.com/python/cpython/pull/21912

___
Python tracker 

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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4 by Paul Ganssle in 
branch 'master':
bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907)
https://github.com/python/cpython/commit/c3dd7e45cc5d36bbe2295c2840faabb5c75d83e4


--

___
Python tracker 

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



[issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX

2020-08-17 Thread Stefan Krah


Stefan Krah  added the comment:

Well, I misunderstood this sentence then, so it's just for testing. :)

> Our customers should use it or use ulimit -d.


One will hit this issue also when following the MAX_PREC section
in the FAQ, but that is a rare case:

https://docs.python.org/3.10/library/decimal.html#decimal-faq

--

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-08-17 Thread Ned Deily


Ned Deily  added the comment:


New changeset a0ad82959652ff64c99231f457fd740b17330514 by Ned Deily in branch 
'3.7':
bpo-41100: additional fixes for testing on macOS 11 Big Sur Intel
https://github.com/python/cpython/commit/a0ad82959652ff64c99231f457fd740b17330514


--

___
Python tracker 

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



[issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX

2020-08-17 Thread David Edelsohn


David Edelsohn  added the comment:

> About PSALLOC=early , I confirm that it perfectly fixes the issue.

> I'm surprised, because it is unspeakably slow on this machine,

These statements are not contradictory.  No one is suggesting that Python 
always should run with PSALLOC=early.

--

___
Python tracker 

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



[issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX

2020-08-17 Thread Stefan Krah


Stefan Krah  added the comment:

> That's probably due to a very small size of the Paging Space of the AIX 
> machine you used for testing.

That is the case, the machine has 160GB of memory and 1GB of paging space. I 
guess it is configured specifically for not freezing.


> About PSALLOC=early , I confirm that it perfectly fixes the issue.

I'm surprised, because it is unspeakably slow on this machine,
even with the skips in place:

PSALLOC=early time ./python -m test -uall test_decimal

I hit Ctrl-C after 10min, so it takes even longer:

Real   622.11
User   11.63
System 350.12  (!)



The -bmaxdata approach has no speed penalty. Note that you can
use 10 petabytes for the value, it should still prevent this issue.

--

___
Python tracker 

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



[issue35024] Incorrect logging in importlib when '.pyc' file creation fails

2020-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

This seems resolved, can it be closed?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-17 Thread Yonatan Goldschmidt


Yonatan Goldschmidt  added the comment:

Hmm... I didn't think of overlapping lock periods. You are right, Dennis, a 
counter must be managed.

--

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8aa163eea6b0fb4693f6c0a314d4f2ccada51d70 by Hai Shi in branch 
'master':
bpo-1635741: Explict GC collect after PyInterpreterState_Clear() (GH-21902)
https://github.com/python/cpython/commit/8aa163eea6b0fb4693f6c0a314d4f2ccada51d70


--

___
Python tracker 

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



[issue41553] encoded-word abused for header line folding causes RFC 2047 violation

2020-08-17 Thread R. David Murray


R. David Murray  added the comment:

Yes for the registry changes.  I thought we had fixed the bug that was causing 
message-id to get encoded, but maybe it still exists in 3.7?  I don't remember 
when we fixed it (and I may be remembering wrong!)

As for X- "unstructured headers" getting trashed, by *definition* in the rfc, 
if the header body is unstructured it must support RFC encoding.  If does not, 
it is not an unstructured header field.  Which is why I said we need to think 
about what characteristics the default parser should have.  The RFC doesn't 
really speak to that, it expects every header to be one of the defined 
types...but while an X- header might be of a defined type, the email package 
can't know that unless it is told, so what should we use as the default parsing 
strategy?  "text without encoded words" isn't really RFC compliant, I think.  
(Though I'll admit it has been a while since I last reviewed the relevant RFCs.)

Note that I believe that we have an open issue (or at least an open discussion) 
that we should change the 'refold_source' default from 'long' to 'none', which 
means that X- headers would at least be passed through by default.  It would 
also mitigate this problem, and can be used as a local workaround for headers 
that are just getting passed through and not modified.

--

___
Python tracker 

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



[issue41570] Add DearPyGui to faq/gui.rst

2020-08-17 Thread Jonathan Hoffstadt


Change by Jonathan Hoffstadt :


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

___
Python tracker 

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



[issue41570] Add DearPyGui to faq/gui.rst

2020-08-17 Thread Jonathan Hoffstadt


Change by Jonathan Hoffstadt :


--
assignee: docs@python
components: Documentation
nosy: docs@python, jhoffstadt
priority: normal
severity: normal
status: open
title: Add DearPyGui to faq/gui.rst
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



[issue41546] pprint() gives exception when ran from pythonw

2020-08-17 Thread Steve Dower


Steve Dower  added the comment:

I'm inclined to agree that it should pass silently in this case, as if it were 
printing with print() rather than .write().

What better meaning is there for sys.stdout == None than "no output"?

--
versions: +Python 3.10 -Python 3.8

___
Python tracker 

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



[issue40756] Second argument of LoggerAdapter.__init__ should default to None

2020-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

looks like this can be closed now?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2020-08-17 Thread Matt Prahl


Change by Matt Prahl :


--
nosy: +mprahl
nosy_count: 7.0 -> 8.0
pull_requests: +21025
pull_request: https://github.com/python/cpython/pull/21909

___
Python tracker 

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



[issue14134] xmlrpc.client.ServerProxy needs timeout parameter

2020-08-17 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 6.0 -> 7.0
pull_requests: +21024
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/21908

___
Python tracker 

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



[issue40994] Very confusing documenation for abc.Collections

2020-08-17 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue40815] Multiprocessing docs don't describe thread-safety

2020-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

Probably another example: issue41567

--

___
Python tracker 

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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread Paul Ganssle


Change by Paul Ganssle :


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

___
Python tracker 

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



[issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow

2020-08-17 Thread Peter Lovett


Peter Lovett  added the comment:

:-)

--

___
Python tracker 

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



[issue41569] json.JSONEncoder.default should be called for dict keys as well

2020-08-17 Thread David Byrne

New submission from David Byrne :

Sub-classing and overriding json.JSONEncoder.default allows users to create 
custom serialisation for objects that can’t otherwise be serialized. However, 
this method is only called for dictionary values such that dictionary supported 
keys (i.e. hashable types) can not be fully utilized. Calling .default on keys 
as well as values allows users to to fully utilize json for all dict supported 
types. 

See 
https://stackoverflow.com/questions/63393059/json-dump-not-calling-default-or-cls
 for example

--
components: Library (Lib)
messages: 375561
nosy: david.byrne222
priority: normal
severity: normal
status: open
title: json.JSONEncoder.default should be called for dict keys as well
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue41183] Workaround or fix for SSL ".._KEY_TOO_SMALL" test failures

2020-08-17 Thread Larry Hastings


Larry Hastings  added the comment:

> Does testing with the environment variable OPENSSL_CONF=/non-existing-file 
> workaround the remaining issues?

Sadly, no.  I get the same failures whether or not that environment variable is 
set.  And I confirmed that the environment variable survives Python's testing 
harness, it doesn't get unset or overwritten.

--

___
Python tracker 

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



[issue41025] C implementation of ZoneInfo cannot be subclassed

2020-08-17 Thread Paul Ganssle


Paul Ganssle  added the comment:

There are two refleaks here. One is a reference leaking to the weak cache in 
`__init_subclass__` (one leak every time a subclass is created), and the other 
is that when `subclass.clear_cache()` is called, it sets `ZONEINFO_STRONG_CACHE 
= NULL`, thus causing a reference leak to the parent class's strong cache.

I'll send a PR to fix it shortly.

--

___
Python tracker 

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



[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

FWIW I forgot the gc.disable() line in the contextmanager, but what I said 
still applies.

--

___
Python tracker 

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



[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-17 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

The save-a-boolean-for-each-context-manager approach has an issue if used with 
concurrent generators, where the lifetimes of two generator objects might be 
overlapping but not completely nested, as shown below. The same issue should 
arise when using multiple threads. The approach in no_gc.py with counting the 
times_disabled does not run into the same issue.

>>> from contextlib import contextmanager
>>> import gc
>>> @contextmanager
def no_gc():
was_enabled = gc.isenabled()
try:
yield
finally:
if was_enabled:
gc.enable()


>>> def gen1():
with no_gc():
yield "a"
yield "b"
yield "c"


>>> def gen2():
with no_gc():
yield 1
yield 2
yield 3


>>> 
>>> g1 = gen1()
>>> g2 = gen2()
>>> next(g1)
'a'
>>> next(g2)
1
>>> list(g1)
['b', 'c']
>>> gc.isenabled() # should be False!
True
>>> list(g2)
[2, 3]

--

___
Python tracker 

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2020-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

I think this is no a bug, on the basis that multiprocessing.Pool is not 
thread-safe.

--

___
Python tracker 

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



[issue41526] Python 3.9.0rc1 "setup successful" dialog box overflow

2020-08-17 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the report! This should be in the next 3.9 RC.

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

We need to know how to trigger the problem you're seeing. You need to provide 
code we can run that shows the error you're seeing.

--

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread jack1142


Change by jack1142 :


--
nosy: +jack1142

___
Python tracker 

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-17 Thread Matt Joiner


Matt Joiner  added the comment:

https://github.com/python/cpython/blob/48b069a003ba6c684a9ba78493fbbec5e89f10b8/Lib/_collections_abc.py#L953

https://github.com/python/cpython/blob/0e95bbf08571e98f4b688524efc2dcf20d315d91/Lib/typing.py#L1612

--
status: pending -> open

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-08-17 Thread hai shi


Change by hai shi :


--
pull_requests: +21022
pull_request: https://github.com/python/cpython/pull/21902

___
Python tracker 

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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future

2020-08-17 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future

2020-08-17 Thread miss-islington


miss-islington  added the comment:


New changeset d6bdf6d52f0400df1bd1dce24aaad9514015c755 by Miss Islington (bot) 
in branch '3.9':
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not 
a coroutine (GH-21852)
https://github.com/python/cpython/commit/d6bdf6d52f0400df1bd1dce24aaad9514015c755


--

___
Python tracker 

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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future

2020-08-17 Thread miss-islington


miss-islington  added the comment:


New changeset 1baa8b14ee23ef3040923f53565c8d1bafd28117 by Miss Islington (bot) 
in branch '3.8':
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not 
a coroutine (GH-21852)
https://github.com/python/cpython/commit/1baa8b14ee23ef3040923f53565c8d1bafd28117


--

___
Python tracker 

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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
assignee:  -> p-ganssle
priority: normal -> release blocker
versions: +Python 3.10, Python 3.9

___
Python tracker 

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



[issue41568] test_zoneinfo leaked [84, 84, 84] references

2020-08-17 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

OK (skipped=26)
..
test_zoneinfo leaked [84, 84, 84] references, sum=252
test_zoneinfo leaked [41, 41, 41] memory blocks, sum=123
1 test failed again:
test_zoneinfo
== Tests result: FAILURE then FAILURE ==

Example failure:

https://buildbot.python.org/all/#/builders/84/builds/3

--
messages: 375550
nosy: p-ganssle, pablogsal
priority: normal
severity: normal
status: open
title: test_zoneinfo leaked [84, 84, 84] references

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread Stefan Behnel


Stefan Behnel  added the comment:

> libdeflate and isa-l use different compression ratio's for the levels.

I don't see why these would need to translate 1:1. The zlib module is a Python 
API wrapper, it can do its own mapping here, or use the libraries selectively 
only for some compression levels. Python code also cannot rely on an exact bit 
pattern coming out of the zlib/gzip compressor, since that might change with 
the zlib version that is available. So I think we're fine when replacing the 
underlying implementation, as long as the API does not change and the output is 
strictly zlib/gzip compatible (and there are no visible performance/size 
regressions, as your numbers seem to suggest, but that would need some broader 
testing).


You also wrote on python-ideas that

> It is packaged in linux distros already

That might be an option then. CPython could use the existing library if it is 
available. It doesn't have to ship the sources. Most Linux distributions 
already build some standard library modules against the system-wide installed 
libraries rather than whatever CPython ships in its sources. And those 
distributions could then make the library a fixed dependency of their CPython 
packages.

--

___
Python tracker 

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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future

2020-08-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21020
pull_request: https://github.com/python/cpython/pull/21903

___
Python tracker 

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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future

2020-08-17 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21021
pull_request: https://github.com/python/cpython/pull/21904

___
Python tracker 

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



[issue40782] AbstactEventLoop.run_in_executor is listed as an async method, but should actually return a Future

2020-08-17 Thread miss-islington


miss-islington  added the comment:


New changeset 29f84294d88ec493c2de9d6e8dbc12fae3778771 by James Weaver in 
branch 'master':
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not 
a coroutine (GH-21852)
https://github.com/python/cpython/commit/29f84294d88ec493c2de9d6e8dbc12fae3778771


--
nosy: +miss-islington

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

nasm or yasm will work. I only have experience building it with nasm.

But yes that is indeed a dependency. Personally I do not see the problem with 
adding nasm as a build dependency, as it opens up possibilities for even more 
performance optimizations in python by moving parts of the code to Assembly. 
But I can imagine that there might be complications with updating the build 
system.

Libdeflate does not have this problem as it entirely in C. So it could be 
interesting to use that. I think the unfortunate use of memory is due to the 
libdeflate-gzip coding, and not necessarily because of the library. Samtools is 
a tool that uses libdeflate library to great effect and its memory usage is 
fine.

> No, the bug tracker seems fine for this.

Well one thing is that libdeflate and isa-l use different compression ratio's 
for the levels. isa-l does not support anything above 3. libdeflate supports 
1-12. So it is not a one-to-one mapping.

--

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread Stefan Behnel


Stefan Behnel  added the comment:

What about building the library? The readme says it needs nasm? That's not a 
standard dependency for the CPython build currently, which relies solely on a C 
compiler.

--

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread Stefan Behnel


Stefan Behnel  added the comment:

> This has to be in a PEP

No, the bug tracker seems fine for this.

--
nosy: +scoder
resolution: not a bug -> 
stage: resolved -> needs patch
status: closed -> open
type:  -> performance

___
Python tracker 

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2020-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

I see the same in Python 3.10 on windows 10.

If I change the relative imports to absolute imports in a couple of functions 
in multiprocessing.context as below, the attached (pool_error_on_3.9.py) script 
not longer raises the exception.

def SimpleQueue(self):
'''Returns a queue object'''
from multiprocessing.queues import SimpleQueue
return SimpleQueue(ctx=self.get_context())

def Pool(self, processes=None, initializer=None, initargs=(),
 maxtasksperchild=None):
'''Returns a process pool object'''
from multiprocessing.pool import Pool
return Pool(processes, initializer, initargs, maxtasksperchild,
context=self.get_context())

--
nosy: +iritkatriel
versions: +Python 3.10

___
Python tracker 

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



[issue41292] Dead link in Windows FAQ

2020-08-17 Thread Nathaniel Manista


Change by Nathaniel Manista :


--
nosy: +Nathaniel Manista

___
Python tracker 

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



[issue30757] pyinstaller can be added to docs, py2exe ref can be updated

2020-08-17 Thread Nathaniel Manista


Change by Nathaniel Manista :


--
nosy: +Nathaniel Manista

___
Python tracker 

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



[issue41545] gc API requiring matching number of gc.disable - gc.enable calls

2020-08-17 Thread Yonatan Goldschmidt


Yonatan Goldschmidt  added the comment:

> This is exactly the motivation for context managers, no? I attached no_gc.py, 
> which works when nested and should additionally be thread-safe.

My solution was roughly the same (also a context manager, but a bit simplified 
because I didn't need threading support so I didn't bother with locking).

> There is also gc.isenabled(), so couldn't you check that before disabling and 
> remember whether you needed to disable or not?

Yes, but it must be protected like Dennis suggested, otherwise it can't be used 
in a race-free way, for example this snippet is susceptible to a thread switch 
between the `isenabled()` and `disable()` calls (so another thread could 
meanwhile disable GC, and we retain a stale `was_enabled` result)

 was_enabled = gc.isenabled()
 gc.disable()
 ...
 if was_enabled:
 gc.enable()

My points in this issue are:

1. I think that such a safer API should be available in the standard library (I 
don't want to find myself repeating this across different projects). I think 
that wherever you find yourself using `gc.disable()` you should actually be 
using a safer API (that takes into account multithreading & previous 
invocations of `gc.disable()`)
2. A tiny change in `gc.enable()` (as I suggested in msg375376) can make it 
substantially easier for the Python side to protect itself, because it will be 
race-free without any locks.

--

___
Python tracker 

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



[issue41567] multiprocessing.Pool from concurrent threads failure on 3.9.0rc1

2020-08-17 Thread Carl Drougge


New submission from Carl Drougge :

If several threads try to start a multiprocessing.Pool at the same time when no 
pool has been started before this often fails with an exception like this (the 
exact import varies):

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/tmp/py3.9.0rc1/lib/python3.9/threading.py", line 950, in 
_bootstrap_inner
self.run()
  File "/tmp/py3.9.0rc1/lib/python3.9/threading.py", line 888, in run
self._target(*self._args, **self._kwargs)
  File "/tmp/py3.9.0rc1/lib/python3.9/multiprocessing/context.py", line 118, in 
Pool
from .pool import Pool
ImportError: cannot import name 'Pool' from partially initialized module 
'multiprocessing.pool' (most likely due to a circular import) 
(/tmp/py3.9.0rc1/lib/python3.9/multiprocessing/pool.py)

This happens even if Pool was imported before starting the threads and is new 
in 3.9. It's easy to work around by starting a pool in the main thread before 
starting the other threads.

I have attached a minimal example that triggers it. Tested on Debian stable and 
FreeBSD 11.3.

--
components: Library (Lib)
files: pool_error_on_3.9.py
messages: 375542
nosy: drougge
priority: normal
severity: normal
status: open
title: multiprocessing.Pool from concurrent threads failure on 3.9.0rc1
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49401/pool_error_on_3.9.py

___
Python tracker 

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



[issue41032] locale.setlocale example incorrect

2020-08-17 Thread MarcoBakera


MarcoBakera  added the comment:

I have only reported the bug and do not know exactly how to proceed. I don't 
think there's anything wrong with taking over the bug.

--

___
Python tracker 

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



[issue41563] .python_history file causes considerable slowdown

2020-08-17 Thread bytecookie


bytecookie  added the comment:

> it is your responsibility to set a maximum history length.

No, sorry. The problem is not the history file, is the massive slow down it 
causes. And if you have to utilize a process monitoring tool to find out that 
the history file is the cause, its not a matter of responsibility .
You can only be responsible for something you know of.

Still I wonder why this isn't an already widely known problem, or is this a new 
feature? (I am an seasoned developer but very new to python)

--

___
Python tracker 

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



[issue41563] .python_history file causes considerable slowdown

2020-08-17 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> My history file is only 500 lines.

*slaps forehead*

Of course it is, I'm running a customer history hook that has a limit of 500 
lines in the history file.

It looks to me that by default the history feature is set to unlimited lines, 
so I guess that implies that this isn't a bug and it is your responsibility to 
set a maximum history length.

You can put these two lines in your Python startup file:

import readline
readline.set_history_length(1000)  # or any number you like



Personally, I don't think that having a default setting that allows the history 
file to grow to 130MB is a good idea.

--

___
Python tracker 

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



[issue41563] .python_history file causes considerable slowdown

2020-08-17 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

How very odd. I use the Python interactive interpreter extensively, and have 
done so for years. My history file is only 500 lines.

Did you happen to inspect the file before deleting it to see if it contained 
something odd?

What does this print for you?

import readline
readline.get_history_length()

--
nosy: +steven.daprano

___
Python tracker 

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



[issue41540] Test test_maxcontext_exact_arith (_decimal) consumes all memory on AIX

2020-08-17 Thread Tony Reix


Tony Reix  added the comment:

Hi Stefan,
In your message https://bugs.python.org/issue41540#msg375462 , you said:
 "However, instead of freezing the machine, the process gets a proper SIGKILL 
almost instantly."
That's probably due to a very small size of the Paging Space of the AIX machine 
you used for testing. With very small PS, the OS quickly reaches the step where 
PS and memory are full and it tries to kill possible culprits (but often 
killing innocent processes, like my bash shell). However, with a large PS (size 
of the Memory, or half), it takes some time for the OS to consume the PS, and, 
during this time (many seconds if not minutes), the OS looks like frozen and it 
takes many seconds or minutes for a "kill -9 PID" to take effect.

About -bmaxdata, I always used it for extending default memory of a 32bit 
process, but I never used it for reducing the possible memory of a 64bit 
process since some users may want to use python with hundreds of GigaBytes of 
memory. And the python executable used for tests is the same one that is 
delivered to users.

About PSALLOC=early , I confirm that it perfectly fixes the issue. So, we'll 
use it when testing Python.
Our customers should use it or use ulimit -d .
But using -bmaxdata for building python process in 64bit would reduce the 
possibilities of the python process.
In the future, we'll probably improve the compatibility with Linux so that this 
(rare) case no more appear.

BTW, on AIX, we have only 12 test cases failing out of about 32,471 test cases 
run in 64bit, with probably only 5 remaining serious failures. Both with GCC 
and XLC. Not bad. Less in 32bit. Now studying these few remaining issues and 
the still skipped tests.

--

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

This has to be in a PEP. I am sorry I missplaced it on the bugtracker.

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



[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-17 Thread Eryk Sun


Eryk Sun  added the comment:

> I'm not sure if "}" could ever be valid drive letter

The Windows file API is designed in a way to support almost any Unicode BMP 
character in a DOS drive designation. For example, the following creates "{:" 
as a substitute drive for "C:\\Temp":

>>> DefineDosDevice(0, '{:', 'C:\\Temp')

Drive "{:" has a working directory:

>>> os.mkdir('{:/Eggs')
>>> os.chdir('{:/Eggs')
>>> os.chdir('C:/')
>>> ntpath.abspath('{:')
'{:\\Eggs'

The latter is based on a hidden environment variable named "={:", which WinAPI 
GetFullPathNameW consumes:

>>> GetEnvironmentVariable('={:')
'{:\\Eggs'

That said, only drive letters A-Z count for WinAPI GetLogicalDrives and 
GetLogicalDriveStrings, and these are the only drive names that can be assigned 
normally. So it's not important to handle "{:" as a drive. Whatever makes the 
code simpler. 

> ":" can definitely be used in filenames.

Colon is allowed in filepaths, such as in device names and stream designations, 
but most filesystems do not allow colon in filenames. Exceptions include the 
named-pipe filesystem and some redirectors for non-native filesystems, such as 
the VirtualBox shared-folder filesystem. 

The Windows API reserves colon as the delimiter for file streams [1]. In stream 
designations such as "filename:streamname:streamtype", the colon is not part of 
the filename, stream name, or stream type name.

"{:3" could be a file named "{" with a data stream named "3". (The "DATA$" 
stream type is implicit.) The workaround for accessing a named stream in a file 
with a single-character filename is to use an explicitly relative path such as 
"./{:3". This works fine with ntpath.join:

>>> ntpath.join('3', './{:3')
'3\\./{:3'
>>> ntpath.normpath(ntpath.join('3', './{:3'))
'3\\{:3'

---

[1] https://docs.microsoft.com/en-us/windows/win32/fileio/file-streams

--
nosy: +eryksun

___
Python tracker 

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



[issue41546] pprint() gives exception when ran from pythonw

2020-08-17 Thread Vedran Čačić

Vedran Čačić  added the comment:

The big part of the justification for making print a function in Py3 is that it 
can be painlessly replaced with other functions, such as (example given by 
BDFL) pprint.pprint. I think we should do what we can to make the replacement 
as painless as possible.

--
nosy: +veky

___
Python tracker 

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



[issue41566] Include much faster DEFLATE implementations in Python's gzip and zlib libraries. (isa-l)

2020-08-17 Thread Ruben Vorderman


New submission from Ruben Vorderman :

The gzip file format is quite ubiquitous and so is its first (?) free/libre 
implementation zlib with the gzip command line tool. This uses the DEFLATE 
algorithm.

Lately some faster algorithms (most notable zstd) have popped up which have 
better speed and compression ratio vs zlib. Unfortunately switching over to 
zstd will not be seemless. It is not compatible with zlib/gzip in any way. 

Luckily some developers have tried to implement DEFLATE in a faster way. Most 
notably libdeflate (https://github.com/ebiggers/libdeflate) and Intel's storage 
acceleration library (https://github.com/intel/isa-l).

These libraries provide the libdeflate-gzip and igzip utilities respectively. 
These can compress and decompress the same gzip files. An igzip compressed file 
can be read with gzip and vice versa.

To give an idea of the speed improvements that can be obtained. Here are some 
benchmarks. All benchmarks were done using hyperfine 
(https://github.com/sharkdp/hyperfine). The system was a Ryzen 5 3600 with 
2x16GB DDR4-3200 memory. Operating system Debian 10. All benchmarks were 
performed on a tmpfs which lives in memory to prevent IO bottlenecks. The test 
file was a 5 million read FASTQ file of 1.6 GB 
(https://en.wikipedia.org/wiki/FASTQ_format). These type of files are common in 
bioinformatics at 100+ GB sizes so are a good real-world benchmark.

I benchmarked pigz on one thread as well, as it implements zlib but in a faster 
way than gzip. Zstd was benchmarked as a comparison.

Versions: 
gzip 1.9 (provided by debian)
pigz 2.4 (provided by debian)
igzip 2.25.0 (provided by debian)
libdeflate-gzip 1.6 (compiled by conda-build with the recipe here: 
https://github.com/conda-forge/libdeflate-feedstock/pull/4)
zstd 1.3.8 (provided by debian)

By default level 1 is chosen for all compression benchmarks. Time is average 
over 10 runs.

COMPRESSION
programtime   size   memory
gzip   23.5 seconds   657M   1.5M
pigz (one thread)  22.2 seconds   658M   2.4M
libdeflate-gzip10.1 seconds   623M   1.6G (reads entire file in memory)
igzip  4.6 seconds620M   3.5M
zstd (to .zst) 6.1 seconds584M   12.1M

Decompression. All programs decompressed the file created using gzip -1. (Even 
zstd which can also decompress gzip).

DECOMPRESSION
programtime   memory
gzip   10.5 seconds   744K
pigz (one-thread)  6.7 seconds1.2M
libdeflate-gzip3.6 seconds2.2G (reads in mem before writing)
igzip  3.3 seconds3.6M
zstd (from .gz)6.4 seconds2.2M
zstd (from .zst)   2.3 seconds3.1M

As shown from the above benchmarks, using Intel's Storage Acceleration 
Libraries may improve performance quite substantially. Offering very fast 
compression and decompression. This gets igzip in the zstd ballpark in terms of 
speed while still offering backwards compatibility with gzip.

Intel's Storage Acceleration Libraries (isa-l) come with a bsd-3-clause 
license, so there should be no licensing issues when using that code inside of 
CPython.

--
components: Library (Lib)
messages: 375533
nosy: rhpvorderman
priority: normal
severity: normal
status: open
title: Include much faster DEFLATE implementations in Python's gzip and zlib 
libraries. (isa-l)
versions: Python 3.10

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-08-17 Thread Mika Hawkins


Mika Hawkins  added the comment:

Hi,
What you can do is to verify builds on older macOS versions and you can also 
support building using non-system libffi on macOS.

Hope this hhelps...

Regards,
Mika Hawkins

--
nosy: +Mika_Hawkins

___
Python tracker 

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



[issue41565] from os.path import join join('3', '{:3') return '{:3' in windows

2020-08-17 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm fairly sure this is intended behaviour, see 
.

The second arguments is "{:3", the colon means this is interpreted as the the 
relative path "3" on drive "}:".  I'm not sure if "}" could ever be valid drive 
letter, but ":" can definitely be used in filenames.

--
nosy: +ronaldoussoren -2262720766

___
Python tracker 

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



[issue41025] C implementation of ZoneInfo cannot be subclassed

2020-08-17 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset 87d8287865e5c9f137f6b5cf8c34c2c509eb5e9d by Paul Ganssle in 
> branch 'master':
> bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965)

This change introduced a reference leak. 3.9 and master branch are affected.

$ make && ./python -m test -R 3:3 test_zoneinfo 
(...)
test_zoneinfo leaked [84, 84, 84] references, sum=252
test_zoneinfo leaked [41, 41, 41] memory blocks, sum=123
(...)

ZoneInfoSubclassTest and CZoneInfoSubclassTest test cases leak.

Example of test method which leaks:

test.test_zoneinfo.test_zoneinfo.CZoneInfoSubclassTest.test_folds_and_gaps

--
nosy: +vstinner

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-08-17 Thread STINNER Victor


STINNER Victor  added the comment:

I'm now able to build the Python documentation with Sphinx 3.2.1 without 
modifying the Doc/Makefile, so using -W option (treat warnings as errors): 
there are no more Sphinx 3 warnings.

When Sphinx 3 will be more widely available (ex: in Linux distributions), we 
will be able to consider removing c_allow_pre_v3=True and 
c_warn_on_allowed_pre_v3=False in doc/conf.py. For that, we should update the 
documentation to use the Sphinx 3 syntax, see PR 19397 written by Jakob Lykke 
Andersen.

For now, I prefer to keep Sphinx 2 support and so keep Sphinx 2 syntax in the C 
domain, since it allows supporting Sphinx 2 and Sphinx 3.

--

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-08-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21019
pull_request: https://github.com/python/cpython/pull/21901

___
Python tracker 

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



[issue41564] Cannot access member "hex" for type "ByteString"

2020-08-17 Thread Eric V. Smith


Eric V. Smith  added the comment:

Without some example code that shows the problem we can't help you. Have you 
considered that this is a bug with pyright, not a bug with python itself?

--
nosy: +eric.smith
status: open -> pending

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-08-17 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1abeda80f760134b4233608e2c288790f955b95a by Victor Stinner in 
branch 'master':
bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)
https://github.com/python/cpython/commit/1abeda80f760134b4233608e2c288790f955b95a


--

___
Python tracker 

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



[issue40204] Docs build error with Sphinx 3.0 due to invalid C declaration

2020-08-17 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +21018
pull_request: https://github.com/python/cpython/pull/21900

___
Python tracker 

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