[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-01 Thread Eryk Sun

Eryk Sun  added the comment:

> Now many people want to use Python with UTF-8 mode in PowerShell 
> in Windows Terminal. And they don't want to care about legacy 
> encoding at all.

Windows Terminal isn't relevant to the encoding issue. Applications interact 
with the console session to which they're attached, e.g. python.exe <-> 
condrv.sys <-> conhost.exe (openconsole.exe). It doesn't matter whether or not 
the console session is headless (conpty) and connected to another process via 
pipes (i.e. a console session created via CreatePseudoConsole and set for a 
child process via PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE). Some settings and 
behaviors do change in conpty mode (e.g. the session has virtual-terminal mode 
enabled by default), but the way encoding and decoding are implemented for 
ReadFile/ReadConsoleA and WriteFile/WriteConsoleA doesn't change.

There are still a lot of programs that read and write from the console as a 
regular file via ReadFile and WriteFile, so the fact that ReadFile is broken 
when the input code page is set to UTF-8 is relevant to most people. However, 
people who run `chcp 65001` in Western locales usually only care about being 
able to write non-ASCII UTF-8 via WriteFile. Reading non-ASCII UTF-8 from 
console input via ReadFile doesn't come up as a common problem, but it 
definitely is a problem. For example:

>>> s = os.read(0, 12)
Привет мир
>>> s
b'\x00\x00\x00\x00\x00\x00 \x00\x00\x00\r\n'

Thus I don't like 'solving' this mojibake issue by simply recommending that 
users set the console input codepage to UTF-8. I previously proposed two 
solutions. (1) a radical change to get full Unicode support: modify pydoc to 
temporarily change the console input codepage to UTF-8 and write the temp file 
as UTF-8. (2) a conservative change just to avoid mojibake: modify pydoc to 
query the console input codepage and write the file using that encoding, as 
always with the backslashreplace error handler.

--

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I agree that we should benchmark for what the value of "two" should be ;) . 
Maybe only match statements with >=20 consecutive simple cases end up being 
worth it. I would assume that if "case 1, case 2, ..., case 20" are all in a 
row then "case 1" wouldn't be *that* much more likely than "case 20", so a 
slowdown on case 1 wouldn't matter too much if the average gets better.

I'm under the impression that match-case statements would frequently be used 
only once per function call. If I understand your proposal, that would mean 
that calling a function with a N-case constant-pattern match would require N 
hashes and N insertions into a dict (including memory allocation), followed by 
O(1) lookup. Wouldn't that eliminate any hope of making such a function O(1)? 
Unless there's a way to cache the populated dict somewhere else?

I suggested HAMT because it's a well-tested pre-existing fast immutable mapping 
that already implements __hash__, so it would be safe to store in co_consts 
already populated. Re-implementing all of the dict logic seems like an 
unnecessary pain, which is why I was suggesting either the HAMT or a thin 
wrapper around dict, not a re-implementation of a new hash table. I was hoping 
to do the minimum amount of disruption possible to get reasonable O(1) 
performance, and then seeing where that leaves us.

--

___
Python tracker 

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



[issue44284] Python references wrong line but correct line number in traceback

2021-06-01 Thread helpimnotdrowning


New submission from helpimnotdrowning :

To reproduce (at least on Windows 10 w/ Python 3.9.4):

1) Make a python file:

while True:
print('hello')

2) Run the file via cmd
3) Edit the file (while it is still running):

while True:
print('goodbye')
print('hello')

then save it
4) ctrl+c in the cmd window to exit the script
5) The traceback will look something like this:

Traceback (most recent call last):
  File "dfb.py", line 2, in 
print('goodbye')
KeyboardInterrupt

The traceback mentions the print('goodbye') even though it wasnt in the file 
when it was run. It still calls it line 2, which is the line the print('hello') 
was before adding the print('goodbye')

--
messages: 394888
nosy: helpimnotdrowning
priority: normal
severity: normal
status: open
title: Python references wrong line but correct line number in traceback
type: behavior
versions: Python 3.9

___
Python tracker 

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



Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread boB Stepp
On Tue, Jun 1, 2021 at 12:20 PM Dennis Lee Bieber  wrote:
>
> On Tue, 1 Jun 2021 08:04:54 +1000, Cameron Simpson 
> declaimed the following:
>
> >On 30May2021 20:36, Dennis Lee Bieber  wrote:
> >>On Mon, 31 May 2021 08:07:21 +1000, Cameron Simpson 
> >>declaimed the following:
> >>>Open another terminal, note its terminal device with the "tty"
> >>>command.
> >>>Start your programme like this:
> >>>python .. 2>/dev/tty-of-the-other-termina
> >>>
> >>  The OP specified Win10, so the above is dead from the start.
> >
> >Good point; I wasn't aware that curses worked in Windows.
>
> https://docs.python.org/3/howto/curses.html
> "The Windows version of Python doesn’t include the curses module. A ported
> version called UniCurses is available."
>
> Appears the easiest is to PIP "windows-curses" then track down
> piecemeal installs (it is unclear if UniCurses includes PDCurses, or needs
> that as a separate install).

windows-curses 2.2.0 has been working well for me so far on Win10:
https://pypi.org/project/windows-curses/

"Adds support for the standard Python curses module on Windows. Based
on these wheels. Uses the PDCurses curses implementation."

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


