[issue45842] AddressSanitizer: bad-free - hello world c extension

2021-11-29 Thread Francesc Elies


Francesc Elies  added the comment:

I am closing this one, bad-free is in this case a false positive.

Starting python and loading a dll which was linked with asan is incorrect.

One should asan-rt as earyly as possible, in order to do that in linux one 
should use LD_PRELOAD but in windows it's a bit more convoluted.

We made an executable which loads asan and instructed the dll DLLs to use the 
runtime linked into the main executable to avoid shadow memory collisions.

In the official docs https://clang.llvm.org/docs/AddressSanitizer.html I could 
not find much about asan with clang under windows. 

Despite the library file names where not the same as in llvm master and that 
the blogpost has msvc in mind instead of clang this blog 
https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/#contributions-to-asan-runtime
 pointed us in the right direction.

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



[issue45929] extend json.tool --json-lines to ignore empty rows

2021-11-29 Thread Vito De Tullio


Change by Vito De Tullio :


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

___
Python tracker 

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



A decade or so of Python programming, and I've never thought to "for-elif"

2021-11-29 Thread Chris Angelico
for ns in namespaces:
if name in ns:
print("Found!")
break
elif name.isupper():
print("All-caps name that wasn't found")

This actually doesn't work. I have been programming in Python for well
over a decade, and never before been in a situation where this would
be useful.

As YAGNIs go, this is right up there.

(For the record, since this was the last thing in the function, I just
made the break a return. Alternatively, an extra indentation level
"else: if name.isupper():" wouldn't have been that terrible.)

Your random piece of amusement for today.

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


[issue44413] OverflowError: mktime argument out of range after 2019

2021-11-29 Thread Irit Katriel


Change by Irit Katriel :


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



[issue33381] [doc] Incorrect documentation for strftime()/strptime() format code %f

2021-11-29 Thread Vishal Pandey


Vishal Pandey  added the comment:

I have made a PR into the repository, can anyone please review and merge it.

--

___
Python tracker 

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



[issue45917] Add math.exp2() function: 2^x

2021-11-29 Thread Tim Peters


Tim Peters  added the comment:

Across millions of tries, same thing: Windows exp2 is off by at least 1 ulp 
over a third of the time, and by over 2 ulp about 3 times per million. Still 
haven't seen pow(2, x) off by as much as 0.52 ulp.

>From its behavior, it appears Windows implements exp2(x) like so:

i = floor(x)
x -= i # now 0 <= x < 1
return ldexp(exp2(x), i)

So it's apparently using some sub-state-of-the-art approximation to 2**x over 
the domain [0, 1].

But a consequence is that it gets it exactly right whenever x is an integer, so 
it's unlikely anyone will notice it's sloppy ;-)

I expect we should just live with it.

--

___
Python tracker 

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



[issue45936] collections.Counter drops key if value is 0 and updating using += operator

2021-11-29 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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



[issue45936] collections.Counter drops key if value is 0 and updating using += operator

2021-11-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think there is a need to list the inplace methods.  They were put in to 
optimize what was already occurring when only the __add__ method was defined.  
Also, other container typically don't specifically call out the inplace methods.

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



[issue45937] Pdb can't use the commands through -c or .pdbrc files

2021-11-29 Thread Hozoy


New submission from Hozoy :

I have a python file:

def do_something():
pass

def main():
a = 1
b = 2
c = a+b
print(f"c:{c}")
pass

if __name__ == '__main__':
main()

I run this command:

python -m pdb -c "b 5" -c "commands 1;;do_something();;end" -c "c" main.py

It doesn't work.
And I have a .pdbrc file

b 5
commands 1
do_something()
end
c

It doesn't work either.

--
components: Library (Lib)
messages: 407350
nosy: Zrincet
priority: normal
severity: normal
status: open
title: Pdb can't use the commands through -c or .pdbrc files
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



[issue45936] collections.Counter drops key if value is 0 and updating using += operator

2021-11-29 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

This is consistent with the docstrings of the methods:

-
>>> help(Counter.__iadd__)
Help on function __iadd__ in module collections:

__iadd__(self, other)
Inplace add from another counter, keeping only positive counts.

>>> c = Counter('abbb')
>>> c += Counter('bcc')
>>> c
Counter({'b': 4, 'c': 2, 'a': 1})

>>> help(Counter.update)
Help on function update in module collections:

update(self, iterable=None, /, **kwds)
Like dict.update() but add counts instead of replacing them.

Source can be an iterable, a dictionary, or another Counter instance.

>>> c = Counter('which')
>>> c.update('witch')   # add elements from another iterable
>>> d = Counter('watch')
>>> c.update(d) # add elements from another counter
>>> c['h']  # four 'h' in which, witch, and watch
4
-


However, it seems Counter.__iadd__ is not mentioned at all at 
https://docs.python.org/3/library/collections.html#collections.Counter. I think 
there could be a doc update.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue45936] collections.Counter drops key if value is 0 and updating using += operator

2021-11-29 Thread Richard Decal


New submission from Richard Decal :

In brief:

```
from collections import Counter
x = Counter({'a': 0, 'b': 1})
x.update(x)  # works: Counter({'a': 0, 'b': 2})
x += x  # expected: Counter({'a': 0, 'b': 3}) actual: Counter({'b': 3})
```

I expect `+=` and `.update()` to be synonymous. However, the += operator is 
deleting keys if the source Counter has a zero count to begin with:

```
x = Counter({'a': 1})
x += Counter({'a': 0})  # ok: Counter({'a': 1})

y = Counter({'a': 0})
y += y  # expected: Counter({'a': 0}) actual: Counter()
```

--
messages: 407348
nosy: crypdick
priority: normal
severity: normal
status: open
title: collections.Counter drops key if value is 0 and updating using += 
operator
type: behavior
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



Re: frozenset can be altered by |=

2021-11-29 Thread Chris Angelico
On Tue, Nov 30, 2021 at 12:41 PM Richard Damon  wrote:
>
> On 11/29/21 5:01 PM, Chris Angelico wrote:
> > On Tue, Nov 30, 2021 at 8:55 AM Marco Sulla
> >  wrote:
> >> I must say that I'm reading the documentation now, and it's a bit
> >> confusing. In the docs, inplace operators as |= should not work. They
> >> are listed under the set-only functions and operators. But, as we saw,
> >> this is not completely true: they work but they don't mutate the
> >> original object. The same for += and *= that are listed under `list`
> >> only.
> >>
> > Previously explained here:
> >
> >>> On Mon, 22 Nov 2021 at 14:59, Chris Angelico  wrote:
>  Yeah, it's a little confusing, but at the language level, something
>  that doesn't support |= will implicitly support it using the expanded
>  version:
> 
>  a |= b
>  a = a | b
> 
>  and in the section above, you can see that frozensets DO support the
>  Or operator.
> 
>  By not having specific behaviour on the |= operator, frozensets
>  implicitly fall back on this default.
> 
> > The docs explicitly show that inplace operators are defined for the
> > mutable set, and not defined for the immutable frozenset. Therefore,
> > using an inplace operator on a frozenset uses the standard language
> > behavior of using the binary operator, then reassigning back to the
> > left operand.
> >
> > This is a language feature and applies to everything. You've seen it
> > plenty of times with integers, and probably strings too. A frozenset
> > behaves the same way that anything else does.
> >
> > ChrisA
>
> I suppose the question comes down to is it worth adding a reminder in
> the description of the inplace operators that if a type doesn't support
> the inplace operator, it is automatically converted into the equivalent
> assignment with the binary operator?
>

My view is: no, because you'd have to put that reminder on every
single object in Python. The details are here, and apply to all Python
code, not to any particular type:

https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements

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


Re: frozenset can be altered by |=

2021-11-29 Thread Richard Damon

On 11/29/21 5:01 PM, Chris Angelico wrote:

On Tue, Nov 30, 2021 at 8:55 AM Marco Sulla
 wrote:

I must say that I'm reading the documentation now, and it's a bit
confusing. In the docs, inplace operators as |= should not work. They
are listed under the set-only functions and operators. But, as we saw,
this is not completely true: they work but they don't mutate the
original object. The same for += and *= that are listed under `list`
only.


Previously explained here:


On Mon, 22 Nov 2021 at 14:59, Chris Angelico  wrote:

Yeah, it's a little confusing, but at the language level, something
that doesn't support |= will implicitly support it using the expanded
version:

a |= b
a = a | b

and in the section above, you can see that frozensets DO support the
Or operator.

By not having specific behaviour on the |= operator, frozensets
implicitly fall back on this default.


The docs explicitly show that inplace operators are defined for the
mutable set, and not defined for the immutable frozenset. Therefore,
using an inplace operator on a frozenset uses the standard language
behavior of using the binary operator, then reassigning back to the
left operand.

This is a language feature and applies to everything. You've seen it
plenty of times with integers, and probably strings too. A frozenset
behaves the same way that anything else does.

ChrisA


I suppose the question comes down to is it worth adding a reminder in 
the description of the inplace operators that if a type doesn't support 
the inplace operator, it is automatically converted into the equivalent 
assignment with the binary operator?


--
Richard Damon

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


[issue22656] `help` ignores `__doc__` of descriptors

2021-11-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This was fixed long ago in commit ac4bdcc80e986bdd5b9d10ab0bce35aabb790a3e

The code is in inspect.py::_finddoc().  See issue 25503.

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-11-29 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
nosy: +kj

___
Python tracker 

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



[issue44413] OverflowError: mktime argument out of range after 2019

2021-11-29 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Cannot reproduce with 3.8.6 on MacOS. The code runs without any errors. As OP 
hasn't responded in 4 months I think we should close as "works for me".

--
nosy: +andrei.avk

___
Python tracker 

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



[issue45896] Conflicting statements in docs about default support for asyncio subprocesses on Windows

2021-11-29 Thread Rob


Change by Rob :


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

___
Python tracker 

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



[issue45813] Importing asyncio after deleting a coroutine object and before cleaning it up leads to crashing on Python3.11

2021-11-29 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I think the PR fixed one case, but the other case (when coro is kept around) 
still fails an assertion:

Python 3.11.0a2+ (heads/main:734ed35383, Nov 29 2021, 19:29:25) [MSC v.1929 64 
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> async def f(): pass
...
>>> coro = f()
>>> frame = coro.cr_frame
>>> frame.clear()
:1: RuntimeWarning: coroutine 'f' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Assertion failed: f->f_frame->generator == NULL, file 
C:\Users\sween\Source\Repos\cpython2\multiply\Objects\frameobject.c, line 689

Perhaps there should be some sort of backport as well?

--
status: closed -> open

___
Python tracker 

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



[issue41102] ZipFile.namelist() does not match the actual files in .zip file

2021-11-29 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Closing by request of OP.

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



[issue22656] `help` ignores `__doc__` of descriptors

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

I am unable to reproduce the problem on 3.11 (on a Mac). I get both help 
messages from Ram's code.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-11-29 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

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



[issue45451] IDLE - modify text frame and widget borders

2021-11-29 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This issue applies to both Shell, with the prompt sidebar, and editor windows, 
with line number sidebars.  I looked carefully at Windows Notepad++ editor 
tabs.  They have a tab border, separate from the window border, that 
encompasses the line numbers, text, and scrollbar, but not the status bar.  The 
are no internal lines between the three components.  But the line numbers and 
scrollbar have a light gray background that separates them from the text.  

The IDLE text widgets instead have a border around the text but apparently not 
one around the larger frame.  As a result, text widgets with just a scrollbar 
do not look exactly right.  It would be easy to delete the text border and 
adjust the frame border. But as I suggested previously, I am pretty sure 
deleting it entirely would require a default light gray background.

Any change would have to be tested on all 3 major systems.

--
title: IDLE Shell GUI - remove window border -> IDLE - modify text frame and 
widget borders

___
Python tracker 

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



[issue23217] help() function incorrectly captures comment preceding a nested function

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.2, Python 3.3, Python 
3.5

___
Python tracker 

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



[issue23717] strptime() with year-weekday pair can produce invalid data

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue23056] tarfile raises an exception when reading an empty tar in streaming mode

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue22859] unittest.TestProgram.usageExit no longer invoked

2021-11-29 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
versions: +Python 3.11 -Python 3.5

___
Python tracker 

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



[issue13236] unittest needs more flush calls

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11:

Traceback (most recent call last):
  File "/Users/iritkatriel/src/cpython-1/Lib/encodings/idna.py", line 165, in 
encode
raise UnicodeError("label empty or too long")
^
UnicodeError: label empty or too long

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/iritkatriel/src/cpython-1/Lib/socket.py", line 824, in 
create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
   ^^^
  File "/Users/iritkatriel/src/cpython-1/Lib/socket.py", line 955, in 
getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
   ^^^
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or 
too long)

--
nosy: +iritkatriel
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue11109] socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

I've created Issue45935 for the missing test and will close this as resolved in 
version 3.3.

--
nosy: +iritkatriel
status: open -> closed

___
Python tracker 

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



[issue45935] Add test for Issue11109: socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass.

2021-11-29 Thread Irit Katriel


New submission from Irit Katriel :

As mentioned in https://bugs.python.org/issue11109#msg136869, test_socketserver 
needs to be updated to serve as a regression test for Issue11109.

--
components: Tests
messages: 407335
nosy: giampaolo.rodola, gregory.p.smith, iritkatriel, jwarkentin, orsenthil, 
python-dev, vstinner
priority: normal
severity: normal
status: open
title: Add test for Issue11109: socketserver.ForkingMixIn leaves zombies, also 
fails to reap all zombies in one pass.
type: enhancement
versions: Python 3.11

___
Python tracker 

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



Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread Cameron Simpson
On 30Nov2021 10:59, DL Neil  wrote:
>Fedora names it as rxvt-unicode.
>Installed v9.26
>Text is too small for these old eyes.

Fair enough. There are resources, but not worth it unless you really 
want the app.

>No menu bar and no context menus.

Um, yes. The (hardware, serial) terminals we had a uni didn't have such 
niceties, and therefore we should not want them.

>Unable to copy-paste (the flag codes) into that window.
>Removed.

Fair enough.

>I choose not to even try to remember the difficulties of working with
>small screens over-laying one another and 'getting lost' in the pile!

Aye. Tiling is very nice.

>I'm a lazy toad. Thus the idea that the IDE will allow me to 'press a
>(single) button' to repeat the last-run test/execute the code, without
>me having to commit a Save and to jump between panels/windows/screens,
>is seductive.

I once had a vi macro bound to ";" for "^W:!!^M", which autosaves the 
current file and reran the last shell command. Used it a lot in the 
single-terminal days. I unbound it several years ago though.

>I've nominated Kitty as
>Fedora's default terminal. We'll see how it goes with work-loads beyond
>raising the flag...

I'd like to hear how that goes down the track. If I find myself on a 
Linux desktop again a good terminal emulator would be very welcome.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread miss-islington


miss-islington  added the comment:


New changeset b91805ec0283f0642aa3311ec617c8596f65b7b4 by Miss Islington (bot) 
in branch '3.9':
bpo-45931: Prevent Directory.Build.props/targets from leaking from directories 
above the repo when building on Windows (GH-29854)
https://github.com/python/cpython/commit/b91805ec0283f0642aa3311ec617c8596f65b7b4


--

___
Python tracker 

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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread miss-islington


miss-islington  added the comment:


New changeset 5a6d9ed700ecc6984387e0533b11d81692c40469 by Miss Islington (bot) 
in branch '3.10':
bpo-45931: Prevent Directory.Build.props/targets from leaking from directories 
above the repo when building on Windows (GH-29854)
https://github.com/python/cpython/commit/5a6d9ed700ecc6984387e0533b11d81692c40469


--
nosy: +miss-islington

___
Python tracker 

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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread Steve Dower


Steve Dower  added the comment:

Looks like it's gone through. Thanks!

--
nosy:  -miss-islington
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue45934] python curses newterm implementation

2021-11-29 Thread NIKOLA DRAGANIC


Change by NIKOLA DRAGANIC :


--
components: C API, Windows
nosy: draganic1, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: python curses newterm implementation
type: enhancement
versions: Python 3.10, Python 3.11, 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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread Steve Dower


Steve Dower  added the comment:


New changeset 734ed3538314c9651ae64d5e2e0e98aae3aec17b by David Federman in 
branch 'main':
bpo-45931: Prevent Directory.Build.props/targets from leaking from directories 
above the repo when building on Windows (GH-29854)
https://github.com/python/cpython/commit/734ed3538314c9651ae64d5e2e0e98aae3aec17b


--

___
Python tracker 

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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +28083
pull_request: https://github.com/python/cpython/pull/29855

___
Python tracker 

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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28084
pull_request: https://github.com/python/cpython/pull/29856

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-11-29 Thread Jen Kris via Python-list
Thanks to you and Cameron for your replies.  The C side has an epoll_ctl set, 
but no event loop to handle it yet.  I'm putting that in now with a pipe write 
in Python-- as Cameron pointed out that is the likely source of blocking on C.  
The pipes are opened as rdwr in Python because that's nonblocking by default.  
The child will become more complex, but not in a way that affects polling.  And 
thanks for the tip about the c-string termination. 



Nov 29, 2021, 14:12 by ba...@barrys-emacs.org:

>
>
>> On 29 Nov 2021, at 20:36, Jen Kris via Python-list  
>> wrote:
>>
>> I have a C program that forks to create a child process and uses execv to 
>> call a Python program.  The Python program communicates with the parent 
>> process (in C) through a FIFO pipe monitored with epoll(). 
>>
>> The Python child process is in a while True loop, which is intended to keep 
>> it running while the parent process proceeds, and perform functions for the 
>> C program only at intervals when the parent sends data to the child -- 
>> similar to a daemon process. 
>>
>> The C process writes to its end of the pipe and the child process reads it, 
>> but then the child process continues to loop, thereby blocking the parent. 
>>
>> This is the Python code:
>>
>> #!/usr/bin/python3
>> import os
>> import select
>>
>> #Open the named pipes
>> pr = os.open('/tmp/Pipe_01', os.O_RDWR)
>>
> Why open rdwr if you are only going to read the pipe?
>
>> pw = os.open('/tmp/Pipe_02', os.O_RDWR)
>>
> Only need to open for write.
>
>>
>> ep = select.epoll(-1)
>> ep.register(pr, select.EPOLLIN)
>>
>
> Is the only thing that the child does this:
> 1. Read message from pr
> 2. Process message
> 3. Write result to pw.
> 4. Loop from 1
>
> If so as Cameron said you do not need to worry about the poll.
> Do you plan for the child to become more complex?
>
>>
>> while True:
>>
>>  events = ep.poll(timeout=2.5, maxevents=-1)
>>  #events = ep.poll(timeout=None, maxevents=-1)
>>
>>  print("child is looping")
>>
>>  for fileno, event in events:
>>  print("Python fileno")
>>  print(fileno)
>>  print("Python event")
>>  print(event)
>>  v = os.read(pr,64)
>>  print("Pipe value")
>>  print(v)
>>
>> The child process correctly receives the signal from ep.poll and correctly 
>> reads the data in the pipe, but then it continues looping.  For example, 
>> when I put in a timeout:
>>
>> child is looping
>> Python fileno
>> 4
>> Python event
>> 1
>> Pipe value
>> b'10\x00'
>>
> The C code does not need to write a 0 bytes at the end.
> I assume the 0 is from the end of a C string.
> UDS messages have a length.
> In the C just write 2 byes in the case.
>
> Barry
>
>> child is looping
>> child is looping
>>
>> That suggests that a while True loop is not the right thing to do in this 
>> case.  My question is, what type of process loop is best for this situation? 
>>  The multiprocessing, asyncio and subprocess libraries are very extensive, 
>> and it would help if someone could suggest the best alternative for what I 
>> am doing here. 
>>
>> Thanks very much for any ideas. 
>>
>>
>> -- 
>> https://mail.python.org/mailman/listinfo/python-list
>>

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


[issue45932] EmailMessage incorrectly splits name and address header

2021-11-29 Thread Alexander Mohr


Change by Alexander Mohr :


--
title: EmailMessage incorrectly splits reply-to header -> EmailMessage 
incorrectly splits name and address header

___
Python tracker 

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



[issue45451] IDLE Shell GUI - remove window border

2021-11-29 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood

___
Python tracker 

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



[issue45933] Illegal Instrution (Core Dumped)

2021-11-29 Thread Tom E


New submission from Tom E :

When compiling CPython 3.10 on Ubuntu 22.04, with GCC 11.2.0, it compiles 
successfully, but when trying to run it it just gives Illegal Instrution (Core 
Dumped). But when I build 3.9.9 its just fine... CPU is Intel Core i5-10400.

--
messages: 407330
nosy: guacaplushy
priority: normal
severity: normal
status: open
title: Illegal Instrution (Core Dumped)
type: crash
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



Re: Python child process in while True loop blocks parent

2021-11-29 Thread Barry


> On 29 Nov 2021, at 20:36, Jen Kris via Python-list  
> wrote:
> 
> I have a C program that forks to create a child process and uses execv to 
> call a Python program.  The Python program communicates with the parent 
> process (in C) through a FIFO pipe monitored with epoll().  
> 
> The Python child process is in a while True loop, which is intended to keep 
> it running while the parent process proceeds, and perform functions for the C 
> program only at intervals when the parent sends data to the child -- similar 
> to a daemon process. 
> 
> The C process writes to its end of the pipe and the child process reads it, 
> but then the child process continues to loop, thereby blocking the parent. 
> 
> This is the Python code:
> 
> #!/usr/bin/python3
> import os
> import select
> 
> #Open the named pipes
> pr = os.open('/tmp/Pipe_01', os.O_RDWR)
> pw = os.open('/tmp/Pipe_02', os.O_RDWR)

You will need to set the fd’s to non blocking on parent and child.
Otherwise the parent will block on its write until the child reads the message.

Barry
> 
> ep = select.epoll(-1)
> ep.register(pr, select.EPOLLIN)
> 
> while True:
> 
> events = ep.poll(timeout=2.5, maxevents=-1)
> #events = ep.poll(timeout=None, maxevents=-1)
> 
> print("child is looping")
> 
> for fileno, event in events:
> print("Python fileno")
> print(fileno)
> print("Python event")
> print(event)
> v = os.read(pr,64)
> print("Pipe value")
> print(v)
> 
> The child process correctly receives the signal from ep.poll and correctly 
> reads the data in the pipe, but then it continues looping.  For example, when 
> I put in a timeout:
> 
> child is looping
> Python fileno
> 4
> Python event
> 1
> Pipe value
> b'10\x00'
> child is looping
> child is looping
> 
> That suggests that a while True loop is not the right thing to do in this 
> case.  My question is, what type of process loop is best for this situation?  
> The multiprocessing, asyncio and subprocess libraries are very extensive, and 
> it would help if someone could suggest the best alternative for what I am 
> doing here. 
> 
> Thanks very much for any ideas. 
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: Python child process in while True loop blocks parent

2021-11-29 Thread Barry


> On 29 Nov 2021, at 20:36, Jen Kris via Python-list  
> wrote:
> 
> I have a C program that forks to create a child process and uses execv to 
> call a Python program.  The Python program communicates with the parent 
> process (in C) through a FIFO pipe monitored with epoll().  
> 
> The Python child process is in a while True loop, which is intended to keep 
> it running while the parent process proceeds, and perform functions for the C 
> program only at intervals when the parent sends data to the child -- similar 
> to a daemon process. 
> 
> The C process writes to its end of the pipe and the child process reads it, 
> but then the child process continues to loop, thereby blocking the parent. 
> 
> This is the Python code:
> 
> #!/usr/bin/python3
> import os
> import select
> 
> #Open the named pipes
> pr = os.open('/tmp/Pipe_01', os.O_RDWR)
Why open rdwr if you are only going to read the pipe?
> pw = os.open('/tmp/Pipe_02', os.O_RDWR)
Only need to open for write.
> 
> ep = select.epoll(-1)
> ep.register(pr, select.EPOLLIN)

Is the only thing that the child does this:
1. Read message from pr
2. Process message
3. Write result to pw.
4. Loop from 1

If so as Cameron said you do not need to worry about the poll.
Do you plan for the child to become more complex?

> 
> while True:
> 
> events = ep.poll(timeout=2.5, maxevents=-1)
> #events = ep.poll(timeout=None, maxevents=-1)
> 
> print("child is looping")
> 
> for fileno, event in events:
> print("Python fileno")
> print(fileno)
> print("Python event")
> print(event)
> v = os.read(pr,64)
> print("Pipe value")
> print(v)
> 
> The child process correctly receives the signal from ep.poll and correctly 
> reads the data in the pipe, but then it continues looping.  For example, when 
> I put in a timeout:
> 
> child is looping
> Python fileno
> 4
> Python event
> 1
> Pipe value
> b'10\x00'
The C code does not need to write a 0 bytes at the end.
I assume the 0 is from the end of a C string.
UDS messages have a length.
In the C just write 2 byes in the case.

Barry

> child is looping
> child is looping
> 
> That suggests that a while True loop is not the right thing to do in this 
> case.  My question is, what type of process loop is best for this situation?  
> The multiprocessing, asyncio and subprocess libraries are very extensive, and 
> it would help if someone could suggest the best alternative for what I am 
> doing here. 
> 
> Thanks very much for any ideas. 
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


[issue45932] EmailMessage incorrectly splits reply-to header

2021-11-29 Thread Alexander Mohr


New submission from Alexander Mohr :

If you have a reply-to list that contains a name with a comma it must be 
quoted, however if the line length is just right python with split the name 
incorrectly and not keep the quote.  Note that the CC line keeps the quote in 
the name but the reply-to does not, presumably since the line is slightly 
longer.

example:
from email.message import EmailMessage