[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Brandt Bucher

Brandt Bucher  added the comment:

Hm. I’m not sure if the HAMT makes much sense. We don’t really care about 
efficient mutation or copies... constant-time lookups seem to be overwhelmingly 
the most valuable factor here.

I personally think that creating some sort of hashable dict and teaching 
marshal how to serialize/deserialize it could be a promising path forward. I 
imagine its actual design could mirror dict (sort of like set/frozenset).

That might be a rather drastic step though. Perhaps it’s better to first prove 
that building a mapping at runtime is too slow.

--

___
Python tracker 

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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I think the old wording was better.  Code can explicitly raise an exception, 
but other exceptions just occur when calling builtin functions or with a 
keyboard interrupt.

--
nosy: +eric.smith, rhettinger

___
Python tracker 

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



[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2021-06-01 Thread Pooja Warhekar


Pooja Warhekar  added the comment:

I tried following things.
1. Clearing registry.
2. Web installation
3. Installation in E drive.
However problem remains same. Please find the attached log files.
Also I couldn't install Microsoft Visual C++ 2015 Redistributable. Could this 
cause any problem?

--
Added file: https://bugs.python.org/file50080/Installation log _02062021.zip

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

At first I thought of matches with only the int/str/None cases and then I saw 
the easy generalization, but yeah, each contiguous block seems better.

One solution to the code hashability/lookup speed apparent dilemma: writing the 
equivalent of this in C:

class HashableDict(dict):
def __new__(cls, pairs):
return dict.__new__(cls, pairs)
def __eq__(self, other):
return tuple(self.mapping.items()) == tuple(other.sequence.items())
def __hash__(self):
return CONSTANT ^ hash(tuple(self.items()))
def __getnewargs__(self):
return tuple(self.items())

# forbid all mutating methods
__setitem__ = __delitem__ = update = __ior__ = None # etc.

(Or maybe using composition rather than inheritence)

Maybe using the HAMT in /Python/hamt.c would suffice instead.

--

___
Python tracker 

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



Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Jach Feng
pjfa...@earthlink.net 在 2021年5月31日 星期一上午1:42:43 [UTC+8] 的信中寫道:
> I tried winpdb-reborn some time last year on my Win10 system (python 3.8.3 
> at that time), but could not figure out how to use it to debug a python 
> script that uses the curses module. 
> 
> Does anyone here know if winpdb-reborn or any other debugger can support 
> 2-window debugging for a python script that uses the curses module? It 
> seems to me that a 2-window debugging session is necessary for a python 
> script that uses the curses module because using curses takes over the 
> screen from which the script is started, so debugging output and script 
> output need to be in separate windows. 
> 
> I've been forced to use a logger to trace critical values and program flow 
> for errors in such a script. It works, but it is annoyingly slow to debug 
> that way. 
> 
> TIA for any advice or RTFM you can provide. 
> 
> Peter 
> --
I have no problem on using rpdb2 to debug a script which is based on curses.

My environment are:
Windows Vista, Python 3.4.4, rpdb2 of winpdb-1.4.8, 
curses-2.2-cp34-cp34m-win32.whl, snake.py

Everything are old, but it works:-)

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


Re: Definition of "property"

2021-06-01 Thread Greg Ewing

On 1/06/21 7:01 am, Alan Gauld wrote:

That was the point, the OP said it was a book about OOP.
Not a book about "OOP in Python".


In that case it would be best to avoid the word, or give
a definition of the way he's using it, making it clear
that it's not a universal definition. Python's definition
is somewhat unusual, and so would not be appropriate.

--
Greg

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


[issue43654] IDLE: Fix tab completion after settings and some keys

2021-06-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Currently, the keys that define certain pseudoevents and invoke the associated 
event handlers are fixed: tab, '.', and within strings, '/' and '\' for 
completions, '(' and ')' for calltip open and close, and ')', ']', and '}' for 
opener matching.  Note that quote matching is indicated by coloring completed 
strings.

PR-26421 proposes to augment this list with tab for smart indent, backspace for 
smart backspace, and newline for completing a line and maybe smart indenting. 
In other words, remove the following 3 lines

  '<>': [''],
  '<>': ['', ''],
  '<>': [''],

from config-keys.def and the Settings Keys tab and add them as fixed binding to 
EditorWindow.__init__ just above the existing fixed pseudoevent -- keys 
bindings.

Only fixing smart-indent and tab (or unfixing name-completion and tab) is 
needed to keep name completion working after re-doing setting.  So why all 
three?  1. These three pairs go together; I don't see anything else that should 
be fixed.  2. By the standard used to fix some pairs already, these three 
should be also.  I think it an accident of IDLE's history that they aren't*.  
3. It might be that changing either of the other two binding could disable 
something, or might in the future.  In other words, I consider having this 
bindings be mutable to be a bit buggy, with this issue being evidence.

* Multiple coders, coding convenience, shift of focus from 'consenting adults 
to 'beginners'?

The unknown is whether anyone has changed these pseudoevent bindings and if so, 
how much do we care?  

Guido, do you have any comment on this proposal from a change policy 
perspective?

--
nosy: +gvanrossum
title: IDLE: Applying settings disables tab completion -> IDLE: Fix tab 
completion after settings and some keys

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Brandt Bucher


Brandt Bucher  added the comment:

Seems like a good idea as long as we're careful about the implementation. I've 
just jotted down a few notes here:

- We should probably break the table upon encountering a guard.

- We probably can't get away with storing a dictionary in the code object's 
constants, since the entire code object needs to be hashable. We could store a 
tuple of key-value pairs and either (a) build the dictionary each time we enter 
the block, or (b) stash it somewhere. If we stash it:
  - Should we defer building it until the first time we hit the block, or 
earlier than that?
  - Where would we stash it?

- We should probably have some heuristic perhaps more restrictive than "two or 
more of the following in a row". I'm not entirely sure that loading/building a 
dictionary, hashing an integer/string/None, looking it up in a dictionary, and 
then either (a) recovering from the error, or (b) converting the Python integer 
value into a C long and jumping on it is faster than the current implementation 
for the first two cases. I know it's really fast, but I'm not *sure* it will be 
an obvious win yet. Ideally, the best-case scenario (match on first case) would 
be just as fast as it is currently. I'm probably willing to speed up the 
average case at the expense of the best case, though.

- I'm not sure we need to limit this to leading cases. What's stopping us from 
having one of these jump tables in the middle of a match block (or even having 
more than one scattered throughout)? Unless I'm missing something, this should 
work anytime we observe contiguous "simple" cases.

--

___
Python tracker 

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



[issue43882] [security] urllib.parse should sanitize urls containing ASCII newline and tabs.

2021-06-01 Thread Gregory P. Smith


Change by Gregory P. Smith :


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

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

In difflib, there's an example where it would be easy to run performance tests.

match tag:
case 'replace':
g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
case 'delete':
g = self._dump('-', a, alo, ahi)
case 'insert':
g = self._dump('+', b, blo, bhi)
case 'equal':
g = self._dump(' ', a, alo, ahi)
case _:
raise ValueError('unknown tag %r' % (tag,))

--

___
Python tracker 

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



[issue44281] Links on top of collections doc not in the order of sections

2021-06-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

ISTM that the table order doesn't need to match because the links take you 
directly to the section of interest.  They make it so that you don't need to 
know the order of sections below.  Currently, they have a "logical" grouping 
with the two sequence-like objects side-by-side, the four dict or dict-like 
subclasses side-by-side, and the other "User" classes side-by-side.

The order of the sections below is in alpha order (with the minor exception of 
deque and defaultdict being swapped).  This is also reasonable because a person 
would likely be scanning the Table of Contents looking for the class or 
function by its name.

This is really no different than a lending library having a title catalog and a 
subject catalog with the same information arranged in two different ways.  Both 
ways have value.

Thank you for the suggestion, but the existing ordering was intentional and is 
useful.  Possibly, we could swap the *deque* and *defaultdict* sections, but 
the benefit is very minor and likely isn't worth the churn.

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

___
Python tracker 

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



[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

If the json.encoder code does get updated, it doesn't need two levels of 
matching.  It can be flattened by eliminating the *chunks* variable.

match value:
case str():
yield _encoder(value)
case None:
yield 'null'
case True:
yield 'true'
case False:
yield 'false'
case int():
yield _intstr(value)
case float():
yield _floatstr(value)
case list() | tuple():
yield from _iterencode_list(value, _current_indent_level)
case dict():
yield from _iterencode_dict(value, _current_indent_level)
case _:
yield from _iterencode(value, _current_indent_level)

--
nosy: +rhettinger

___
Python tracker 

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



[issue44281] Links on top of collections doc not in the order of sections

2021-06-01 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger
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



[issue44281] Links on top of collections doc not in the order of sections

2021-06-01 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
priority: normal -> low

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Big +1 from me.  This would make use of match-case more compelling.

--
nosy: +rhettinger

___
Python tracker 

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



Re: Neither pdb or print() displays the bug

2021-06-01 Thread Alan Gauld via Python-list
On 01/06/2021 21:18, Rich Shepard wrote:
> On Sun, 30 May 2021, Cameron Simpson wrote:
> 
>> I've only just started with pdb. As of Python 3.7 there's a builtin
>> function named breakpoint() which drops you into the debugger.


> I'm stuck with neither approach (pdb, print()) working. 


> The activitytypes.py module:
> 

> class ATMainWindow(qtw.QMainWindow):
> 
>  def __init__(self):
>  super().__init__()
> 
>  # Model/View here.
>  self.model = qts.QSqlTableModel(db=db) # for single table
>  self.model.setTable('activitytypes')
>  self.model.select()
> 
>  self.table = qtw.QTableView()
>  self.table.setModel(self.model)
> 
>  self.setFixedSize(qtc.QSize(800, 600))

Assuming this is the line you want to examine set a beakpoint just above
it using the function that Cameron mentioned

(Or just set a breakpoint on the init() from pdb...

Trying to use step/next to debug an event driven application
is next to impossible. set breakpoints on the methods that
get triggered by events then generate the event to reach
the breakpoint.

Or, as in this case, on the init if you want to examine
objects as they are created.

As a general rule if you have to hit next/step more
than half a dozen times in a row you are probably making
extra work for yourself!


>> $/development/business_tracker/activitytypes.py(29)()
> -> window = ATMainWindow()
> (Pdb) n
> False
>> $/development/business_tracker/activitytypes.py(30)()
> -> window.show()
> (Pdb) n
>> $/development/business_tracker/activitytypes.py(32)()
> -> app.exec_()
> (Pdb) n
> n
>> $/development/business_tracker/activitytypes.py(32)()->None
> -> app.exec_()
> (Pdb) n

I'm not sure why you got that twice.
I'd expect you to only see it once.

> 
> and there it sits. No (Pdb) prompt, nothing. And no printed statements.

It's waiting while the app runs and for you to terminate it.

> I'd appreciate recommendations on the process to find where the bug lives
> since I can't seem to find it with print() or line-by-line in pdb.

Use breakpoints, don't try to step through the code from the
beginning - there lies madness!

And for event handlers that get called a lot use conditional
breakpoints so that you only stop when you want to.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Cameron Simpson
On 01Jun2021 19:48, Alan Gauld  wrote:
>On 31/05/2021 16:16, Grant Edwards wrote:
>> On 2021-05-30, Alan Gauld via Python-list  wrote:
>>> You are not alone. debugging curses is one of the biggest obstacles 
>>> to
>>> its use.
>>
>> Can't you just run the debugger in a different window and attach to
>> the process you want to debug? That's how one uses a debugger with
>> curses apps written in C/C++.
>
>That's how we did it when I used curses on VMS/Unix using C.

That's ok for C-level things - they're close to the metal. But this is 
Python, so such tools may well be poorly adapted.

>But I confess I didn't think you could attach any python
>debugger to another python session?

Dennis Lee Bieber wrote earlier in this thread:

 From http://heather.cs.ucdavis.edu/~matloff/winpdb.html
 """
 About Winpdb and RPDB2:

 The Winpdb package, by Nir Aides, is an excellent Python debugger. It 
is
 especially nice because it can handle the debugging of threads- and
 curses-based code. It is a remote debugger, meaning that it connects
 through the network to a remote site (which can be the same machine at
 which it is invoked, which is typical).

 RPDB2 is text-based, while Winpdb is a GUI front end to RPDB2.
 """

So it sounds like someone's done the hard work here. I can imagine it 
embeds a Python proxy in the app which can be remote controlled from the 
debugger client, but I'm just guessing wildly.

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


Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard

On Tue, 1 Jun 2021, Dennis Lee Bieber wrote:


I suspect you really should be stepping INTO the calls, not just
invoking the functions completely and going to the next LOCAL statement.



$ /development/business_tracker/activitytypes.py(1)()

-> import sys
(Pdb) s

$ /development/business_tracker/activitytypes.py(2)()

-> import logging
(Pdb) s
--Call--

(978)_find_and_load()

(Pdb) s

Now I'll go learn what this means.

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


[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-01 Thread Inada Naoki


Inada Naoki  added the comment:

>> PS > $OutputEncoding =  [System.Text.Encoding]::GetEncoding("UTF-8")

> FYI, $OutputEncoding in PowerShell has nothing to do with the python.exe and 
> more.com processes, nor the console session to which they're attached.

>> PS > [System.Console]::OutputEncoding = $OutputEncoding

> The console output code page is irrelevant since more.com writes 
> wide-character text via WriteConsoleW() and decodes the file using the 
> console input code page, GetConsoleCP(). The console output codepage from 
> GetConsoleOutputCP() isn't used for anything here.

Yes, both are unrelated to this specific issue. But both are highly recommended 
for using Python with UTF-8 mode.

Now many people want to use Python with UTF-8 mode in PowerShell in Windows 
Terminal. And they don't want to care about legacy encoding at all.

--

___
Python tracker 

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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


Change by Irit Katriel :


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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 9a688624973a2b753b84f892b65268543c7ff67d by Irit Katriel in 
branch '3.9':
[3.9] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) 
(GH-26481)
https://github.com/python/cpython/commit/9a688624973a2b753b84f892b65268543c7ff67d


--

___
Python tracker 

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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 6563ea5c60be2e4896df52eff777aa93743f1551 by Irit Katriel in 
branch '3.10':
[3.10] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) 
(GH-26480)
https://github.com/python/cpython/commit/6563ea5c60be2e4896df52eff777aa93743f1551


--

___
Python tracker 

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



[issue44283] Add jump table for certain safe match-case statements

2021-06-01 Thread Dennis Sweeney


New submission from Dennis Sweeney :

Anecdotally, a few people I've talked to have expected that match-case 
statements would improve performance in the same way that switch-cases 
sometimes do in C-like languages. While this is impossible in general without 
changing semantics (since, for example, __eq__ can have side effects), it would 
be nice if a jump table was implemented in certain safe cases.

My idea was to implement this whenever the list of cases begins with 2 or more 
of the following in a row:

(1) ints
(2) strings
(3) None
(4) OR (`|`) patterns of any of the above
(5?) potentially later add support for tuples

Example:

match x:
case 10: # safe
print("A")
case 20: # safe
print("B")
case 30 | 31:# safe
print("C")
case 40: # safe
print("D")
case MyClass(10, 20): # unsafe
print("E")
case []:  # unsafe
print("F")
case whatever:# unsafe
print("G")


This would compile to something like

LOAD_FAST (x)
LOAD_CONST 16({10: 16, 20: 38, 30: 80, 31: 80, 40: 102})
ATTEMPT_SAFE_MATCH 110

... all the rest of the code is the same ...

Where the new opcode would be would be something like

case TARGET(ATTEMPT_SAFE_MATCH): {
PyObject *jump_dict = POP();
PyObject *x = TOP();

if (PyLong_CheckExact(x) ||
PyUnicode_CheckExact(x) ||
Py_Is(x, Py_None))
{
PyObject *boxed = PyDict_GetItemWithError(jump_dict, x);
Py_DECREF(jump_dict);
if (res == NULL) {
if (PyErr_Occurred()) {
goto error;
}
else {
JUMPBY(oparg);
}
}
assert(PyLong_CheckExact(boxed));
int target = (int)PyLong_AsLong(boxed);
JUMPBY(target);
}
else {
// fall back to general matching code
Py_DECREF(jump_dict);
DISPATCH();
}
}

I can work on an implementation in the next couple of weeks.

--
components: Interpreter Core
messages: 394874
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Add jump table for certain safe match-case statements
type: performance
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



[issue44263] Better explain the GC contract for PyType_FromSpecWithBases

2021-06-01 Thread STINNER Victor


STINNER Victor  added the comment:

I made sure that it's no longer possible to create a type with 
Py_TPFLAGS_HAVE_GC flag set but with no traverse function (tp_traverse=NULL). I 
close again the issue.

--
components: +C API, Interpreter Core
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +25078
pull_request: https://github.com/python/cpython/pull/26481

___
Python tracker 

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



[issue44263] Better explain the GC contract for PyType_FromSpecWithBases

2021-06-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ee7637596d8de25f54261bbeabc602d31e74f482 by Victor Stinner in 
branch 'main':
bpo-44263: Py_TPFLAGS_HAVE_GC requires tp_traverse (GH-26463)
https://github.com/python/cpython/commit/ee7637596d8de25f54261bbeabc602d31e74f482


--

___
Python tracker 

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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +25077
pull_request: https://github.com/python/cpython/pull/26480

___
Python tracker 

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



Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard

On Tue, 1 Jun 2021, Ethan Furman wrote:


Well, you only had two logging statements in that code -- logging is like
print: if you want to see it, you have to call it:


Ethan,

Got it, thanks.

I believe my problem is with the datasource module. I'm focused on making it
work (using logging to confirm that it is doing so). Will report results
when they're available.

Regards,

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


Re: Neither pdb or print() displays the bug

2021-06-01 Thread Ethan Furman

On 6/1/21 1:42 PM, Rich Shepard wrote:

> When I run it this is the output:
> $ python activitytypes.py 2021-06-01 13:39:10,219 -DEBUG - Start of Program
> 2021-06-01 13:39:15,229 -DEBUG - End of Program

Well, you only had two logging statements in that code -- logging is like 
print: if you want to see it, you have to call it:

logging.info('start of xx procedure')
logging.info('spam = %s', spam) # note the comma and not actual 
%-interpolation

> Obviously I have much to learn about using python's logging capabilities.
> I'll keep looking.

I'm certainly not an expert, but this is how I do it:

from logging import INFO, getLogger, Formatter, handlers

logger = getLogger()
logger.setLevel(INFO)
_handler = handlers.TimedRotatingFileHandler(
virtualenv / 'var/log/openerp/continuous_sync_records.log',
when='midnight',
backupCount=30,
)
_formatter = Formatter('%(asctime)s %(funcName)-25s %(message)s')
_handler.setFormatter(_formatter)
logger.addHandler(_handler)
del _handler, _formatter

and then in my code:

logger.info('failure converting %r to %r', target_bmp_file, target_png_file)

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


Async requests library with NTLM auth support?

2021-06-01 Thread Albert-Jan Roskam
   Hi,
   I need to make thousands of requests that require ntlm authentication so I
   was hoping to do them asynchronously. With synchronous requests I use
   requests/requests_ntlm. Asyncio and httpx [1] look promising but don't
   seem to support ntlm. Any tips?
   Cheers!
   Albert-Jan
   [1] https://www.python-httpx.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard

On Tue, 1 Jun 2021, Ethan Furman wrote:


Sounds like a console issue. Try using `logging` with a file... you could
even use `print` with a file if you wanted to.


Ethan,

Not before using logging I found a reference/example page

and modified the module to this:

# activitytypes.py
import sys
import logging

from PyQt5 import QtWidgets as qtw
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
from PyQt5 import QtSql as qts

from datasource import db

logging.basicConfig(level=logging.DEBUG, format='%(asctime)s -%(levelname)s - 
%(message)s')
logging.debug("Start of Program")

class ATMainWindow(qtw.QMainWindow):

def __init__(self):
super().__init__()

# Model/View here.
self.model = qts.QSqlTableModel(db=db) # for single table
self.model.setTable('activitytypes')
self.model.select()

self.table = qtw.QTableView()
self.table.setModel(self.model)

self.setMinimumSize(qtc.QSize(800, 600))
self.setCentralWidget(self.table)


if __name__ == '__main__':
app = qtw.QApplication(sys.argv)
window = ATMainWindow()
window.show()
#sys.exit(app.exec())
app.exec_()

logging.debug("End of Program")

When I run it this is the output:
$ python activitytypes.py 
2021-06-01 13:39:10,219 -DEBUG - Start of Program

2021-06-01 13:39:15,229 -DEBUG - End of Program

Obviously I have much to learn about using python's logging capabilities.
I'll keep looking.

Thanks,

Rich




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


[issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures

2021-06-01 Thread Terry J. Reedy


New submission from Terry J. Reedy :

idlelib.idle_test.test_colordelagator.ColorDelegatorTest.test_incremental_editing
 has failed on at least on the following machines.  

Pip32  CI Pipelines Win32
Gen3x  https://buildbot.python.org/all/#/builders/464  x86 Gentoo Installed 
with X 3.x
GenPR  https://buildbot.python.org/all/#/builders/465  x86 Gentoo Installed 
with X PR

Failures seen.  Since tests are sequential without subtesting, failure means 
successors are not tested.

line  keyword start   wantgot  
569   ('BUILTIN', '1.0'), ('1.0', '1.3')  ()  Gen3x, x3; GenPR
573   ('BUILTIN', '1.0'), ('1.0', '1.3')  ()  Gen3x, x5
586   ('BUILTIN', '1.0'), ('1.0', '1.3')  ()  GenPR
597   ('KEYWORD', '1.0'), ()  ('1.0', '1.1')  Pip32, x2

As far as I can tell, looking at Windows buildbots, the 1 failure on Win32 has 
not been repeated.  If there have been any on CI machines, I have not been 
informed.

A few years ago, I believe Gentoo was the only *nix buildbot running tkinter 
and IDLE tests. It has a problem with a builtin at the beginning of the line 
about 10-20% of test runs.  This are the majority of its failures in the last 
week.  Perhaps there is a timing issue we can fix.

--
assignee: terry.reedy
components: IDLE, Tests
messages: 394870
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: ColorDelegatorTest test_incremental_editing failures
type: behavior
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: Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard

On Tue, 1 Jun 2021, Rich Shepard wrote:


The QSize() statement is never reached.


Correction: the window is 800 x 600, but it's still empty.

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


[issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures

2021-06-01 Thread Tal Einat


Change by Tal Einat :


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

___
Python tracker 

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



[issue44282] IDLE: ColorDelegatorTest test_incremental_editing failures

2021-06-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Followup to PR-26404, which added the tests.

--

___
Python tracker 

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



[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-01 Thread Jesse Silverman


Jesse Silverman  added the comment:

"more.com" uses the console input codepage to decode the file, so a workaround 
is to run `chcp.com 65001` and run Python in UTF-8 mode, e.g. `py -X utf8=1`. 
Since reading non-ASCII UTF-8 is broken, you'll have to switch back to the old 
input codepage if you need to enter non-ASCII characters in an app that reads 
from the console via ReadFile or ReadConsoleA.

Confirmed that this workaround done in Windows Terminal causes all mojibake to 
immediately evaporate, leaving me with the most readable and enjoyable 
more/console experience I have ever had since first hitting a spacebar on 
MS-DOS.
(Windows Terminal and the open-sourcing of the CONSOLE code is in a three-way 
tie with open-sourcing of .Net Core and the C++ STL for changing how I feel 
about Windows.  I keep finding new reasons to love it, except for reading 
non-ASCII UTF-8 being broken which I just learned about today.)

--

___
Python tracker 

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



Pandsa to Excel conversion issue

2021-06-01 Thread EK Esawi via Python-list
Hi All--


I am using Pandas to read an excel file which is very "dirty" and needs 
cleaning. I read the file via pandas and did not setup dtypes or converters 
hoping i can do so later.. When i run my code, most columns did come out as 
strings but i cannot convert them to float or integer using astype or pandas.to 
numeric method. Every time i tried, i get the same error listed below



Here is my code

import pandas as pd
import numpy as np

MyFile='C:/Users/Temp.xlsx'
df=pd.read_excel(io=MyFile, nrows=100)


The error message i get when i tried to convert a string like '22.3' via astype 
or pd.to_numeric is below


Unable to parse string "22." at position 0


Thanks in advance


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


Re: Definition of "property"

2021-06-01 Thread Alan Gauld via Python-list
On 31/05/2021 15:59, Dennis Lee Bieber wrote:
> On Sun, 30 May 2021 21:20:24 +0100, Alan Gauld via Python-list
>  declaimed the following:
> 
>> On 30/05/2021 17:57, Irv Kalb wrote:
>>> I am doing some writing (for an upcoming book on OOP), and I'm a little 
>>> stuck.  
>>
>> Oh dear, that's one of myt hot buttons I'm afraid!
>> I hope it really is about OOP and not about classes. Classes
>> are such a minor part of OOP that it is depressing how many

>   To me, OOP tends to be language specific... 

OOP is supposed to be a programming paradigm in the same way that
Functional or Logic programming are paradigms. Its all about
how you organise your code. It should be based on message
passing between autonomous agents(objects). Classes etc are
language constructs aimed at making OOP easier, but they
are not OOP. It's very easy to build a class/object based
program that is not in any way OOP (in fact I'd go as far
as to say the majority of such programs today come into
that category). It's also possible (but difficult!)
to build an OOP program without classes.

Incidentally, I'm not arguing that classes should not be used
in imperative programming, they can be very powerful there
too. Just that using classes is not necessarily OOP.

> Finding books on OOAD -- which should be language agnostic -- is 
> more difficult, and tend to turn into books about how to use 
> UML rather than how to analyze/design using OO.

That's a fairly modern phenomenon. Most of the early books about
OOAD were language agnostic - even when they used a language for
demonstration purposes.

Books like Grady Booch's classic OOAD, or Peter Coad's series
with Ed Yourdon. The so-called method wars. They all had their own
methodology, but mostly that was just diagrammatic variances. The
underlying techniques and resultant structures were the same.
(And hence the move to UML, which is just a notation - an
extremely useful one, although often abused through over
zealous application.)

Even Rumbaugh's OMT book was meant to be general OOD, although
IMHO it was the least OO of all of them being heavily based
on data modelling.

Sadly, there are very few books today that even attempt to
describe the difference between OOP and the more common
procedural programming paradigm. Discussions of OOP have
degenerated into discussions about OOPL features rather than
how to build worlds of objects passing messages to each other.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: Python app setup

2021-06-01 Thread Terry Reedy

On 5/31/2021 2:20 PM, Murali Pa wrote:

Hi,
I've installed latest version of Python 3.9.5 and downloaded for Windows.
Once I click on the Python app, I'm getting command screen
You are getting the Python interactive interpreter.  This is different 
from the system command line console/terminal in which you enter system 
commands.



and not sure on  the next action.


Enter a Python statement.  See the Python tutorial which explains.


could you please help me to fix this issue.


If you wish to run a python program in a file, you have to enter a 
command line in the system terminal, click on the file, or load the file 
in an IDE such as IDLE and run it from there.  See the chapter of the 
doc Using Python for your system.



Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64
bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>


Enter the first line of a statement, or if using IDLE, a complete statement.


Disclaimer: The information in this email is the property of IBM and may
be IBM Confidential and privileged. It is intended solely for the
addressee. Access to this email by anyone else is unauthorized. If you are
not the intended recipient, any disclosure, copying, distribution or any
action taken in reliance on it is prohibited. If you receive this message
in error please notify the sender immediately and delete all copies of
this message.


When one sends a message to a mailing list or newsgroup, this is 
complete nonsense.  The 'addressee' is anyone and everyone in the world. 
 Try to avoid it if you can.



--
Terry Jan Reedy

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


Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Alan Gauld via Python-list
On 31/05/2021 16:16, Grant Edwards wrote:
> On 2021-05-30, Alan Gauld via Python-list  wrote:

>> You are not alone. debugging curses is one of the biggest obstacles to
>> its use.
> 
> Can't you just run the debugger in a different window and attach to
> the process you want to debug? That's how one uses a debugger with
> curses apps written in C/C++. 

That's how we did it when I used curses on VMS/Unix using C.

But I confess I didn't think you could attach any python
debugger to another python session?

> Or I add debugging printf calls which
> write to stderr and redirect stderr to a file.

I do use logging sometimes but its not as immediate
as seeing the messages in the application as you run it.

>> My approach is to define a status line at the bottom of my program and
>> write print statements into that window. Something like:
> 
> Why not just use the standard python logging facility and log to a
> file or another terminal window?

I find the immediacy of an in-window message much easier. Its like using
print() statements in a regular CLI application. Its there in front of
you, no other terminals to look at.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: Neither pdb or print() displays the bug

2021-06-01 Thread Ethan Furman

On 6/1/21 1:18 PM, Rich Shepard wrote:

> I'd appreciate recommendations on the process to find where the bug lives
> since I can't seem to find it with print() or line-by-line in pdb.

Sounds like a console issue.  Try using `logging` with a file... you could even 
use `print` with a file if you wanted to.

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


Re: python 3.9.5

2021-06-01 Thread Dan Stromberg
On Tue, Jun 1, 2021 at 10:12 AM Dennis Lee Bieber 
wrote:

> On Mon, 31 May 2021 02:15:28 -0500, said ganoune 
> declaimed the following:
>
>  is this the third one in the last week...
>
> Does the Python FAQ address contemporary FAQ's?

It seems like https://docs.python.org/3/faq/windows.html would be the place.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44238] Unable to install Python 3.9.5 - Windows Server

2021-06-01 Thread Steve Dower


Steve Dower  added the comment:

Unfortunately, I've got no idea whether it's failing to uninstall the MSI or if 
it's specific to removing the PATH environment variable. If you've still got 
the rest (no more than 2-3 I'd expect) of the uninstall log files in your 
%TEMP% directory that may show something.

Have you successfully installed/uninstalled other versions of Python before on 
this machine/OS?

--

___
Python tracker 

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



Neither pdb or print() displays the bug

2021-06-01 Thread Rich Shepard

On Sun, 30 May 2021, Cameron Simpson wrote:


I've only just started with pdb. As of Python 3.7 there's a builtin
function named breakpoint() which drops you into the debugger. I've never
been a big debugger person, historicly using print() and equivalent.
However, this makes it very easy to insert this call into a piece of code
instead of having to invoke one's programme in a special way.


I'm stuck with neither approach (pdb, print()) working. I moved the database
code to a separate module, datasource.py, and when I run the
activitytypes.py module (using pdb and having entered print() statements at
various places in both the datasource and activities modules all I get is a
small, empty window with the window title. The QSize() statement is never
reached.

The activitytypes.py module:

import sys
from PyQt5 import QtWidgets as qtw
from PyQt5 import QtGui as qtg
from PyQt5 import QtCore as qtc
from PyQt5 import QtSql as qts

from datasource import db

class ATMainWindow(qtw.QMainWindow):

def __init__(self):
super().__init__()

# Model/View here.
self.model = qts.QSqlTableModel(db=db) # for single table
self.model.setTable('activitytypes')
self.model.select()

self.table = qtw.QTableView()
self.table.setModel(self.model)

self.setFixedSize(qtc.QSize(800, 600))
self.setCentralWidget(self.table)


if __name__ == '__main__':
app = qtw.QApplication(sys.argv)
window = ATMainWindow()
window.show()
#sys.exit(app.exec())
app.exec_()

Running the module in pdb and using 'next' to step through it produces this
result:


$/development/business_tracker/activitytypes.py(29)()

-> window = ATMainWindow()
(Pdb) n
False

$/development/business_tracker/activitytypes.py(30)()

-> window.show()
(Pdb) n

$/development/business_tracker/activitytypes.py(32)()

-> app.exec_()
(Pdb) n
n

$/development/business_tracker/activitytypes.py(32)()->None

-> app.exec_()
(Pdb) n

and there it sits. No (Pdb) prompt, nothing. And no printed statements.

I'd appreciate recommendations on the process to find where the bug lives
since I can't seem to find it with print() or line-by-line in pdb.

TIA,

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


[issue44281] Links on top of collections doc not in the order of sections

2021-06-01 Thread Andrei Kulakov


New submission from Andrei Kulakov :

https://docs.python.org/3.11/library/collections.html

Links are not in the same order as the sections below. It creates some 
dissonance for the reader to first read the section names above and then 
continue reading expecting them to be in the same order through the page.

Seems like would be an easy fix to reorder them.

--
assignee: docs@python
components: Documentation
messages: 394867
nosy: andrei.avk, docs@python
priority: normal
severity: normal
status: open
title: Links on top of collections doc not in the order of sections
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 87272b70f157af76cb14ff90d73dfc5d9bfb945a by MapleCCC in branch 
'main':
bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428)
https://github.com/python/cpython/commit/87272b70f157af76cb14ff90d73dfc5d9bfb945a


--

___
Python tracker 

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



[issue44280] unittest filters out too many assertion stack frames from context/cause chains

2021-06-01 Thread Peter Hawkins


Change by Peter Hawkins :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



Re: Python app setup

2021-06-01 Thread Dan Stromberg
What you've got there is a REPL, or Read-Evaluate-Print-Loop. It's good for
quick little exploratory tests.

For actually writing code, most people would prefer to use PyCharm or
VSCode or IDLE. You may find that IDLE has come with your CPython install.
Personally, I prefer vim+syntastic+jedi, but I realize that's not
everyone's cup of meat.

If you have an application you want to install that is built on Python,
rather than write your own code, there will probably be a pip command you
can run, or a setup.py to use. If this is the case, let us know.

HTH.

On Tue, Jun 1, 2021 at 10:23 AM Murali Pa  wrote:

>Hi,
>I've installed latest version of Python 3.9.5 and downloaded for
> Windows.
>Once I click on the Python app, I'm getting command screen and not sure
> on
>the next action. could you please help me to fix this issue.
>Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64
>bit (AMD64)] on win32
>Type "help", "copyright", "credits" or "license" for more information.
>>>>
>Thanks,
>Murali PA
>
>
>Disclaimer: The information in this email is the property of IBM and may
>be IBM Confidential and privileged. It is intended solely for the
>addressee. Access to this email by anyone else is unauthorized. If you
> are
>not the intended recipient, any disclosure, copying, distribution or any
>action taken in reliance on it is prohibited. If you receive this
> message
>in error please notify the sender immediately and delete all copies of
>this message.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44280] unittest filters out too many assertion stack frames from context/cause chains

2021-06-01 Thread Peter Hawkins


New submission from Peter Hawkins :

Example repro:
```
import unittest


def d():
  assert 2 == 3

def c():
  d()

def b():
  c()

def a():
  try:
b()
  except Exception as e:
assert 1 == 2


class MyTest(unittest.TestCase):

  def testException(self):
a()


if __name__ == '__main__':
  unittest.main()
```

Example output from Python 3.9.0:
```
$ python atest.py
F
==
FAIL: testException (__main__.MyTest)
--
Traceback (most recent call last):
  File "/private/tmp/atest.py", line 15, in a
b()
  File "/private/tmp/atest.py", line 11, in b
c()
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/tmp/atest.py", line 23, in testException
a()
  File "/private/tmp/atest.py", line 17, in a
assert 1 == 2
AssertionError

--
Ran 1 test in 0.000s

FAILED (failures=1)
```

Too many frames have been filtered out of the `__context__` exception, 
including a number of relevant frames for `c` and `d`. I believe this happens 
because unittest sets a `limit` here based on the contents of the main 
traceback:
https://github.com/python/cpython/blob/39dd141a4ba68bbb38fd00a65cdcff711acdafb5/Lib/unittest/result.py#L182

but that limit applies recursively to the `__context__` and `__cause__` chains, 
when the intent of the limit was presumably only to filter the main exception.

--
messages: 394865
nosy: peter.hawkins
priority: normal
severity: normal
status: open
title: unittest filters out too many assertion stack frames from context/cause 
chains
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



cx_Oracle 8.2.1

2021-06-01 Thread Anthony Tuininga
What is cx_Oracle?

cx_Oracle is a Python extension module that enables access to Oracle
Database for Python and conforms to the Python database API 2.0
specifications with a number of enhancements.


Where do I get it?
https://oracle.github.io/python-cx_Oracle

The easiest method to install/upgrade cx_Oracle is via pip as in

python -m pip install cx_Oracle --upgrade


What's new?

See the full release notes for all of the details:
https://cx-oracle.readthedocs.io/en/latest/release_notes.html#version-8-2-1-june-2021

Please provide any feedback via GitHub issues (
https://github.com/oracle/python-cx_Oracle/issues).
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2021-06-01 Thread Steve Dower


Steve Dower  added the comment:

It still seems like pyexpat is not installing properly.

My best guess is that some virus scanner is silently blocking that file from 
being installed.

Do you know what scanner you have enabled? If you can disable it, can you try 
doing an uninstall/reinstall with it disabled?

--

___
Python tracker 

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



Re: Definition of "property"

2021-06-01 Thread Eryk Sun
On 6/1/21, Jon Ribbens via Python-list  wrote:
>
> I already answered that in the post you are responding to, but you
> snipped it: You can tell something's definitely not a data attribute
> if you have to put brackets after its name to call it as a method to
> invoke its function or retrieve the value it returns.

I prefer to use the generic term "computed attribute", which doesn't
interfere with the use of "data" in Python's concept of a data
descriptor and instance data. All descriptors are accessed without
calling them. Usually a non-data descriptor returns a bound callable
object, such as a method. But it can return anything. For example,
take the following P descriptor type:

class P:
   def __get__(self, obj, cls):
   if obj is not None:
   return 42
   return self

class C:
   p = P()

obj = C()

>>> obj.p
42

The P type doesn't implement __set__ or __delete__, so it's not a data
descriptor. This means we can set instance data `p` that overrides the
computed attribute. For example:

>>> obj.p = 21
>>> vars(obj)
{'p': 21}
>>> obj.p
21

>>> del obj.p
>>> obj.p
42
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44262] tarfile: some content different output

2021-06-01 Thread Filipe Laíns

Change by Filipe Laíns :


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



[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread MapleCCC


Change by MapleCCC :


--
keywords: +patch
nosy: +MapleCCC
nosy_count: 2.0 -> 3.0
pull_requests: +25075
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26428

___
Python tracker 

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



Re: Python app setup

2021-06-01 Thread Igor Korot
Hi,

On Tue, Jun 1, 2021 at 12:25 PM Murali Pa  wrote:
>
>Hi,
>I've installed latest version of Python 3.9.5 and downloaded for Windows.
>Once I click on the Python app, I'm getting command screen and not sure on
>the next action. could you please help me to fix this issue.
>Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64
>bit (AMD64)] on win32
>Type "help", "copyright", "credits" or "license" for more information.
>>>>

Congratulations!!
You successfully installed python onm your box.

Now you can start coding in python.

Thank you.

>Thanks,
>Murali PA
>
>
>Disclaimer: The information in this email is the property of IBM and may
>be IBM Confidential and privileged. It is intended solely for the
>addressee. Access to this email by anyone else is unauthorized. If you are
>not the intended recipient, any disclosure, copying, distribution or any
>action taken in reliance on it is prohibited. If you receive this message
>in error please notify the sender immediately and delete all copies of
>this message.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44279] doc: contextlib.suppress documentation is imprecise

2021-06-01 Thread Irit Katriel


New submission from Irit Katriel :

"suppresses any of the specified exceptions if they occur in the body of a with 
statement"

Should be:

"suppresses any of the specified exceptions if they are raised in the body of a 
with statement"

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 394863
nosy: docs@python, iritkatriel
priority: normal
severity: normal
status: open
title: doc: contextlib.suppress documentation is imprecise
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread jak

Il 31/05/2021 02:36, Dennis Lee Bieber ha scritto:

On Mon, 31 May 2021 08:07:21 +1000, Cameron Simpson 
declaimed the following:



Open another terminal, note its terminal device with the "tty" command.
Start your programme like this:

python .. 2>/dev/tty-of-the-other-termina



The OP specified Win10, so the above is dead from the start.




OP can try this way on win10: write the debug information in a log file
and, from another console, open the same log file with an editor that
knows how to check the active status of the file (eg: notepad++), which
can automatically update the changes (you can remove the notification
for this action from the tab preferences).

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


Re: Definition of "property"

2021-06-01 Thread Jon Ribbens via Python-list
On 2021-06-01, Greg Ewing  wrote:
> On 1/06/21 2:34 am, Jon Ribbens wrote:
>>  From the outside, it's just a *data* attribute. Which, from the inside,
>> it isn't. Hence "pretending".
>
> But what is it about the external appearance that would make
> you think it's a data attribute, rather than some other kind
> of attribute?

I already answered that in the post you are responding to, but you
snipped it: You can tell something's definitely not a data attribute
if you have to put brackets after its name to call it as a method to
invoke its function or retrieve the value it returns.

> (I'm assuming that by "data attribute" you mean a piece of
> data that's stored directly in the object. If you mean
> something else, we might be talking at cross purposes.)

I mean it in the sense it is used by the Python documentation.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Definition of "property"

2021-06-01 Thread Greg Ewing

On 1/06/21 2:34 am, Jon Ribbens wrote:

 From the outside, it's just a *data* attribute. Which, from the inside,
it isn't. Hence "pretending".


But what is it about the external appearance that would make
you think it's a data attribute, rather than some other kind
of attribute?

(I'm assuming that by "data attribute" you mean a piece of
data that's stored directly in the object. If you mean
something else, we might be talking at cross purposes.)

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


Python app setup

2021-06-01 Thread Murali Pa
   Hi,
   I've installed latest version of Python 3.9.5 and downloaded for Windows.
   Once I click on the Python app, I'm getting command screen and not sure on
   the next action. could you please help me to fix this issue.
   Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64
   bit (AMD64)] on win32
   Type "help", "copyright", "credits" or "license" for more information.
   >>>
   Thanks,
   Murali PA


   Disclaimer: The information in this email is the property of IBM and may
   be IBM Confidential and privileged. It is intended solely for the
   addressee. Access to this email by anyone else is unauthorized. If you are
   not the intended recipient, any disclosure, copying, distribution or any
   action taken in reliance on it is prohibited. If you receive this message
   in error please notify the sender immediately and delete all copies of
   this message.

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


Re: python 3.9.5

2021-06-01 Thread Terry Reedy

On 5/31/2021 3:15 AM, said ganoune wrote:

Just installed python 3.9.5 in my HP laptop, cant open it.
Laptop hp I3 running with windows 10.


You have to say a lot more.  How did you install, with what options? 
How do you try to 'open' (start) it?  What happens instead?



--
Terry Jan Reedy

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


Re: Definition of "property"

2021-06-01 Thread Alan Gauld via Python-list
On 31/05/2021 01:24, Greg Ewing wrote:
> On 31/05/21 8:20 am, Alan Gauld wrote:
>>
>> That's a very Pythonic description.
> 
> If it's a book about Python, it needs to be. The word "property"
> has a very specialised meaning in Python.
> 
> In some other languages it's used the way we use "attribute" in
> Python. So a Python-specific definition is necessarily going
> to be very different from a generic one.

That was the point, the OP said it was a book about OOP.
Not a book about "OOP in Python". The two are not synonymous.

If we go back to the very beginnings of OOP, properties were
defined as the publicly available state variables of the object.
(Some others favoured using "properties" to describe the entire
set of messages to which an object could respond).

In classification theory they are defined as "the essential
characteristics of an object that identify it with a class"
Some theorists also insist that such properties be immutable
after instantiation of the object.

The first could be considered quite close to what Python
does(or allows you to do) but the second is quite different!
Although properties can be used to create a form of immutablity.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


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


Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Grant Edwards
On 2021-05-31, Dennis Lee Bieber  wrote:
> On Mon, 31 May 2021 08:07:21 +1000, Cameron Simpson 
> declaimed the following:
>
>
>>Open another terminal, note its terminal device with the "tty" command.  
>>Start your programme like this:
>>
>>python .. 2>/dev/tty-of-the-other-termina
>
>   The OP specified Win10, so the above is dead from the start.

Perhaps Windows isn't an appropriate OS under which to develop curses 
applicatoins?

--
Grant



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


Re: How to debug python + curses? [was: RE: Applying winpdb_reborn]

2021-06-01 Thread Grant Edwards
On 2021-05-30, Alan Gauld via Python-list  wrote:
> On 30/05/2021 18:26, pjfarl...@earthlink.net wrote:
>> I tried winpdb-reborn some time last year on my Win10 system (python 3.8.3
>> at that time), but could not figure out how to use it to debug a python
>> script that uses the curses module.
>
> You are not alone. debugging curses is one of the biggest obstacles to
> its use.

Can't you just run the debugger in a different window and attach to
the process you want to debug? That's how one uses a debugger with
curses apps written in C/C++. Or I add debugging printf calls which
write to stderr and redirect stderr to a file.

> My approach is to define a status line at the bottom of my program and
> write print statements into that window. Something like:

Why not just use the standard python logging facility and log to a
file or another terminal window?

--
Grant

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


Re: Definition of "property"

2021-06-01 Thread Jon Ribbens via Python-list
On 2021-05-31, Greg Ewing  wrote:
> On 31/05/21 9:13 am, Jon Ribbens wrote:
>> No, I said it pretends to be a *data* attribute.
>
> I don't think it's pretending to be anything. From the outside,
> it's just an attribute.

>From the outside, it's just a *data* attribute. Which, from the inside,
it isn't. Hence "pretending".

> Data attributes are more common than non-data attributes, so
> we tend to assume that an attribute is a data attribute until
> told otherwise. But that's just our psychological bias, not
> because of any pretence on the part of properties.

None of that is true. You can tell something's definitely not
a data attribute if you have to put brackets after its name
to call it as a method to invoke its function or retrieve the
value it returns. Accessing a data attribtue is efficient and
has no side effects, unless someone's doing some unusual and
probably inadvisable hackery behind the scenes. Calling a method
can do literally anything.

> Also, there's a sense in which *all* attributes are properties.
> At the lowest level, all attribute accesses end up calling
> a method. It's just that in most cases the method is implemented
> in C and it looks up a value in the object's dict.

Sure, if we take the "lowest level" and pretend there are no
higher-level structures it's all just electrons doing apparently
random things and there's nothing more to be said about it.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-01 Thread Eryk Sun


Eryk Sun  added the comment:

> I was one of the people who mistakenly thought that Python 3 operating 
> in the new Windows Terminal was going to magically leave us sitting 
> happily in completely UTF-8 compatible territory on Windows, not 
> realizing the complex long-term dependencies and regressions that 
> still remain problematic.

Windows Terminal provides a tab-based UI that supports font fallback and 
complex scripts, which is a significant improvement over the builtin terminal 
that conhost.exe provides. Each tab is a headless (conpty) console session 
that's hosted by an instance of OpenConsole.exe. The latter is based on the 
same source tree as the system conhost.exe, but typically it's a more recent 
build. The console host is what implements most of the API for client 
applications. That the host is in headless mode and connected to an alternate 
terminal doesn't matter from the perspective of client applications.

The console has been Unicode (UCS-2) back to its initial release in 1993. 
Taking advantage of this requires reading and writing wide-character strings 
via ReadConsoleW and WriteConsoleW, as Python's does in 3.6+ (except not for 
os.read and os.write). Many console applications instead use encoded byte 
strings with ReadFile / ReadConsoleA and WriteFile / WriteConsoleA. Updating 
the console host to support UTF-8 for this has been a drawn-out process. It 
finally has full support for writing UTF-8 in Windows 10, including splitting a 
sequence across multiple writes. But reading non-ASCII UTF-8 is still broken.

"more.com" uses the console input codepage to decode the file, so a workaround 
is to run `chcp.com 65001` and run Python in UTF-8 mode, e.g. `py -X utf8=1`. 
Since reading non-ASCII UTF-8 is broken, you'll have to switch back to the old 
input codepage if you need to enter non-ASCII characters in an app that reads 
from the console via ReadFile or ReadConsoleA.

--

___
Python tracker 

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



[issue37766] IDLE autocomplete: revise fetch_completions, add htest

2021-06-01 Thread E. Paine


Change by E. Paine :


--
nosy: +epaine
versions: +Python 3.10, Python 3.11 -Python 3.7, Python 3.8

___
Python tracker 

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



[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2021-06-01 Thread Pooja Warhekar


Pooja Warhekar  added the comment:

Please find the attached log files.

--
Added file: https://bugs.python.org/file50079/Python log files.zip

___
Python tracker 

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



[issue29086] Document C API that is not part of the limited API

2021-06-01 Thread Petr Viktorin


Petr Viktorin  added the comment:

PEP 652 is now in, and with it a list of everything that *is* in the stable 
ABI: https://docs.python.org/3.10/c-api/stable.html#contents-of-limited-api

I'm closing the issue.

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



[issue23903] Generate PC/python3.def by scraping headers

2021-06-01 Thread Petr Viktorin


Petr Viktorin  added the comment:

PEP 652 (bpo-43795) is now in; I'm closing this issue.

A cross-platform C parser/checker would still be an improvement, but the 
constraints (no external dependencies in CPython) and benefits (not many 
compared to the goal of strict separation of internal/public/stable headers) 
aren't really aligned in its favor.

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



[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-01 Thread Jesse Silverman

Jesse Silverman  added the comment:

Thank you so much Inada and Eryk and Steve!

I was one of the people who mistakenly thought that Python 3 operating in the 
new Windows Terminal was going to magically leave us sitting happily in 
completely UTF-8 compatible territory on Windows, not realizing the complex 
long-term dependencies and regressions that still remain problematic.

I had spent a lot of time paying attention to the Python 2 vs. 3 debates with 
people shouting "I don't care about Unicode!" and mistook dedication to 
preventing regressions and breakages for a lesser appreciation of the value of 
UTF-8 support.  I have been schooled.  We all want the same thing, but getting 
there on Windows from where we are at the moment remains non-trivial.

Heartfelt appreciation to all on the front lines of dealing with this complex 
and sticky situation. ❤️❤️❤️

Also, much love to those who had put in the work to have much more help than I 
realized existed even when one finds oneself isolated on a single disconnected 
machine with only the standard docs as a guide吝 -- I didn't realize the pages I 
found mojibake on even existed until this weekend.

--

___
Python tracker 

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



[issue44277] cpython forks are spammed with dependabot PRs

2021-06-01 Thread Zachary Ware


Zachary Ware  added the comment:

This seems like a Dependabot bug; is there anything we can even do about it?

--
nosy: +zach.ware

___
Python tracker 

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



[issue43795] Implement PEP 652 -- Maintaining the Stable ABI

2021-06-01 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +25074
pull_request: https://github.com/python/cpython/pull/26479

___
Python tracker 

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



[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2021-06-01 Thread Steve Dower


Steve Dower  added the comment:

Pooja, could you share your install logs? Details are in my post directly above 
yours.

--

___
Python tracker 

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



[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-01 Thread Kshitiz Arya


Kshitiz Arya  added the comment:

I guess we will have to wait until Python 3.10 is released and we have more 
conclusive data about speed and readability of match-case before we can go 
ahead with this issue.

--

___
Python tracker 

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



[RELEASE] Python 3.10.0b2 is available

2021-06-01 Thread Pablo Galindo Salgado
After fighting with some release blockers, implementing a bunch of GC
traversal functions, and fixing some pending reference leaks, we finally
have Python 3.10.0 beta 2 ready for you! Thanks to everyone that helped to
unblock the release!

https://www.python.org/downloads/release/python-3100b2/

# This is a beta preview of Python 3.10

Python 3.10 is still in development. 3.10.0b2 is the second of four planned
beta release previews. Beta release previews are intended to give the wider
community the opportunity to test new features and bug fixes and to prepare
their projects to support the new feature release.

We **strongly encourage** maintainers of third-party Python projects to
**test with 3.10** during the beta phase and report issues found to [the
Python bug tracker](https://bugs.python.org/) as soon as possible. While
the release is planned to be feature complete entering the beta phase, it
is possible that features may be modified or, in rare cases, deleted up
until the start of the release candidate phase (Monday, 2021-08-02). Our
goal is to have no ABI changes after beta 4 and as few code changes as
possible after 3.10.0rc1, the first release candidate. To achieve that, it
will be **extremely important** to get as much exposure for 3.10 as
possible during the beta phase.

Please keep in mind that this is a preview release and its use is **not**
recommended for production environments.

The next pre-release of Python 3.10 will be 3.10.0b3, currently scheduled
for Thursday, 2021-06-17.

# And now for something completely different

The Ehrenfest paradox concerns the rotation of a "rigid" disc in the theory
of relativity. In its original 1909 formulation as presented by Paul
Ehrenfest in relation to the concept of Born rigidity within special
relativity, it discusses an ideally rigid cylinder that is made to rotate
about its axis of symmetry. The radius R as seen in the laboratory frame is
always perpendicular to its motion and should therefore be equal to its
value R0 when stationary. However, the circumference (2πR) should appear
Lorentz-contracted to a smaller value than at rest. This leads to the
apparent contradiction that R = R0 and R < R0.

# We hope you enjoy those new releases!

Thanks to all of the many volunteers who help make Python Development and
these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the Python
Software Foundation.

Regards from very sunny London,

Your friendly release team,
Pablo Galindo @pablogsal
Ned Deily @nad
Steve Dower @steve.dower
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


[issue40395] Scripts folder is Empty in python 3.8.2 for Windows 7.

2021-06-01 Thread Pooja Warhekar


Pooja Warhekar  added the comment:

Similar issue on windows 8.1 with Python 3.9.5. Repairing also did not work.

--
nosy: +poojawarhekar2012

___
Python tracker 

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



[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-06-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-06-01 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +25073
pull_request: https://github.com/python/cpython/pull/26478

___
Python tracker 

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



[RELEASE] Python 3.10.0b2 is available

2021-06-01 Thread Pablo Galindo Salgado
After fighting with some release blockers, implementing a bunch of GC
traversal functions, and fixing some pending reference leaks, we finally
have Python 3.10.0 beta 2 ready for you! Thanks to everyone that helped to
unblock the release!

https://www.python.org/downloads/release/python-3100b2/

# This is a beta preview of Python 3.10

Python 3.10 is still in development. 3.10.0b2 is the second of four planned
beta release previews. Beta release previews are intended to give the wider
community the opportunity to test new features and bug fixes and to prepare
their projects to support the new feature release.

We **strongly encourage** maintainers of third-party Python projects to
**test with 3.10** during the beta phase and report issues found to [the
Python bug tracker](https://bugs.python.org/) as soon as possible. While
the release is planned to be feature complete entering the beta phase, it
is possible that features may be modified or, in rare cases, deleted up
until the start of the release candidate phase (Monday, 2021-08-02). Our
goal is to have no ABI changes after beta 4 and as few code changes as
possible after 3.10.0rc1, the first release candidate. To achieve that, it
will be **extremely important** to get as much exposure for 3.10 as
possible during the beta phase.

Please keep in mind that this is a preview release and its use is **not**
recommended for production environments.

The next pre-release of Python 3.10 will be 3.10.0b3, currently scheduled
for Thursday, 2021-06-17.

# And now for something completely different

The Ehrenfest paradox concerns the rotation of a "rigid" disc in the theory
of relativity. In its original 1909 formulation as presented by Paul
Ehrenfest in relation to the concept of Born rigidity within special
relativity, it discusses an ideally rigid cylinder that is made to rotate
about its axis of symmetry. The radius R as seen in the laboratory frame is
always perpendicular to its motion and should therefore be equal to its
value R0 when stationary. However, the circumference (2πR) should appear
Lorentz-contracted to a smaller value than at rest. This leads to the
apparent contradiction that R = R0 and R < R0.

# We hope you enjoy those new releases!

Thanks to all of the many volunteers who help make Python Development and
these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the Python
Software Foundation.

Regards from very sunny London,

Your friendly release team,
Pablo Galindo @pablogsal
Ned Deily @nad
Steve Dower @steve.dower
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-06-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 39dd141a4ba68bbb38fd00a65cdcff711acdafb5 by Serhiy Storchaka in 
branch 'main':
bpo-44273: Improve syntax error message for assigning to "..." (GH-26477)
https://github.com/python/cpython/commit/39dd141a4ba68bbb38fd00a65cdcff711acdafb5


--

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-06-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fffa0f92adaaed0bcb3907d982506f78925e9052 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42972: Track sqlite3 statement objects (GH-26475)
https://github.com/python/cpython/commit/fffa0f92adaaed0bcb3907d982506f78925e9052


--

___
Python tracker 

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



[issue44273] Assigning to Ellipsis should be the same as assigning to __debug__

2021-06-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
nosy: +serhiy.storchaka
nosy_count: 2.0 -> 3.0
pull_requests: +25072
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/26477

___
Python tracker 

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



[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Assigning to Ellipsis should be the same as assigning to 
__debug__

___
Python tracker 

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



[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I think this is a duplicate of issue 44273.

--
nosy: +BTaskaya

___
Python tracker 

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



[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-01 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

match-case has not even reached a stable version of Python yet, it is only 
available in Python 3.10 which is still in beta. Are we sure that it is faster 
in all cases and how do you know it is more intuitive when the vast majority of 
Python users have likely not even heard of match-case yet?

Personally, I am looking forward to using match-case, but I can see myself 
having to write lots of comments explaining what the code is doing for many 
years to come.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue44278] Improve syntax error message for assigning to "..."

2021-06-01 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Some users can be confused by syntax error message for assigning to ellipsis 
[1]:

>>> ... = 1
  File "", line 1
... = 1
^^^
SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of 
'='?

because Ellipsis is a name of a builtin variable Ellipsis, and it is possible 
to assign to variable named Ellipsis.

>>> Ellipsis = 1
>>> Ellipsis
1

I think that using lowercase spelling of "ellipsis" will eliminate confusion.

[1] 
https://mail.python.org/archives/list/python-id...@python.org/thread/KDQ3OHALLXVZJIGPC4BMPVS2XH3VFPJV/

--
components: Interpreter Core
messages: 394849
nosy: pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve syntax error message for assigning to "..."
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



[issue44079] [sqlite3] remove superfluous statement weak ref list from connection object

2021-06-01 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Also, note that if identical SQL statements are created in multiple cursors 
belonging to the same connection, they will currently _not_ be added to the 
connection weak ref list. See the if (self->statement->in_use) in the middle of 
_pysqlite_query_execute(). Thus, the current code actually fails to register 
_all_ statements in the "all statements" weak ref list. IMO, this is yet 
another argument to abandon that list.

Side note: This branch is not exercised in the unit test suite. Adding the 
following test will cover this branch:

diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index c17f911fa1..8e53c657a6 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -526,6 +526,10 @@ def test_last_row_id_insert_o_r(self):
 ]
 self.assertEqual(results, expected)
 
+def test_same_query_in_multiple_cursors(self):
+cursors = [self.cx.execute("select 1") for _ in range(3)]
+for cu in cursors:
+self.assertEqual(cu.fetchall(), [(1,)])
 
 class ThreadTests(unittest.TestCase):
 def setUp(self):


See bpo-43553 for sqlite3 coverage improvements.

--

___
Python tracker 

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



[issue44276] Replace if-elif-else structure with match-case (PEP634)

2021-06-01 Thread Kshitiz Arya


Kshitiz Arya  added the comment:

This is a relatively simple example of how this will improve readability of the 
code.
(This example is form Lib/json/encoder.py)

Original

-
if isinstance(value, str):
yield _encoder(value)
elif value is None:
yield 'null'
elif value is True:
yield 'true'
elif value is False:
yield 'false'
elif isinstance(value, int):
yield _intstr(value)
elif isinstance(value, float):
yield _floatstr(value)
else:
if isinstance(value, (list, tuple)):
chunks = _iterencode_list(value, _current_indent_level)
elif isinstance(value, dict):
chunks = _iterencode_dict(value, _current_indent_level)
else:
chunks = _iterencode(value, _current_indent_level)
yield from chunks 
--

Suggested

--
match value:
case str():
yield _encoder(value)
case None:
yield 'null'
case True:
yield 'true'
case False:
yield 'false'
case int():
# see comment for int/float in _make_iterencode
yield _intstr(value)
case float():
# see comment for int/float in _make_iterencode
yield _floatstr(value)
case _:
match value:
case list()|tuple():
chunks = _iterencode_list(value, _current_indent_level)
case dict():
chunks = _iterencode_dict(value, _current_indent_level)
case _:
chunks = _iterencode(value, _current_indent_level)
yield from chunks


--

___
Python tracker 

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



[issue25957] sockaddr_l2 lacks CID, address type (AF_BLUETOOTH sockets)

2021-06-01 Thread Steve Dower


Change by Steve Dower :


--
nosy:  -steve.dower

___
Python tracker 

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



[issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value

2021-06-01 Thread Steve Dower


Change by Steve Dower :


--
nosy:  -steve.dower

___
Python tracker 

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



[issue34219] distutils: build_ext -D wrongly assume defining a symbol with no value

2021-06-01 Thread Steve Dower


Steve Dower  added the comment:

distutils is deprecated and no further bugs will be fixed (other than newly 
discovered release blockers).

You will want to report this to setuptools instead.

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



[issue44275] Is there a mojibake problem rendering interactive help in the REPL on Windows?

2021-06-01 Thread Steve Dower


Steve Dower  added the comment:

> If changing the console input codepage to UTF-8 fixes the mojibake problem, 
> then probably you're running Python in UTF-8 mode.

I forget where I saw them, but there are some places where we incorrectly use 
stdin encoding for writing to stdout (I suppose assuming that they'll always 
match). This may be being impacted by one of those.

--
assignee: docs@python -> 
versions: +Python 3.10, Python 3.11

___
Python tracker 

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



  1   2   >