def main():
message = EmailMessage()
message['From'] = 'no-re...@farmersbusinessnetwork.com'
message['Reply-To'] = """MEGAN FOOOBAR 
,"KDJEHGI, SCOTT KJUYT" 
"""
message['To'] = KDJEHGI, SCOTT KJUYT" """
message['Subject'] = "does not matter"
message['CC'] = """MEGAN FOOOBAR ,"KDJEHGI, 
SCOTT KJUYT" """
message.set_content('foo bar')
print(message.as_string())


if __name__ == '__main__':
main()

--
components: email
messages: 407329
nosy: barry, r.david.murray, thehesiod
priority: normal
severity: normal
status: open
title: EmailMessage incorrectly splits reply-to header
type: behavior
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



[issue7951] Should str.format allow negative indexes when used for __getitem__ access?

2021-11-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I recommend not adding support for negative indexing to format() for accessing 
positional arguments.  There is almost no reason to do this because it almost 
always makes the format string less readable, because the number of arguments 
is always known in advance, and because the arguments are almost always used 
entirely rather than selectively.

Negative index support isn't a feature of the language.  Instead, it is a 
feature provided on a class by class basis, if it makes sense for that class 
and for its use cases.

We are not obliged to provide negative index support in places where it doesn't 
make sense or where it makes code less readable.  For example, the islice() 
function doesn't support negative indices because it doesn't make sense there.  
Likewise, the Sequence ABC doesn't require negative index support or slice 
support.

--

___
Python tracker 

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



Re: frozenset can be altered by |=

2021-11-29 Thread Chris Angelico
On Tue, Nov 30, 2021 at 8:55 AM Marco Sulla
 wrote:
>
> I must say that I'm reading the documentation now, and it's a bit
> confusing. In the docs, inplace operators as |= should not work. They
> are listed under the set-only functions and operators. But, as we saw,
> this is not completely true: they work but they don't mutate the
> original object. The same for += and *= that are listed under `list`
> only.
>

Previously explained here:

> > On Mon, 22 Nov 2021 at 14:59, Chris Angelico  wrote:
> > >
> > > Yeah, it's a little confusing, but at the language level, something
> > > that doesn't support |= will implicitly support it using the expanded
> > > version:
> > >
> > > a |= b
> > > a = a | b
> > >
> > > and in the section above, you can see that frozensets DO support the
> > > Or operator.
> > >
> > > By not having specific behaviour on the |= operator, frozensets
> > > implicitly fall back on this default.
> > >

The docs explicitly show that inplace operators are defined for the
mutable set, and not defined for the immutable frozenset. Therefore,
using an inplace operator on a frozenset uses the standard language
behavior of using the binary operator, then reassigning back to the
left operand.

This is a language feature and applies to everything. You've seen it
plenty of times with integers, and probably strings too. A frozenset
behaves the same way that anything else does.

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


Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread dn via Python-list
On 30/11/2021 10.19, Cameron Simpson wrote:
> On 29Nov2021 22:25, DL Neil  wrote:
 Probably a font issue. Not many fonts support the flags.
>>>
>>> Agree about the font support. Some terminal emulators make an effort to
>>> have fallback fonts for when your preferred font lacks a glyph. IIRC
>>> urxvt is such a terminal on Linux.
>>
>> Not sure about this. Most other applications on this PC will display the
>> two countries' flags, as desired, eg Writer, web-browser, even xed
>> (basic text editor).
> 
> Seem Stefan Ram's advice, which points out that you can tell if this is 
> a font problem (no flag glyph) or a combining problem (2 glyphs 
> presented instead of one). I had not considered that.

@Stefan's advice preceded by report that two glyphs were printed (not
one): "the two letters "N" and "Z" are shown with dotted-outlines"
(I think, the UTF-16 decoding)


>> rxvt: won't compile, gave-up fighting unfamiliar requirements
> 
> See if there's a package for urxvt, which was the "unicode" flavour of 
> rxvt (long ago - rxvt if probably supposed to be unicode capable these 
> days, surely).

Fedora names it as rxvt-unicode.
Installed v9.26
Text is too small for these old eyes.
No menu bar and no context menus.
Unable to copy-paste (the flag codes) into that window.
Removed.


>> Kitty: works!
> 
> Yay!
> 
>> Kitty is not something I've come-across before. Its write-up says
>> «
>> Kitty is a free, open-source, and fast, feature-rich, GPU accelerated
>> terminal emulator for Linux, that supports all present-day terminal
>> features, such as Unicode, true color, text formatting, bold/italic
>> fonts, tiling of multiple windows and tabs, etc.
> 
> A tiling terminal emulator can be a great thing. I'm on a Mac with 
> iTerm, which:
> - has tabs
> - has panes (split the view into multiple panels, each running a 
>   terminal)
> 
> My personal dev desktop tends to use a full screen iTerm split 
> vertically into 2 panes: an editor on the left (vim, itself split 
> vertically into 2 vim windows) and a shell on the right; sometimes 
> several shells (right hand pane further split horizontally).
> 
> Then, since I tend to keep per-branch checkouts around, tabs for the 
> things I'm working on, each configured as above. Then I just switch tabs 
> for the different areas.


Yes, a good way to work. Neatly explained.

I choose not to even try to remember the difficulties of working with
small screens over-laying one another and 'getting lost' in the pile!

My desktop/dev.svr features two screens: one in 'portrait mode' and the
other 'landscape'. The former is very good for code-listings. The latter
for execution-display, pytest reports, etc. As you describe, each can be
sub-divided when needs-arise. A neat feature is that "Tool Windows" can
be tucked-away, and only 'pulled-out' when required, eg am not looking
at Sourcery's assessments right now (unless it highlights the commission
of some 'crime' as I type) but will check prior to (or as part of) git
commit. The Tool Window's name/label in the 'dock' also forms a reminder
that I shouldn't (totally) neglect my responsibilities!

These are managed within the IDE - sadly, PyCharm's terminal/console
fails the 'flag test', as reported yesterday. (am not sure if one might
be able to select which terminal emulator to use ...)

I'm a lazy toad. Thus the idea that the IDE will allow me to 'press a
(single) button' to repeat the last-run test/execute the code, without
me having to commit a Save and to jump between panels/windows/screens,
is seductive.

Don't tell my trainees! Every course sees three or four who 'cry for
help' because making some change in their choice of editor/IDE does not
result in similar within the web-browser. Did you forget to save the
source, Luke? That's not to say there won't be considerably more who
manage to diagnose the problem without admitting such to 'the outside
world'!


There are times when there is no need to (wait quite a while to) boot-up
a whole IDE, eg running a utility program. I've nominated Kitty as
Fedora's default terminal. We'll see how it goes with work-loads beyond
raising the flag...
Salute!
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: frozenset can be altered by |=

2021-11-29 Thread Marco Sulla
I must say that I'm reading the documentation now, and it's a bit
confusing. In the docs, inplace operators as |= should not work. They
are listed under the set-only functions and operators. But, as we saw,
this is not completely true: they work but they don't mutate the
original object. The same for += and *= that are listed under `list`
only.

On Mon, 22 Nov 2021 at 19:54, Marco Sulla  wrote:
>
> Yes, and you do this regularly. Indeed integers, for example, are immutables 
> and
>
> a = 0
> a += 1
>
> is something you do dozens of times, and you simply don't think that
> another object is created and substituted for the variable named `a`.
>
> On Mon, 22 Nov 2021 at 14:59, Chris Angelico  wrote:
> >
> > On Tue, Nov 23, 2021 at 12:52 AM David Raymond  
> > wrote:
> > > It is a little confusing since the docs list this in a section that says 
> > > they don't apply to frozensets, and lists the two versions next to each 
> > > other as the same thing.
> > >
> > > https://docs.python.org/3.9/library/stdtypes.html#set-types-set-frozenset
> > >
> > > The following table lists operations available for set that do not apply 
> > > to immutable instances of frozenset:
> > >
> > > update(*others)
> > > set |= other | ...
> > >
> > > Update the set, adding elements from all others.
> >
> > Yeah, it's a little confusing, but at the language level, something
> > that doesn't support |= will implicitly support it using the expanded
> > version:
> >
> > a |= b
> > a = a | b
> >
> > and in the section above, you can see that frozensets DO support the
> > Or operator.
> >
> > By not having specific behaviour on the |= operator, frozensets
> > implicitly fall back on this default.
> >
> > ChrisA
> > --
> > https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45451] IDLE Shell GUI - remove window border

2021-11-29 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I request that this entire new feature be reverted.  Having used it in 
classroom environment, it has been a catastrophe for teaching and is a 
significant regression in usability.

Here are my notes so far:

1) As the OP says, this strong vertical line is visually jarring and against 
graphic design principles that allow the eye to group input/output pairs.  
Contrast this with Jupyter, Ipython, and previous versions of IDLE which use 
strong horizontal delineations between successive input/output pairs.

2) Pasting multiple statements into the shell window causes the first to be 
executed and the other statements are silently ignored.  This is a recurring 
problem with new students and for those with Jupyter experience.  For example, 
cut and paste these two statements into the shell and press return/enter:

print('hello')   # This executes
print('world')   # This is silently ignored

3) When students have errors, it is the norm to communicate them via a chat 
window.  Formerly, the PS1 prompt separated the inputs from the outputs in a 
shell session; however, the PS1 and PS2 prompts are not included in a cut and 
paste section.  The session becomes unintelligible because essential 
information is lost.   This affects chat, posting interactive sessions to 
StackOverflow, and the ability to post examples in docstrings.  In the main 
Python documentation, the examples always show the >>> but there is no longer a 
way to extract this essential information from an interactive session.

4) Related to #3 is that saving the shell window loses all the prompts.  For a 
decade, I've performed live interactive demonstrations and have saved the 
sessions so that students could review it.  Those saved sessions are now 
unreadable and therefore unusable.

Here is what a saved interactive lesson used to look like:

Python 3.7.6 (v3.7.6:43364a7ae0, Dec 18 2019, 14:18:50)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
>>> # Quoting syntax:  '  "   '''   """
>>> 'hello'
'hello'
>>> "hello"
'hello'
>>> '''hello'''
'hello'
>>> """hello"""
'hello'
>>> print('Don\'t prefer backslashes')
Don't prefer backslashes
>>> print("Instead, we've used alternate quotes")
Instead, we've used alternate quotes
>>> print('''She said, "I'm a good string quoter."''')
She said, "I'm a good string quoter."
>>> 30 + 40 - 5
65
>>> _ * 10
650
>>> _ * 10
6500
>>> type(_)


Here is what the saved session looks like now:

Python 3.11.0a2 (v3.11.0a2:e2b4e4bab9, Nov  5 2021, 15:54:35) [Clang 13.0.0 
(clang-1300.0.29.3)] on darwin
Type "help", "copyright", "credits" or "license()" for more information.
# Quoting syntax:  '  "   '''   """
'hello'
'hello'
"hello"
'hello'
'''hello'''
'hello'
"""hello"""
'hello'
print('Don\'t prefer backslashes')
Don't prefer backslashes
print("Instead, we've used alternate quotes")
Instead, we've used alternate quotes
print('''She said, "I'm a good string quoter."''')
She said, "I'm a good string quoter."
30 + 40 - 5
65
_ * 10
650
_ * 10
6500
type(_)


5) With new students, we have a problem we didn't use to have before.  When 
they emulate a live demo, they are typing the '...' PS1 prompt.  It is 
confusing.

FWIW, when I say "students", I'm referring to adults who are already experts in 
their field.  Today I was teaching experienced engineers (most with masters 
degrees) at a major consumer electronics company.  The new IDLE feature 
seriously degraded their experience and almost every learner was adversely 
affected in some way.

--
nosy: +rhettinger
priority: normal -> high

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-11-29 Thread Steve Dower


Steve Dower  added the comment:

Basically unchanged on Debian/WSL as well.

There's a new conflict arisen, so I'll resolve that and then merge.

--

___
Python tracker 

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



Re: print('\N{flag: Mauritius}') not supported in py3.9

2021-11-29 Thread Cameron Simpson
On 29Nov2021 22:25, DL Neil  wrote:
>>> Probably a font issue. Not many fonts support the flags.
>>
>> Agree about the font support. Some terminal emulators make an effort to
>> have fallback fonts for when your preferred font lacks a glyph. IIRC
>> urxvt is such a terminal on Linux.
>
>Not sure about this. Most other applications on this PC will display the
>two countries' flags, as desired, eg Writer, web-browser, even xed
>(basic text editor).

Seem Stefan Ram's advice, which points out that you can tell if this is 
a font problem (no flag glyph) or a combining problem (2 glyphs 
presented instead of one). I had not considered that.

>rxvt: won't compile, gave-up fighting unfamiliar requirements

See if there's a package for urxvt, which was the "unicode" flavour of 
rxvt (long ago - rxvt if probably supposed to be unicode capable these 
days, surely).

>Kitty: works!

Yay!

>Kitty is not something I've come-across before. Its write-up says
>«
>Kitty is a free, open-source, and fast, feature-rich, GPU accelerated
>terminal emulator for Linux, that supports all present-day terminal
>features, such as Unicode, true color, text formatting, bold/italic
>fonts, tiling of multiple windows and tabs, etc.

A tiling terminal emulator can be a great thing. I'm on a Mac with 
iTerm, which:
- has tabs
- has panes (split the view into multiple panels, each running a 
  terminal)

My personal dev desktop tends to use a full screen iTerm split 
vertically into 2 panes: an editor on the left (vim, itself split 
vertically into 2 vim windows) and a shell on the right; sometimes 
several shells (right hand pane further split horizontally).

Then, since I tend to keep per-branch checkouts around, tabs for the 
things I'm working on, each configured as above. Then I just switch tabs 
for the different areas.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread Steve Dower


Steve Dower  added the comment:

Nice catch, thanks!

Did you start the CLA process already? (I personally would exempt this PR from 
it as "not sufficiently creative", but I'm not sure I'm allowed to do that 
anymore...)

--

___
Python tracker 

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



Re: Python child process in while True loop blocks parent

2021-11-29 Thread Cameron Simpson
On 29Nov2021 21:34, Jen Kris  wrote:
>I have a C program that forks to create a child process and uses execv to call 
>a Python program.  The Python program communicates with the parent process (in 
>C) through a FIFO pipe monitored with epoll(). 
>
>The Python child process is in a while True loop, which is intended to keep it 
>running while the parent process proceeds, and perform functions for the C 
>program only at intervals when the parent sends data to the child -- similar 
>to a daemon process. 
>
>The C process writes to its end of the pipe and the child process reads it, 
>but then the child process continues to loop, thereby blocking the parent. 

It seems to me that the child Python process never writes anything back 
to the parent. If the parent is waiting for some response, of course it 
will be blocked.

Personally I wouldn't be using epoll at all. I'd just read data from pr, 
act on it, and write back to pw. That way the child blocks waiting for 
the parent istead of polling. You only want epoll if you're either 
polling something _while_ you do other work, or monitoring more than one 
thing. A plain read-from-one-pipe, work, write-back-to-the-other does 
not need it.

Cheers,
Cameron Simpson 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45675] pkgutil.get_data() doesn't add subpackages to parent packages when importing

2021-11-29 Thread Matt Wozniski


Matt Wozniski  added the comment:

I wondered if it would be backwards compatible to make `pkgutil.get_data()` 
delegate to `importlib.resources.read_binary()`. It isn't, because 
`pkgutil.get_data()` accepts a relative path for the resource, and 
`importlib.resources.read_binary()` accepts only a filename. That is, you can 
do:

pkgutil.get_data(__name__, "subdir/some_file")

but not:

importlib.resources.read_binary(__name__, "subdir/some_file")

The latter fails with:

  File "/opt/bb/lib/python3.10/importlib/_common.py", line 34, in 
normalize_path
raise ValueError(f'{path!r} must be only a file name')

--

___
Python tracker 

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



Python child process in while True loop blocks parent

2021-11-29 Thread Jen Kris via Python-list
I have a C program that forks to create a child process and uses execv to call 
a Python program.  The Python program communicates with the parent process (in 
C) through a FIFO pipe monitored with epoll().  

The Python child process is in a while True loop, which is intended to keep it 
running while the parent process proceeds, and perform functions for the C 
program only at intervals when the parent sends data to the child -- similar to 
a daemon process. 

The C process writes to its end of the pipe and the child process reads it, but 
then the child process continues to loop, thereby blocking the parent. 

This is the Python code:

#!/usr/bin/python3
import os
import select

#Open the named pipes
pr = os.open('/tmp/Pipe_01', os.O_RDWR)
pw = os.open('/tmp/Pipe_02', os.O_RDWR)

ep = select.epoll(-1)
ep.register(pr, select.EPOLLIN)

while True:

    events = ep.poll(timeout=2.5, maxevents=-1)
    #events = ep.poll(timeout=None, maxevents=-1)

    print("child is looping")

    for fileno, event in events:
    print("Python fileno")
    print(fileno)
    print("Python event")
    print(event)
    v = os.read(pr,64)
    print("Pipe value")
    print(v)

The child process correctly receives the signal from ep.poll and correctly 
reads the data in the pipe, but then it continues looping.  For example, when I 
put in a timeout:

child is looping
Python fileno
4
Python event
1
Pipe value
b'10\x00'
child is looping
child is looping

That suggests that a while True loop is not the right thing to do in this case. 
 My question is, what type of process loop is best for this situation?  The 
multiprocessing, asyncio and subprocess libraries are very extensive, and it 
would help if someone could suggest the best alternative for what I am doing 
here. 

Thanks very much for any ideas. 


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


[issue45653] Freeze the encodings module.

2021-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 02b5ac6091ada0c2df99c4e1eae37ddccbcd91f0 by Kumar Aditya in 
branch 'main':
bpo-45653: fix test_embed on windows (GH-29814)
https://github.com/python/cpython/commit/02b5ac6091ada0c2df99c4e1eae37ddccbcd91f0


--
nosy: +gvanrossum

___
Python tracker 

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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread Eric V. Smith


Change by Eric V. Smith :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-11-29 Thread Steve Dower


Steve Dower  added the comment:

It's one data point (well, statistics over 1000 points), but it looks like it's 
actually a slight improvement in performance over the previous code on Windows 
:)

before   after
min 23.103   22.154
25% 25.069   23.59925
50% 25.8125  24.2715
75% 26.65175 24.89575
max 147.567  138.997

Going to run a Linux test as well, since that was a completely different code 
path, but assuming it's not drastically different then I'll go ahead and merge.

--

___
Python tracker 

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



Re: Negative subscripts

2021-11-29 Thread Chris Angelico
On Tue, Nov 30, 2021 at 6:45 AM dn via Python-list
 wrote:
>
>
>
> On 27/11/2021 21.23, Chris Angelico wrote:
> > On Sat, Nov 27, 2021 at 7:21 PM dn via Python-list
> >  wrote:
> >> The expression list is evaluated once; it should yield an iterable
> >> object. An iterator is created for the result of the expression_list.
> >> The suite is then executed once for each item provided by the iterator,
> >> in the order returned by the iterator. Each item in turn is assigned to
> >> the target list using the standard rules for assignments (see Assignment
> >> statements), and then the suite is executed. When the items are
> >> exhausted (which is immediately when the sequence is empty or an
> >> iterator raises a StopIteration exception), the suite in the else
> >> clause, if present, is executed, and the loop terminates.
> >> »
> >> https://docs.python.org/3/reference/compound_stmts.html#the-for-statement
> >>
> >>
> >> That said, I'm wondering if all is strictly true when the
> >> expression_list is a generator, which by definition features
> >> lazy-execution rather than up-front list production. So, things may
> >> depend upon the full-nature of the application.
> >
> > Yes, it is. Evaluating a generator expression gives you a generator
> > object, which is an iterable.
>
>
> You (and the text) are correct - the expression list is "evaluated once"
> and produces a generator object. For a particular understanding of
> "evaluate".
>
> However, as described, all that has been "evaluated" is a
> generator-object. Unlike (say) a list's iterator, a generator only
> eventually produces a 'list' - and each time the generator is
> called-upon to yield the next value, that value has to be "evaluated",
> ie there's some further evaluation loop-by-loop.
>
> Further, that the values-returned can be amended during the life of the
> generator (in ways anticipated and unanticipated by coder and
> interpreter alike). Thus, it seems that the "list" doesn't actually
> exist, as in, hasn't been "evaluated" as data-values, when the loop is
> enacted.
>
> What has been 'evaluated' are the terms by which the looping will
> proceed, and terminate.
>

That's true of ALL iterators though. If you get a list iterator, and
while you're stepping through it, the underlying list changes, you'll
see those changes. Nothing gets "snapshot" unless you explicitly
request it (eg by slicing the list first).

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


[issue45917] Add math.exp2() function: 2^x

2021-11-29 Thread Tim Peters


Tim Peters  added the comment:

Bad news: on Windows, exp2(x) is way worse then pow(2, x). Here I changed the 
loop of Mark's little driver like so:

differ = really_bad = 0
worst = 0.0
for n in range(100_000):
x = random.uniform(-1000.0, 999.0) + random.random()
if exp2(x) != pow(2.0, x):
differ += 1
exp2err = exp2_error_ulps(x)
pow2err = pow2_error_ulps(x)
assert abs(pow2err) < 0.52
if abs(exp2err) >= 1.0:
if abs(exp2err) > abs(worst):
worst = exp2err
really_bad += 1
if really_bad < 25:
print(f"{x.hex():21} {x:22.17f} {exp2err:.5f}, 
{pow2err:.5f}")
print(f"{differ=:,}")
print(f"{really_bad=:,}")
print(f"worst exp2 ulp error {worst:.5f}")

Then output from one run:

0x1.0946680d45f28p+9   530.55005041041749791 -1.04399, -0.04399
0x1.de4f9662d84f8p+9   956.62177691995657369 -1.00976, -0.00976
-0x1.60f9152be0a09p+4  -22.06081120624188330 1.02472, 0.02472
-0x1.687b056d7a81ap+8 -360.48055156937482479 1.48743, 0.48743
0x1.8e97e9d405622p+9   797.18682337057930454 1.05224, 0.05224
-0x1.2d1e3a03eda7fp+9 -602.23614548782632028 -1.21876, -0.21876
0x1.3af55e79cd45dp+8   314.95847283612766887 -1.10044, -0.10044
0x1.0e7fba610cde6p+9   540.99787533882476964 -1.39782, -0.39782
0x1.9c7d0258e460dp+9   824.97663413192060489 1.19690, 0.19690
0x1.3de5064eb1598p+9   635.78925498637818237 1.75376, -0.24624
-0x1.d5189d23da3d0p+9 -938.19229553371587826 1.07734, 0.07734
0x1.967d0857aa500p+9   812.97681709114112891 1.23630, 0.23630
-0x1.30ee89e018914p+6  -76.23294782781550794 -1.10275, -0.10275
-0x1.e35eb8936dddbp+9 -966.74000780930089149 -1.02686, -0.02686
-0x1.28d40d7693088p+6  -74.20708260795993283 1.00352, 0.00352
-0x1.e965d067d1084p+7 -244.69885563303625986 1.21136, 0.21136
-0x1.b1fbeec1c1ba3p+7 -216.99205594529948371 -1.05536, -0.05536
-0x1.543d715a5824cp+9 -680.48002175620922571 1.24955, 0.24955
0x1.526829d46c034p+9   676.81377654336984051 -1.17826, -0.17826
-0x1.bdaf1d7850c74p+6 -111.42101085656196346 1.08670, 0.08670
-0x1.48218d1605dd0p+9 -656.26211810385029821 1.06103, 0.06103
-0x1.16298bcdb9103p+9 -556.32457896744051595 -1.23732, -0.23732
0x1.39ff24b1a7573p+8   313.99665365539038930 -1.20931, -0.20931
0x1.9cdf1d0101646p+8   412.87153631481157845 -1.23481, -0.23481
differ=38,452
really_bad=7,306
worst exp2 ulp error -1.91748

So they differed in more than a third of the cases; in about a fifth of the 
differing cases, the exp2 error was at least 1 ulp, and nearly 2 ulp at worst; 
while in all the differing cases the pow(2, x) error was under 0.52 ulp.

--

___
Python tracker 

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



[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread David Federman


Change by David Federman :


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

___
Python tracker 

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



Re: Negative subscripts

2021-11-29 Thread dn via Python-list


On 27/11/2021 21.23, Chris Angelico wrote:
> On Sat, Nov 27, 2021 at 7:21 PM dn via Python-list
>  wrote:
>> The expression list is evaluated once; it should yield an iterable
>> object. An iterator is created for the result of the expression_list.
>> The suite is then executed once for each item provided by the iterator,
>> in the order returned by the iterator. Each item in turn is assigned to
>> the target list using the standard rules for assignments (see Assignment
>> statements), and then the suite is executed. When the items are
>> exhausted (which is immediately when the sequence is empty or an
>> iterator raises a StopIteration exception), the suite in the else
>> clause, if present, is executed, and the loop terminates.
>> »
>> https://docs.python.org/3/reference/compound_stmts.html#the-for-statement
>>
>>
>> That said, I'm wondering if all is strictly true when the
>> expression_list is a generator, which by definition features
>> lazy-execution rather than up-front list production. So, things may
>> depend upon the full-nature of the application.
> 
> Yes, it is. Evaluating a generator expression gives you a generator
> object, which is an iterable.


You (and the text) are correct - the expression list is "evaluated once"
and produces a generator object. For a particular understanding of
"evaluate".

However, as described, all that has been "evaluated" is a
generator-object. Unlike (say) a list's iterator, a generator only
eventually produces a 'list' - and each time the generator is
called-upon to yield the next value, that value has to be "evaluated",
ie there's some further evaluation loop-by-loop.

Further, that the values-returned can be amended during the life of the
generator (in ways anticipated and unanticipated by coder and
interpreter alike). Thus, it seems that the "list" doesn't actually
exist, as in, hasn't been "evaluated" as data-values, when the loop is
enacted.

What has been 'evaluated' are the terms by which the looping will
proceed, and terminate.


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


Re: pyinstaller wrong classified as Windows virus

2021-11-29 Thread Benjamin Schollnick
>> Windows Defender has a setting to also use “Reputation Scoring”.
>> What that simply means is that WDef will report back a hash to microsoft 
>> which is then checked to see if it is known.  If it is known, then it has a 
>> reputation and based off that reputation Defender will either allow it to 
>> run or not.
>> But if there is no reputation (eg no one has ever run it), that’s 
>> suspicious.  And that’s what you are running into.
>> You can submit the EXE to the defender team, which should allow it to 
>> operate properly without any issue.
>>  - Benjamin
> 
> sure... "that's suspicious". Unless you're a developer compiling your own 
> code. In which case every fresh build will be something "unknown". You have 
> to set every setting you can find to "developer mode" to help with this kind 
> of thing, and sometimes it's still not enough.

Understandable, and Steve Gibson (GRC.com , creator of 
Spinrite) has mentioned that he has had this problem with every Beta of his 
applications.

I agree completely with you, but that’s how Microsoft has set things up.

- Benjamin


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


[issue45931] Directory.Build.props/targets leaks from folders above the repo

2021-11-29 Thread David Federman


New submission from David Federman :

When building with Visual Studio 2017+, any Directory.Build.props/targets above 
the repo in the file structure (eg. in the parent repo when the python repo is 
a submodule) will be imported automatically.

--
components: Build
messages: 407320
nosy: dfederm
priority: normal
severity: normal
status: open
title: Directory.Build.props/targets leaks from folders above the repo
type: compile error
versions: Python 3.11

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-29 Thread Mats Wichmann

On 11/29/21 12:04, Benjamin Schollnick wrote:

Windows Defender has a setting to also use “Reputation Scoring”.

What that simply means is that WDef will report back a hash to microsoft which 
is then checked to see if it is known.  If it is known, then it has a 
reputation and based off that reputation Defender will either allow it to run 
or not.

But if there is no reputation (eg no one has ever run it), that’s suspicious.  
And that’s what you are running into.

You can submit the EXE to the defender team, which should allow it to operate 
properly without any issue.

- Benjamin


sure... "that's suspicious". Unless you're a developer compiling your 
own code. In which case every fresh build will be something "unknown". 
You have to set every setting you can find to "developer mode" to help 
with this kind of thing, and sometimes it's still not enough.



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


Re: Failure to Display Top menu

2021-11-29 Thread Calvin Spealman
This mailing list does not allow attachments. If you're trying to share a
screenshot, post it to imgur or something like that and share a URL here.

On Mon, Nov 29, 2021 at 2:12 PM Peter Mwale  wrote:

> Hello Christian,
> Am referring to menu marked in picture below. It's not coming on my window.
>
>
> On Sat, Nov 27, 2021, 20:19 Christian Gollwitzer  wrote:
>
> > Am 26.11.21 um 21:38 schrieb Peter Mwale:
> > > Hello, my python 3.10 shell is not displaying the top menu. What
> should I
> > > do?
> > >
> >
> > You should explain, what you do exactly. The Python interpreter does not
> > have a menu.
> >
> > a) What platform are you on? Windows, macOS, Linux?
> >
> > b) How did ou start Python and what was the expectation?
> >
> > Christian
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> --
> https://mail.python.org/mailman/listinfo/python-list
>
>

-- 

CALVIN SPEALMAN

SENIOR QUALITY ENGINEER

calvin.speal...@redhat.com  M: +1.336.210.5107
[image: https://red.ht/sig] 
TRIED. TESTED. TRUSTED. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failure to Display Top menu

2021-11-29 Thread dn via Python-list
On 30/11/2021 07.43, Peter Mwale wrote:
> Hello Christian,
> Am referring to menu marked in picture below. It's not coming on my window.
> 
> 
> On Sat, Nov 27, 2021, 20:19 Christian Gollwitzer  wrote:
> 
>> Am 26.11.21 um 21:38 schrieb Peter Mwale:
>>> Hello, my python 3.10 shell is not displaying the top menu. What should I
>>> do?
>>>
>>
>> You should explain, what you do exactly. The Python interpreter does not
>> have a menu.
>>
>> a) What platform are you on? Windows, macOS, Linux?
>>
>> b) How did ou start Python and what was the expectation?


Sadly, this mailing list will not forward non-text attachments (for
security reasons).

Please start at https://docs.python.org/3/using/index.html with
particular attention to the chapter on MS-Windows.

This should answer your question.

If not, at least we will have some common terminology to be able to
express and solve any remaining problem...
-- 
Regards,
=dn
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue17005] Add a topological sort algorithm

2021-11-29 Thread Adrian Garcia Badaracco


Adrian Garcia Badaracco  added the comment:

As part of working on a tool that deals with dependencies, I was building my 
own topological sort. I iterated through various APIs (iterable of tasks, 
iterable of parallelizable groups of tasks, etc.) until I found the (now 
stdlib) version which ended up being exactly the API I needed to most 
efficiently execute dependencies. So, kudos on the design!

I actually ended up re-writing it in Rust, partly because I wanted a good 
project to learn Rust, partly because I wanted to be able to modify the API a 
bit. Namely:
1. I needed the ability to re-execute the same DAG multiple times without 
re-checking for cycles and re-adding all nodes (so basically copying 
`npredecessors` before executing).
2. I needed the ability to remove nodes from the graph. The real-world 
application is removing pruning subgraphs corresponding to cached dependencies. 
Again, I wanted to do this without rebuilding the entire thing (removing nodes 
can never lead to a cycle, and it is possible to keep track of new leaf nodes 
as you remove them instead of iterating over the entire graph again to find 
leaf nodes).

Here's the implementation in case anyone is interested: 
https://github.com/adriangb/graphlib2

The algorithm is the same, but I had to change the data structures somewhat to 
cope w/ Rusts' borrowing rules (namely I can't hold a mutable reference to two 
values in `node2nodeinfo` at the same time, which the current implementation 
does here 
https://github.com/python/cpython/blob/32f1491a9770b7f2989507ecf8f13ef35dd95b0b/Lib/graphlib.py#L190,
 so I split them out into two separate mappings).

--
nosy: +adriangb

___
Python tracker 

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



Re: Failure to Display Top menu

2021-11-29 Thread Peter Mwale
Hello Christian,
Am referring to menu marked in picture below. It's not coming on my window.


On Sat, Nov 27, 2021, 20:19 Christian Gollwitzer  wrote:

> Am 26.11.21 um 21:38 schrieb Peter Mwale:
> > Hello, my python 3.10 shell is not displaying the top menu. What should I
> > do?
> >
>
> You should explain, what you do exactly. The Python interpreter does not
> have a menu.
>
> a) What platform are you on? Windows, macOS, Linux?
>
> b) How did ou start Python and what was the expectation?
>
> Christian
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45917] Add math.exp2() function: 2^x

2021-11-29 Thread Mark Dickinson


Mark Dickinson  added the comment:

All done. Many thanks, Gideon!

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



Re: pyinstaller wrong classified as Windows virus

2021-11-29 Thread Benjamin Schollnick
Windows Defender has a setting to also use “Reputation Scoring”.

What that simply means is that WDef will report back a hash to microsoft which 
is then checked to see if it is known.  If it is known, then it has a 
reputation and based off that reputation Defender will either allow it to run 
or not.

But if there is no reputation (eg no one has ever run it), that’s suspicious.  
And that’s what you are running into.  

You can submit the EXE to the defender team, which should allow it to operate 
properly without any issue.

- Benjamin



> On Nov 29, 2021, at 1:57 PM, Barry  wrote:
> 
> 
> 
>> On 29 Nov 2021, at 00:03, anthony.flury via Python-list 
>>  wrote:
>> 
>> 
>> On 26/11/2021 07:13, Ulli Horlacher wrote
 But consider another possibility that your compiler software is compromised
>>> Then https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe
>>> is infected. I doubt this.
>> 
>> But you aren't using python3.10 to 'compile' the code to the executable that 
>> windows complains about: you are using pyinstaller, which if memory serves 
>> is a 3rd party application.
>> 
>> I assume that you have no problem running the script without pyinstaller ?
>> 
>> so Might pyinstaller be compromised in some way ?
> 
> Not likely.
> 
> On windows pyinstall, and other tools like it, create .exe files on windows.
> I would guess it’s that .exe that is triggering the malware detector false 
> positive.
> 
> Barry
>> 
>> 
>>> 
 Is this happening to only one set of code?
>>> This is happening SOMETIMES, not always. With the SAME source code. When I
>>> call pyinstaller often enough, then the virus scanner is quiet. In about 1
>>> of 20 compile runs.
>>> 
>>> 
>>> 
>> -- 
>> Anthony Flury
>> *Moble*: +44 07743 282707
>> *Home*: +44 (0)1206 391294
>> *email*: anthony.fl...@btinternet.com 
>> -- 
>> https://mail.python.org/mailman/listinfo/python-list
>> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


Re: pyinstaller wrong classified as Windows virus

2021-11-29 Thread Barry


> On 29 Nov 2021, at 00:03, anthony.flury via Python-list 
>  wrote:
> 
> 
> On 26/11/2021 07:13, Ulli Horlacher wrote
>>> But consider another possibility that your compiler software is compromised
>> Then https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe
>> is infected. I doubt this.
> 
> But you aren't using python3.10 to 'compile' the code to the executable that 
> windows complains about: you are using pyinstaller, which if memory serves is 
> a 3rd party application.
> 
> I assume that you have no problem running the script without pyinstaller ?
> 
> so Might pyinstaller be compromised in some way ?

Not likely.

On windows pyinstall, and other tools like it, create .exe files on windows.
I would guess it’s that .exe that is triggering the malware detector false 
positive.

Barry
> 
> 
>>   
>>> Is this happening to only one set of code?
>> This is happening SOMETIMES, not always. With the SAME source code. When I
>> call pyinstaller often enough, then the virus scanner is quiet. In about 1
>> of 20 compile runs.
>> 
>> 
>> 
> -- 
> Anthony Flury
> *Moble*: +44 07743 282707
> *Home*: +44 (0)1206 391294
> *email*: anthony.fl...@btinternet.com 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


[issue45917] Add math.exp2() function: 2^x

2021-11-29 Thread Mark Dickinson


Mark Dickinson  added the comment:


New changeset 6266e4af873a27c9d352115f2f7a1ad0885fc031 by Gideon in branch 
'main':
bpo-45917: Add math.exp2() method - return 2 raised to the power of x (GH-29829)
https://github.com/python/cpython/commit/6266e4af873a27c9d352115f2f7a1ad0885fc031


--

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Thank  you for reviewing Eric!

--

___
Python tracker 

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



[issue37699] Explicit mention of raised ValueError's after .detach() of underlying IO buffer

2021-11-29 Thread Brian Skinn


Brian Skinn  added the comment:

Indeed, I hadn't been thinking about the testing/maintenance burden to CPython 
or other implementations when I made the suggestion.

I no longer have a strong opinion about this change, so I am happy to 
reject/close.

--
resolution:  -> rejected
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, @andrei.avk!

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

___
Python tracker 

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



[issue34820] binascii.c:1578:1: error: the control flow of function ‘binascii_crc32’ does not match its profile data (counter ‘arcs’)

2021-11-29 Thread James Gerity


James Gerity  added the comment:

The Makefile issue was fixed in bpo-37725 (GitHub: 
https://github.com/python/cpython/commit/c6bbcd258302b4b9b3d4f3c39bb5f7ff0120ec67),
 but the change wasn't ported to the 3.7, 3.8 branches. Those versions are now 
security-only, so this issue can probably just be closed.

If anybody comes to this issue with the same problem, you can `make 
profile-removal` or `make clobber` to get GNU Make to clean up the PGO data, or 
you can remove the files yourself with the `find` invocation.

--
nosy: +SnoopJeDi

___
Python tracker 

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



[issue37699] Explicit mention of raised ValueError's after .detach() of underlying IO buffer

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

What is the advantage of making the doc more specific in this manner?

If we do change the doc like this, we need to add unit test ensuring that this 
is the behaviour, and we need are committing cpython (and all other python 
implementations) to behave like this in the future as well. 

I suggest this issue be rejected.

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread miss-islington


miss-islington  added the comment:


New changeset 32f1491a9770b7f2989507ecf8f13ef35dd95b0b by Miss Islington (bot) 
in branch '3.10':
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
https://github.com/python/cpython/commit/32f1491a9770b7f2989507ecf8f13ef35dd95b0b


--

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread miss-islington


miss-islington  added the comment:


New changeset 376b24e4f69cba53bae9856e9d076af47bb2b6c6 by Miss Islington (bot) 
in branch '3.9':
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
https://github.com/python/cpython/commit/376b24e4f69cba53bae9856e9d076af47bb2b6c6


--

___
Python tracker 

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



[issue23819] test_asyncio fails when run under -O

2021-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'd be happy to mentor someone who wants to tackle this.

--
keywords: +easy

___
Python tracker 

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



[issue26552] Failing ensure_future still creates a Task

2021-11-29 Thread Guido van Rossum


Change by Guido van Rossum :


--
keywords: +easy

___
Python tracker 

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



[issue45924] Incorrect traceback when future's exception is raised multiple times

2021-11-29 Thread Guido van Rossum


Guido van Rossum  added the comment:

There's a similar issue with concurrent.futures.Future, and really, anything 
that stores exceptions and later raises them can get in trouble if there's a 
way to get the exception raised multiple times. This is rarely noticed because 
usually the exception isn't raised more than once. 

We need separate bpo issues for the other cases.

The fix is easy enough (separately store a traceback and raise using 
e.with_traceback(tb)) so I'm marking this as an easy issue.

--
keywords: +easy -patch
stage: patch review -> needs patch

___
Python tracker 

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



[issue18531] Undocumented different between METH_KEYWORDS and **kws

2021-11-29 Thread Irit Katriel


Irit Katriel  added the comment:

This seems fixed in 3.11:

>>> from collections import defaultdict
>>> '{foo}{bar}'.format(**defaultdict(str))
Traceback (most recent call last):
  File "", line 1, in 
KeyError: 'foo'

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28081
pull_request: https://github.com/python/cpython/pull/29852

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread miss-islington


miss-islington  added the comment:


New changeset c1f93f0d378958dfae4f24aad0c0088e3e04e403 by andrei kulakov in 
branch 'main':
bpo-43905: Expand dataclasses.astuple() and asdict() docs (GH-26154)
https://github.com/python/cpython/commit/c1f93f0d378958dfae4f24aad0c0088e3e04e403


--
nosy: +miss-islington

___
Python tracker 

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



[issue43905] dataclasses.astuple (and .asdict) do deepcopy on all fields

2021-11-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28080
pull_request: https://github.com/python/cpython/pull/29851

___
Python tracker 

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



[issue45921] codecs module doesn't support iso-8859-6-i, iso-8859-6-e, iso-8859-8-i or iso-8859-8-i

2021-11-29 Thread Mark Sapiro


Mark Sapiro  added the comment:

The mailman-us...@python.org list received a post with the From: header 
containing a Hebrew display name RFC 2047 encoded with the iso-8859-8-i charset 
which threw a LookupError: unknown encoding: iso-8859-8-i exception in 
processing and shunted the message. The message body also had the charset 
declared as iso-8859-8-i although it contained only ascii. Unfortunately, I 
don't have the original message so I can't say what MUA created it or how 
common this usage is.

I do think that just adding these as aliases for the non-annotated encodings is 
an appropriate response.

--

___
Python tracker 

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



[issue45905] Provide a C API for introspectable frames for Cython and similar tools

2021-11-29 Thread da-woods


Change by da-woods :


--
nosy: +da-woods

___
Python tracker 

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset af39cfa6ca1e5dc4e5d28c1f09a875a14354e4ae by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-44391: Remove unused argument from a varargs call. (GH-29843) 
(GH-29849)
https://github.com/python/cpython/commit/af39cfa6ca1e5dc4e5d28c1f09a875a14354e4ae


--

___
Python tracker 

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



[issue19022] Improve handling of type.__abstractmethods__ descriptor

2021-11-29 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Interpreter Core

___
Python tracker 

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



[issue19022] Improve handling of type.__abstractmethods__ descriptor

2021-11-29 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, 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



[issue45930] Lambda function bug

2021-11-29 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 40a57532a5ad5dfd81ab6c72c5fb2e2dc4509199 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-44391: Remove unused argument from a varargs call. (GH-29843) 
(GH-29850)
https://github.com/python/cpython/commit/40a57532a5ad5dfd81ab6c72c5fb2e2dc4509199


--

___
Python tracker 

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28079
pull_request: https://github.com/python/cpython/pull/29850

___
Python tracker 

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +28078
pull_request: https://github.com/python/cpython/pull/29849

___
Python tracker 

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 4141d94fa608cdf5c8cd3e62f7ea1c27fd41eb8d by Vinay Sajip in branch 
'main':
bpo-44391: Remove unused argument from a varargs call. (GH-29843)
https://github.com/python/cpython/commit/4141d94fa608cdf5c8cd3e62f7ea1c27fd41eb8d


--

___
Python tracker 

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



[issue45928] Set up file stream for redirecting GC logs

2021-11-29 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



  1   2   >