[issue34013] Inconsistent SyntaxError for print

2021-02-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

'Consistency' is in the eye of the beholder in that it is relative to some 
ideal.  'Inconsistent' has too much baggage as bad'.  I would prefer to call 
the current rule 'restricted' or 'limited' and judge any expansion on its own 
merits.

The arguments to print can take an unbounded amount of space.  So a general 
message "Did you mean print()?" could also be indefinitely 
long.  I don't think this is a good idea.  Of course, the same applies to a 
single literal, especially multiline string literals.  But at least the latter 
are currently clipped to only the first line in the message.

>>> print '''first line
second line'''
SyntaxError: Missing parentheses in call to 'print'. Did you mean 
print('''first line)?

(The above would be better with trailing ... .) This abbreviation would be 
harder with multiple arguments.  The special message is for beginners.  They 
might print a literal or name without ()s more frequently.  I not sure that 
they need the reminder with every mistake.

--

___
Python tracker 

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



Re: Python 0.9.1

2021-02-18 Thread Christian Gollwitzer

Am 16.02.21 um 22:57 schrieb Skip Montanaro:

A note to webmas...@python.org from an astute user named Hiromi in
Japan* referred
us to Guido's shell archives for the 0.9.1 release from 1991.



I then pushed the result to a Github repo:

https://github.com/smontanaro/python-0.9.1



That's a nice find!

Reading the README, it occured to me that it refers to the shell, awk 
and perl as contenders for Python[1], but not to Tcl. I would have 
thought that in 1991, Tcl was one of the obvious choices as an extension 
language. At that time, it had already progressed to version 6 [2]


Was Guido not aware of Tcl, or did he not think that it is a contender 
in the same area?


Christian




[1] "Python, an extensible interpreted programming language [...] can be 
used instead of shell, Awk or Perl scripts, to write prototypes of real 
applications, or as an extension language of large systems, you name it."


[2] https://wiki.tcl-lang.org/page/Tcl+chronology

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


Startup failure

2021-02-18 Thread Smit Patel
I recently downloaded python from your website and when I started using it,
it worked correctly but when I installed the random2 module it showed
startup failure and won't work again.
So, I uninstalled it and downloaded it again but it is showing the same
problem of startup failure.

Let me know if there is a way to resolve the problem.
Thank you
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34013] Inconsistent SyntaxError for print

2021-02-18 Thread Ammar Askar


Ammar Askar  added the comment:

It's still one of the most common beginner mistakes, personally I think the 
trade-off in complexity at least for the grammar level fix is worth it here.

--
nosy: +ammar2

___
Python tracker 

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



[issue34013] Inconsistent SyntaxError for print

2021-02-18 Thread Vedran Čačić

Vedran Čačić  added the comment:

Aren't we overthinking this? Python 2 is a dead language. It has reached end of 
life more than a year ago (and was scheduled to do so in 2015). Why are we 
still trying to accomodate something that stopped being relevant a long time 
ago?

--
nosy: +veky

___
Python tracker 

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



[issue43260] Never release buffer when MemoryError in print()

2021-02-18 Thread Ramin Farajpour Cami


Change by Ramin Farajpour Cami :


--
type:  -> crash

___
Python tracker 

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



[issue43262] "_weakrefset.py", line 56: IndexError: pop from empty list

2021-02-18 Thread Jinghao Shi


New submission from Jinghao Shi :

One of our asyncio based application sporadically crash due to this stack trace:

```
File ".../lib/python3.8/asyncio/runners.py", line 48, in run
loop.run_until_complete(loop.shutdown_asyncgens())
  File ".../lib/python3.8/asyncio/base_events.py", line 595, in 
run_until_complete
future = tasks.ensure_future(future, loop=self)
  File ".../lib/python3.8/asyncio/tasks.py", line 669, in ensure_future
task = loop.create_task(coro_or_future)
  File ".../lib/python3.8/asyncio/base_events.py", line 431, in create_task
task = tasks.Task(coro, loop=self, name=name)
  File ".../lib/python3.8/_weakrefset.py", line 83, in add
self._commit_removals()
  File ".../lib/python3.8/_weakrefset.py", line 56, in _commit_removals
discard(l.pop())
IndexError: pop from empty list
```

We do not have a reliable repro. From reading the source code, it appears we 
should never try to pop from empty list:

```
 def _commit_removals(self):
l = self._pending_removals
discard = self.data.discard
while l:
discard(l.pop()) # <-- HERE
```

--
components: asyncio
messages: 387288
nosy: asvetlov, jhshi89, yselivanov
priority: normal
severity: normal
status: open
title: "_weakrefset.py", line 56: IndexError: pop from empty list
type: crash
versions: Python 3.8

___
Python tracker 

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



[issue43260] Never release buffer when MemoryError in print()

2021-02-18 Thread Ramin Farajpour Cami


Ramin Farajpour Cami  added the comment:

Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec  7 2020, 16:33:24) [MSC v.1928 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("a"*10)
Traceback (most recent call last):
  File "", line 1, in 
MemoryError
>>> print("1")
Traceback (most recent call last):
  File "", line 1, in 
MemoryError
>>>

--

___
Python tracker 

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



[issue43260] Never release buffer when MemoryError in print()

2021-02-18 Thread Ramin Farajpour Cami


Ramin Farajpour Cami  added the comment:

Version : 

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit 
(Intel)] on win32

--

___
Python tracker 

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



[issue43261] Python 3.9 repair on Windows do not recover pip module

2021-02-18 Thread Svyatoslav


New submission from Svyatoslav :

I by mistake run command `pip install -U pip setuptools wheel` on Windows which 
deleted pip and did not install a new version. I decided to repair Python using 
3.9.1 installer option. But after repair pip still was not installed.

--
components: Windows
messages: 387285
nosy: Prometheus3375, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python 3.9 repair on Windows do not recover pip module
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: [Python-Dev] Re: Python 0.9.1

2021-02-18 Thread Dan Stromberg
On Thu, Feb 18, 2021 at 9:39 PM David Mertz  wrote:

> As Skip pointed out to me privately, there are some minor limitations with
> this version.  E.g.:
>
> % python
> >>> import glob
> >>> import sys
> >>> print 'hello'
> hello
> >>> print 2+2
> 4
> >>> print 2*2
> Unhandled exception: run-time error: integer overflow
> Stack backtrace (innermost last):
>   File "", line 1
>

Huh.  I wonder what's different about my build:
$ /usr/local/cpython-0.9/bin/python
below cmd output started 2021 Thu Feb 18 10:24:00 PM PST
>>> 2*2
4
>>> print 2*2
4
>>>

You can download a script to build it and a bunch of other python versions
at https://stromberg.dnsalias.org/~strombrg/cpythons/
It includes all the tarballs you should need, at least for Debian. I
believe I used it on CentOS recently as well.  I haven't tried it on Ubuntu
in a while.
It depends on https://stromberg.dnsalias.org/~strombrg/cobble.html - and
I'd like to think that's its only external dependency.

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


[issue43223] [security] http.server: Open Redirection if the URL path starts with //

2021-02-18 Thread Hamza AVvan


Hamza AVvan  added the comment:

As for the directory issue, not only .ssh but an attacker can use any directory 
to make the open redirection exploitable.

And as for the HTTP Header Location, the server does not remove extra trailing 
slash from the PAYLOAD uri, which seems to be the cause of vulnerability 
getting exploited.

http://127.0.0.1:8000//attacker.com/..%2f..%2f..%2f..%2f..%2f../%0a%0d/../.ssh

So I believe the server should check for multiple slashes and remove them from 
the path. 

Additionally, as you've mentioned it should also prepend the host:port/ to the 
new_url variable before writing the HTTP Header Location because if an attacker 
bypasses the protection and add an extra slash the server will still redirect 
to the host which is getting inserted into the Location header. But honestly I 
need your opinion as concatenating host to the url may lead to Host Header 
Injection but it'll then require a different context.

Please watch the POC video.
POC Video: https://youtu.be/rLfOoEu1XXg

--

___
Python tracker 

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



[issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group

2021-02-18 Thread paul j3


paul j3  added the comment:

The mutually exclusive arguments are displayed with in the argument group, at 
least in my testing.  From a copy-n-paste of your example:

In [8]: parser.print_help()
usage: ipython3 [-h]
[--from-args FROM_ARGS | --from-files FROM_FILES | --from-stdin 
FROM_STDIN]
[-0 0]

optional arguments:
  -h, --helpshow this help message and exit

INPUT OPTIONS:
  --from-args FROM_ARGS
  --from-files FROM_FILES
  --from-stdin FROM_STDIN
  -0 0  null delimited pathnames


I've had occasion to note that this is the only kind of group nesting that 
works (or makes sense).

In add_container_actions, there is a comment:

# add container's mutually exclusive groups
# NOTE: if add_mutually_exclusive_group ever gains title= and
# description= then this code will need to be expanded as above

So the original developer envisioned giving a mutually exclusive group a 
formatting role, but with this nesting this isn't needed (that I can tell).  
But I don't think this has been documented.

--

___
Python tracker 

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



[issue43260] Never release buffer when MemoryError in print()

2021-02-18 Thread Ramin Farajpour Cami


Change by Ramin Farajpour Cami :


--
title: Never release buffer when MemoryError in prtin() -> Never release buffer 
when MemoryError in print()

___
Python tracker 

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



[issue43260] Never release buffer when MemoryError in prtin()

2021-02-18 Thread Ramin Farajpour Cami


New submission from Ramin Farajpour Cami :

Hi,


When we use "a"*100 in print("a"*100) function, Show 
"MemoryError",Again i use print("1") again display  "MemoryError", I think 
memory not release for use again, 


>>> print("a"*10)
Traceback (most recent call last):
  File "", line 1, in 
MemoryError
>>> print("1")
Traceback (most recent call last):
  File "", line 1, in 
MemoryError

When i exit() python interpeter, and again print("1") it's work.

And I test in linux its' work:
>>> print("a"*10)
Traceback (most recent call last):
  File "", line 1, in 
MemoryError
>>> print("1")
1
>>> print("a")
a
>>>


Thanks.
Ramin

--
components: Windows
messages: 387282
nosy: Ramin Farajpour Cami, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Never release buffer when MemoryError in prtin()
versions: Python 3.8

___
Python tracker 

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



[issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group

2021-02-18 Thread hai shi


Change by hai shi :


--
nosy: +paul.j3, rhettinger

___
Python tracker 

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



[issue41847] Update "install launcher for all users" installer option

2021-02-18 Thread Eryk Sun


Eryk Sun  added the comment:

> but at least for clean installs of 3.10 we can avoid the need 
> for admin completely

Except updating PATHEXT always requires admin access. I do this manually by 
setting a user PATHEXT variable with %PATHEXT% as the first item and append the 
extensions that I need. This is okay because the system environment gets 
populated before the user environment, and a system environment that doesn't 
define PATHEXT is improperly configured. I don't know whether WiX/MSI can 
support this, but it's probably not worth the hassle and potential problems.

--
nosy: +eryksun

___
Python tracker 

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



[issue42840] `type` takes **kwargs for __init_subclass__

2021-02-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

I'll try to review it in the coming weeks.

--

___
Python tracker 

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



[issue43246] Dict copy optimization violates subclass invariant

2021-02-18 Thread Inada Naoki


Inada Naoki  added the comment:

I am not sure this should be fixed.

If so, I think we should use PyDict_CheckExact() instead of PyDict_Check() && 
(tp_iter is overridden || keys() is overridden || sq_item is overridden).

--
nosy: +rhettinger

___
Python tracker 

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



[issue43259] argparse: allow add_mutually_exclusive_group on add_argument_group

2021-02-18 Thread Christoph Anton Mitterer


New submission from Christoph Anton Mitterer :

Hey.

AFAIU, the sole purpose of ArgumentParser.add_argument_group() is for the 
grouping within the help output.

It would be nice, if one could create a mutually exclusive group (with 
ArgumentParser.add_mutually_exclusive_group) from/within such a "normal" group, 
so that the mutually exclusive arguments are listed within the group, but are 
still, mutually exclusive.

Right now when doing something like:
parser = argparse.ArgumentParser()
parser_group = parser.add_argument_group("INPUT OPTIONS")
parser_group_mutually_exclusive = 
parser_group.add_mutually_exclusive_group(required=False)
parser_group_mutually_exclusive.add_argument("--from-args")
parser_group_mutually_exclusive.add_argument("--from-files")
parser_group_mutually_exclusive.add_argument("--from-stdin")
parser_group.add_argument("-0", help="null delimited pathnames")

it works, but the mutually exclusive options are note printed within the "INPUT 
OPTIONS", but rather at the normal "optional arguments:" section of the help.

The above example also kinda shows what this could be used for:
- one might have e.g. a group for input options, and amongst that the mutually 
exclusive "--from-*" which specify the source of the input.


Cheers,
Chris.

--
components: Library (Lib)
messages: 387278
nosy: calestyo
priority: normal
severity: normal
status: open
title: argparse: allow add_mutually_exclusive_group on add_argument_group
type: enhancement

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread miss-islington


miss-islington  added the comment:


New changeset 138488750512b47f1773630f90e92ec5038b6978 by Miss Islington (bot) 
in branch '3.9':
closes bpo-43254: Fix *snprintf() man page refs. (GH-24563)
https://github.com/python/cpython/commit/138488750512b47f1773630f90e92ec5038b6978


--

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread miss-islington


miss-islington  added the comment:


New changeset 8a42eb1492dec2ec0cc79146f0c817acb7328b19 by Miss Islington (bot) 
in branch '3.8':
closes bpo-43254: Fix *snprintf() man page refs. (GH-24563)
https://github.com/python/cpython/commit/8a42eb1492dec2ec0cc79146f0c817acb7328b19


--

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23351
pull_request: https://github.com/python/cpython/pull/24572

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +23350
pull_request: https://github.com/python/cpython/pull/24571

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset e92d67dfbb4790df37aa6a0961fb6dc7e8d2fbbf by Erlend Egeberg 
Aasland in branch 'master':
closes bpo-43254: Fix *snprintf() man page refs. (GH-24563)
https://github.com/python/cpython/commit/e92d67dfbb4790df37aa6a0961fb6dc7e8d2fbbf


--
nosy: +benjamin.peterson
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



[issue39448] Add regen-frozen makefile target

2021-02-18 Thread Neil Schemenauer


Change by Neil Schemenauer :


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



[issue39448] Add regen-frozen makefile target

2021-02-18 Thread Neil Schemenauer


Neil Schemenauer  added the comment:


New changeset ffa55d21b4a86ad8b4a43a9f597151e526541130 by Neil Schemenauer in 
branch 'master':
bpo-39448: Add regen-frozen makefile target. (GH-18174)
https://github.com/python/cpython/commit/ffa55d21b4a86ad8b4a43a9f597151e526541130


--

___
Python tracker 

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



[issue41847] Update "install launcher for all users" installer option

2021-02-18 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 4.0 -> 5.0
pull_requests: +23349
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24570

___
Python tracker 

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



RE: New Python implementation

2021-02-18 Thread Elliott Roper


Avi and Dennis--

Two thoughtful replies to a deep and interesting question. You have prodded me
to poke my head over the wall to offer a real world point of view.

In the early days before Modula II, I was contracting to a company, quite
large and respected, that had just chucked out Ratfor and adopted Pascal as
their main development tool on VAX-VMS. With long hindsight it was a not
insignificant factor in their going bust.

I was happily developing some of the best code I have ever written using Macro
on a J-11 PDP 11/73, so I was an innocent bystander, with my own OS, with
'borrowed' XDT and CRC table look-up software, courtesy of Dave Cutler and Stu
Wecker respectively. It was a front end for the main project, supporting 1024
terminals feeding 200 transactions a second into the VAX over raw ethernet on
a DEQNA. So I sure learned how to do linked lists, and do them quickly.

The main team was sharing a VAX-750. Watching them trying to use a teaching
language to do real world work was not a joy to behold.

You have both hit on a real-world problem. Script Kiddies and Stack Exchange


A comp sci course must use a real-world language to send confident
practitioners into the real world.

Python is an excellent choice in that regard.

Dennis' point about it being too good is valid. If it were my course (and
there is no chance of that) I'd do an extra credit module where they have to
mine and critique the cPython source etc. for lists and comprehensions and
itertools and all their uncles and aunts. After all c is the nearest they will
get to the metal.

I know this has to work. Two or three of the guys on that project were John
Lion's co-authors of the Red Book on Unix internals. They were awesome! (I
told you this was very long hindsight didn't I?)

On 18 Feb 2021 at 17:26:11 GMT, ""Avi Gross""  wrote:

> Dennis made the interesting comment "... Python has too much built in ..."
> 
> I understand his point. At the same time, I wonder what most people using
> computers today, or in the future, need. Given serious amounts of computer
> power, what many people may want is higher-level ways to get things done
> without worrying how they are done. Python, like many such languages, has a
> very basic core that is augmented by what could be libraries, packages,
> modules and so on but have been chosen to be built-in to one distribution or
> another.
> 
> Some people and organizations use some things so commonly, they want python
> to start up automatically loading say numpy and pandas and other such
> things. They may not care if the programmer knows how to make a linked list
> or binary tree data structure. Many such details are encapsulated within
> objects built and tested already. 
> 
> I have seen subjects taught at various levels and python might qualify too.
> I took a Physics course that required Calculus and used it to derive
> formulas and other things. Others took one that sort of threw equations at
> you without much explanation. I have even seen a course called Physics for
> Poets. But at least the poets taking it  knew science existed and perhaps to
> take it seriously when others who had studied it better shared their
> results, even if they have no interest in the methods.
> 
> We routinely have people learn how to use Word Processors or Spreadsheets
> with no clue on how to build such a thing or anything about the Object
> models used within or even knowing there is such a thing. Do they need to
> know how to use the embedded methods to extend things with Visual Basic or
> Javascript? They like getting closer to a WYSIWYG interface that handles
> most of their usual needs and perhaps farm out harder things to experts when
> needed.
> 
> So what if you teach some aspects of python that are needed all over, like
> how to make things conditional or in a loop, but not how to make every
> possible data structure. What if you deliberately do not teach functional
> aspects of the language at first or ever? For some people that is enough to
> enable them to then use additional instructions on how to find prepared and
> tested chunks to use, even if not always optimally or efficiently. For those
> who really want to be programmers, that still may actually be enough if
> their task is to work using the tools we have developed, not in making new
> tools from scratch. Quite a bit of programming today consists of reading
> manual pages and cobbling together chunks that together do the job.
> 
> But obviously I would choose the classes where I understood more. Many here
> would. But where does it end? Do most of us know how compilers or
> interpreters get built or do we just work on top of existing implementations
> others make available? Can you build an operating system from Scratch or
> make microchips to run them on?
> 
> If the goal is Computer USE literacy, I think python has more than enough if
> you include the modules that make hard things easy.
> 
> Just a thought. Admittedly it is hard these days 

[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-18 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue43115] locale.getlocale fails if locale is set

2021-02-18 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

On 18.02.2021 19:04, Eryk Sun wrote:
> 
> Eryk Sun  added the comment:
> 
>> The APIs were written at a time where locale modifiers 
>> simply did mot exist. 
> 
> Technically, locale modifiers did exist circa 2000, but I suppose you mean 
> that they were uncommon to the point of being unheard of at the time.
> 
> The modifier field was specified in the X/Open Portability Guide Issue 3 
> (XPG3) in 1989, and again in XPG4 in 1992 as 
> "language[_territory][.codeset][@modifier]". I can't provide links to the 
> specifications (they're not freely available), but here's a link to X/Open 
> "Internationalisation Guide Version 2" (1993), which defines the modifier 
> field in section 5.1.2 (pages 88-89):
> 
> https://pubs.opengroup.org/onlinepubs/009269599/toc.pdf

Thanks for the link.

The standard may have already been defined in POSIX, but I'm pretty
sure this was not a thing on the SuSE Linux system I was working off
at the time :-)

This is what glibc supported in 2000:

https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED;h=5ca1beb8eacbe5d86322cb2d015ec260422813d8;hb=1914953f71bf9ace1981d838b3777e473e63e8d1

vs. today:

https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED

The first time I ever saw @modifiers in the wild was when the
Euro symbol was introduced in preparation for Jan 1, 2002.

Note that the encoding alias table in Python 2.0 does include an
entry "utf8@ucs4", which originated from the X11 local.alias file.
Apparently those modifiers were already in use on Digital Unix
at the time:

https://github.com/freedesktop/xorg-libX11/blob/deae12c6b683898f5213992d561a59d4ea889cca/nls/locale.alias.pre
(this is from 2003; couldn't find earlier references)

It is interesting to see that the locale.alias.pre file actually
did include Windows locale definitions. On Linux, those don't get
compiled in, so I didn't get to see them :-)

Also interesting is that they aliased e.g. cp1252 to ISO-8859-1,
even though the two encodings are not the same.

--

___
Python tracker 

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



[issue43258] Prevent needless allocation of sqlite3 aggregate function context

2021-02-18 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

If no rows match an aggregate query, _pysqlite_step_callback() is never called, 
and _pysqlite_final_callback() is called once. In order to prevent needless 
context allocation, we should pass 0 as the second argument to 
sqlite3_aggregate_context().


Quoting from https://sqlite.org/c3ref/aggregate_context.html:

Within the xFinal callback, it is customary to set N=0 in calls to 
sqlite3_aggregate_context(C,N) so that no pointless memory allocations occur.

--
components: Library (Lib)
messages: 387272
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Prevent needless allocation of sqlite3 aggregate function context
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



[issue43257] get_type_hints evaluates class variables before type hints

2021-02-18 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue42840] `type` takes **kwargs for __init_subclass__

2021-02-18 Thread Erik Soma


Erik Soma  added the comment:

The CPython PR has gone stale waiting for core review, pinging this per the dev 
guide.

--

___
Python tracker 

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Mr. Stinner, in what way would int.bit_count() be beneficial to me?

I found https://www.chessprogramming.org/Population_Count when I investigated 
the C implementation of _Py_popcount32(), which is used by int.bit_count().

I read it when I tried to document this surprising code:
---
x = x - ((x >> 1) & 0x);
x = (x & 0x) + ((x >> 2) & 0x);
x = (x + (x >> 4)) & 0x0F0F0F0F;
return (uint32_t)((uint64_t)x * (uint64_t)0x01010101) >> 24;
---

I reformatted it as:
---
// 32-bit SWAR (SIMD Within A Register) popcount

// Binary: 0 1 0 1 ...
const uint32_t M1 = 0x;
// Binary: 00 11 00 11. ..
const uint32_t M2 = 0x;
// Binary:     ...
const uint32_t M4 = 0x0F0F0F0F;
// 256**4 + 256**3 + 256**2 + 256**1
const uint32_t SUM = 0x01010101;

// Put count of each 2 bits into those 2 bits
x = x - ((x >> 1) & M1);
// Put count of each 4 bits into those 4 bits
x = (x & M2) + ((x >> 2) & M2);
// Put count of each 8 bits into those 8 bits
x = (x + (x >> 4)) & M4;
// Sum of the 4 byte counts
return (uint32_t)((uint64_t)x * (uint64_t)SUM) >> 24;
---

--

___
Python tracker 

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

My hat off to you, Mr. Peters! Your suggestion (len(moves) + 1) // 2 works 
perfectly and is much more elegant than --0-- len(moves) // 2. :)

Mr. Stinner, in what way would int.bit_count() be beneficial to me?

--

___
Python tracker 

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



[issue2142] difflib.unified_diff(...) produces invalid patches

2021-02-18 Thread Dirkjan Ochtman


Change by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Anyway, my need for ceiling is that I am coding a chess GUI where I have a 
> table with 2 columns and I create a new row whenever White makes a move. So, 
> my implementation for row creation is math.ceil(len(moves) // 2) where moves 
> is a list of chess moves. 

You may like the new int.bit_count() attribute of Python 3.10 ;-)
https://docs.python.org/dev/library/stdtypes.html#int.bit_count

--

___
Python tracker 

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread Tim Peters


Tim Peters  added the comment:

(len(moves) + 1) // 2

--
nosy: +tim.peters

___
Python tracker 

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



[issue43257] get_type_hints evaluates class variables before type hints

2021-02-18 Thread Josue Balandrano Coronel


New submission from Josue Balandrano Coronel :

Using typing.get_type_hints() on classes returns the wrong value when a class 
variable has the same name as a type and a default value.

For instance:

from dataclasses import dataclass
from typing import get_type_hints

@dataclass
class DataClassHints:
str: str="asdf"

>>> get_type_hints(DataClassHints)
... NameError: name 'asdf' is not defined

Looks like get_type_hints() is using "asdf" as a type.
This is more clear if we use something like datetime:

from datetime import datetime

class ClassHints:
datetime: datetime=datetime.now()

>>> get_type_hints(ClassHints)
... {'datetime': datetime.datetime(2021, 2, 18, 12, 40, 16, 966502)

If we do the same thing in a method get_type_hints works correctly:

class CorrectHints:
def __init__(self, str: str="asdf", datetime: datetime=datetime.now()):
self.str = str
self.datetime = datetime

>>> ch = CorrectHints()
>>> ch.str
... 'asdf'

>>> ch.datetime
... datetime.datetime(2021, 2, 18, 12, 41, 46, 214844)

>>> get_type_hints(CorrectHints.__init__)
... {'str': str, 'datetime': datetime.datetime}

Also functions work correctly:
 
def func_type_hints(str: str="asdf", datetime: datetime=datetime.now()):
return f"str: {str}, datetime: {datetime}"


>>> func_type_hints()
... 'str: asdf, datetime: 2021-02-18 12:44:21.102933'

>>> get_type_hints(func_type_hints)
... {'str': str, 'datetime': datetime.datetime}

It looks like get_type_hints is evaluating the default value in a class 
variable before the type hint.
Here's another way to replicate this issue to make it clearer:

class EvalOrderHints:
datetime = datetime.now()
datetime: datetime

>>> get_type_hints(EvalOrderHints)
... {'datetime': datetime.datetime(2021, 2, 18, 12, 47, 56, 608261)}

>>> EvalOrderHints().datetime
... datetime.datetime(2021, 2, 18, 12, 47, 56, 608261)

--
messages: 387266
nosy: xirdneh
priority: normal
severity: normal
status: open
title: get_type_hints evaluates class variables before type hints
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue18163] Add a 'key' attribute to KeyError

2021-02-18 Thread Andre Roberge


Change by Andre Roberge :


--
nosy: +aroberge

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

> But I don't see the benefit of annoying and discouraging users who want to 
> experiment with Python and with Linux on Z in 31 bit mode.

Fully agree.

> Yes, maintenance theoretically is a burden, but there have been no recent 
> issues that were specific to Linux on Z in 31 bit mode.

As I have mentioned before, the Python interpreter in general has been very 
very unproblematic on any platform. The only real issue that I am aware of is 
that the testsuite can get stuck on machines with a large number of CPUs (we're 
seeing that on our SPARC T5 in Debian).

> In fact, most of the original Linux on Z support issues that I opened were 
> endianness issues, which aren't ameliorated by removing 31 bit support.

And there is still MIPS-BE, PPC-BE, M68k, HPPA among other which are all 
big-endian.

> As others have expressed, deprecating 31 bit mode only removes the 
> configuration option with no other code simplification.

Exactly my point. If it removed a considerable amount of code, I would actually 
see a point. But just removing a few lines of autoconf or preprocessor code 
makes no differences from a maintainer's point of view.

> It seems that it would be better to leave the configuration alone until there 
> actually was an unresolved issue that motivated removal.

Jepp, fully agree.

> But I am not aware of any client requirement to continue the support. 

Sure. But free software shouldn't be solely about commercial customers. If 
someone wants to play with Python on the s390 emulator Hercules, for example, 
upstream projects shouldn't be keeping them from doing that.

> Leaving the 31 bit configuration unchanged is more about maintaining good 
> will among the volunteers who are interested in the platform.

Absolutely. And about not limiting choices when there is no technical argument 
for it.

--

___
Python tracker 

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



Re: Python 2.7 and 3.9

2021-02-18 Thread Pieter van Oostrum
Ethan Furman  writes:

> On 2/16/21 12:09 PM, Kevin M. Wilson via Python-list wrote:
>
>> My employer has hundreds of scripts in 2.7, but I'm writing new
>> scripts in 3.9! I'm running into 'invalid syntax' errors.I have to
>> maintain the 'Legacy' stuff, and I need to mod the path et al., to
>> execute 3.7 w/o doing damage to the 'Legacy' stuff...IDEA' are
>> Welcome!
>
> My first idea/request: have a blank line, a line with only a '--'
> (without quotes), and then your signature at the bottom of your posts. 
> White space aids readability and readability counts.  :)

The separator line should be '-- ' (without quotes), i.e. with a trailing space.
-- 
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43255] Ceil division with /// operator

2021-02-18 Thread Boštjan Mejak

Boštjan Mejak  added the comment:

The spaceship operator is kinda cool! :)

Well, I was hoping to avoid importing the math module just to have ceil 
division capabilities.

Anyway, my need for ceiling is that I am coding a chess GUI where I have a 
table with 2 columns and I create a new row whenever White makes a move. So, my 
implementation for row creation is math.ceil(len(moves) // 2) where moves is a 
list of chess moves. 

So, the sequence of table rows after White and Black make their moves is 
initially 0 (since there are no moves yet) and then 1 (first row created after 
White made a move) and then 1 (again on row 1 after Black made a move, but on 
column 2), then 2 2 3 3 4 4 5 5 6 6 and so on.

If we had the ceil operator in Python, I could do: len(moves) /// 2 :)

By the way -- do you happen to know any better idea to get that kind of a 
sequence? That is 0 1 1 2 2 3 3 4 4 5 5 6 6 and so on.

--

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread Matej Cepl

Matej Cepl  added the comment:

> Do you actually know someone who is actively interested in the usecase of 
> building a 32 bit python on an s390x system? Or do you know someone who owns 
> an s390 system?

Well, yes, I have just got it confirmed from our PM, SUSE has living and 
breathing (and what’s even more interesting, paying) clients using SLE-12 on 
s390 (i.e., s390x kernel with 32bit libraries). Of course, it doesn’t mean they 
are eager to run Python 3.10 in such configuration (how do you call such 
package? python3a so that “python3a” > “python39”?), we will have to evaluate 
with them what are their plans in the post-36 world with the modern Python 
there.

--

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread David Edelsohn


David Edelsohn  added the comment:

Victor: https://en.wikipedia.org/wiki/31-bit_computing :-)

--

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread David Edelsohn


David Edelsohn  added the comment:

I am not aware of significant use of 31 bit mode.

But I don't see the benefit of annoying and discouraging users who want to 
experiment with Python and with Linux on Z in 31 bit mode.  Yes, maintenance 
theoretically is a burden, but there have been no recent issues that were 
specific to Linux on Z in 31 bit mode.  In fact, most of the original Linux on 
Z support issues that I opened were endianness issues, which aren't ameliorated 
by removing 31 bit support.  As others have expressed, deprecating 31 bit mode 
only removes the configuration option with no other code simplification.

It seems that it would be better to leave the configuration alone until there 
actually was an unresolved issue that motivated removal.  But I am not aware of 
any client requirement to continue the support.  Leaving the 31 bit 
configuration unchanged is more about maintaining good will among the 
volunteers who are interested in the platform.

--

___
Python tracker 

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



Re: Problem when scraping the 100 Movie titles.

2021-02-18 Thread Mats Wichmann

On 2/18/21 10:43 AM, Aakash Jana wrote:

I have done some webscraping before i think you need to get a slightly more
tactical way to get these titles scraped .
Try to see what classes identify the cards (in which movie title is given)
and then try to pull the heading out of those.
Try to get the divs in a list , something like this "" in my case and then try to
pull
the h3 tag out of it . Onething to note is react os single page heavy
webapps have seemed to be difficult to scrape maybe beautiful
isnt made for JSX .

On Thu, Feb 18, 2021 at 9:09 PM Bischoop  wrote:



I'm learning Scraping actually and would like to scrape the movie titles
from https://www.empireonline.com/movies/features/best-movies-2 .
In the course I was learning I was supposed to do it with bs4:


Just in general, most websites don't want you to scrape them, and some 
go to considerable efforts to make it difficult, and some explicitly 
disallow downloading any content except for caching purposes.  If the 
website provides an API, that's how they expect you go consume data that 
isn't render through a web browser.


Just sayin' ...  there's no reason not to learn the concepts of web 
scraping but should ALSO be aware of terms of use.


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


[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 44085a3fc9a150478aec1872dd1079c60dcc42f6 by Victor Stinner in 
branch 'master':
bpo-42990: Refactor _PyFrame_New_NoTrack() (GH-24566)
https://github.com/python/cpython/commit/44085a3fc9a150478aec1872dd1079c60dcc42f6


--

___
Python tracker 

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



[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread Gilles Duboscq


Gilles Duboscq  added the comment:

Thanks Victor we'll look into moving away from this pattern.

--

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure why people insists to say that it's 31 bit CPU, gcc-s390.txt shows 
that it uses a classic 32-bit ABI (32-bit long/size_t):

#define __SIZE_MAX__ 0xUL
#define __LONG_WIDTH__ 32

31-bit is a limit of the address space (memory), not the ALU.

--

___
Python tracker 

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



[issue42686] include built-in Math functions in SQLite to 3.35.0 of march 2021

2021-02-18 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



[issue18163] Add a 'key' attribute to KeyError

2021-02-18 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



Re: Fw: Scipy installation

2021-02-18 Thread Paul Bryan
Can you describe what you tried, and how it failed? Pasting error
messages and such would be helpful.

On Thu, 2021-02-18 at 17:53 +, Mustafa Althabit via Python-list
wrote:
>  
> 
>    Hi,I am trying to install Scipy but it failed, I have python
> 3.9. I need your assistance with that. 
> Thank you Mustafa Althabit8133825988  

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


[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

> For us it happens when using multiprocessing: the main process forks 2 
> processes and both use urlopen at roughly the same time. We are seeing this 
> on Python 3.7.2 on macOS 10.14.3.

>From what I understood, calling fork() (and then continue to execute regular 
>Python code) is no longer safe in macOS 10.14 and must no longer be used. Only 
>fork+exec is safe (spawn a new child process), but posix_spawn() is preferred 
>on macOS. But I'm not a macOS expert.

--

___
Python tracker 

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



Fw: Scipy installation

2021-02-18 Thread Mustafa Althabit via Python-list
 

   Hi,I am trying to install Scipy but it failed, I have python 3.9. I need 
your assistance with that. 
Thank you Mustafa Althabit8133825988  
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43115] locale.getlocale fails if locale is set

2021-02-18 Thread Eryk Sun


Eryk Sun  added the comment:

> The APIs were written at a time where locale modifiers 
> simply did mot exist. 

Technically, locale modifiers did exist circa 2000, but I suppose you mean that 
they were uncommon to the point of being unheard of at the time.

The modifier field was specified in the X/Open Portability Guide Issue 3 (XPG3) 
in 1989, and again in XPG4 in 1992 as 
"language[_territory][.codeset][@modifier]". I can't provide links to the 
specifications (they're not freely available), but here's a link to X/Open 
"Internationalisation Guide Version 2" (1993), which defines the modifier field 
in section 5.1.2 (pages 88-89):

https://pubs.opengroup.org/onlinepubs/009269599/toc.pdf

> Support could be added via a special locale tuple return
> object, which looks like 2-tuple, but comes with extra attributes
> to store the modifier

That's a good idea and worth implementing. But the _strptime and calendar 
modules have no need to call getlocale(LC_TIME). IMO, it adds fragility for no 
benefit. All they need to save is the result of setlocale(LC_TIME). 

Also, the default locale for calendar.LocaleTextCalendar has no need to use 
getdefaultlocale() instead of using an empty string, i.e. setlocale(LC_TIME, 
""). The latter is simpler and more reliable.

---

> support for Windows is only partial, due to the
> completely different approach Windows' CRT took to locales.

Using the same implementation for POSIX and Windows is needlessly complicated, 
and difficult to reason about how it behaves in all cases.

I suggest implementing separate versions of normalize() and _parse_localename() 
for Windows, making use of direct queries via _winapi.GetLocaleInfoEx() (to be 
added). 

The mapping in encodings.aliases also needs comprehensive coverage for Windows 
code pages (e.g. cp20127 -> ascii, cp28591 -> latin_1, etc). A poor match 
should not be aliased, such as code page 20932 and euc_JP. (For all 3-byte 
sequences in standard euc-JP, code page 20932 encodes 2-byte sequences by 
dropping the lead byte and masking the third byte as ASCII.)

If the locale string doesn't include a codeset, then normalize() shouldn't do 
anything to obtain one. It's not necessary in Windows. If there's a codeset, 
normalize() should ensure it's "UTF-8", "OCP", "ACP", or a Windows code page in 
the right form, e.g. "ascii" -> "20127". ucrt supports "ACP" and "OCP" codesets 
for the locale's ANSI and OEM code pages. These must be in uppercase, e.g. 
"hindi.acp" -> "hindi.ACP". ucrt will set the latter as "Hindi_India.utf8" 
(it's a Unicode-only locale), which should parse as ("Hindi_India", "UTF-8").

If the locale without the codeset isn't a valid Windows BCP-47 locale name, as 
determined by the NLS API, then normalize() should only care about 
case-insensitive normalization of "C" and "POSIX" as "C", e.g. "c" -> "C". No 
other normalization is necessary. ucrt supports case-insensitive 
"language[_country[.codepage]]" and ".codepage" forms, where language and 
country are either the full English names, LOCALE_SENGLISHLANGUAGENAME and 
LOCALE_SENGLISHCOUNTRYNAME, or 3-letter abbreviations, LOCALE_SABBREVLANGNAME 
and LOCALE_SABBREVCTRYNAME, such as "enu_USA". It also supports locale aliases 
such as "american[.codeset]". If the result isn't "C" or a BCP-47 locale name, 
ucrt setlocale() always returns the "language_country.codepage" form with full 
English names.

A BCP-47 locale name such as "en" or "en_US" cannot be used with a codeset 
other than UTF-8. If no codeset is specified, ucrt implicitly uses the locale's 
ANSI code page. 

If a BCP-47 locale name is paired with a codeset that's neither the given 
locale's ANSI codepage nor UTF-8, then normalize it to the 
"language_country.codepage" form. For example, "fr_FR.latin-1" -> 
"French_France.28591". Parse the latter as ("French_France", "ISO-8859-1"). 

If a BCP-47 locale name is paired with the locale's ANSI code page, then 
normalize it without the code page, e.g. "sr_Latn_RS.cp1250" -> "sr_Latn_RS". 
Look up the locale's ANSI code page when parsing the latter, e.g. "sr_Latn_RS" 
-> ("sr_Latn_RS", "cp1250"). 

If a BCP-47 locale name is paired with UTF-8, then there isn't much to do other 
than normalize the locale name and encoding name, e.g. "en_us.utf8" -> 
"en_US.UTF-8".

--

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread David Edelsohn


David Edelsohn  added the comment:

gcc -dM -E - < /dev/null

--
Added file: https://bugs.python.org/file49818/gcc-s390x.txt

___
Python tracker 

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



[issue43179] Remove 31/32-bit s390 Linux support (s390-linux-gnu triplet)

2021-02-18 Thread David Edelsohn


David Edelsohn  added the comment:

gcc -m31 -dM -E - < /dev/null

--
Added file: https://bugs.python.org/file49817/gcc-s390.txt

___
Python tracker 

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



[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

Oh wait, I removed that lock:

commit 0de437de6210c2b32b09d6c47a805b23d023bd59
Author: Victor Stinner 
Date:   Thu May 28 17:23:39 2020 +0200

bpo-25920: Remove socket.getaddrinfo() lock on macOS (GH-20177)

On macOS, socket.getaddrinfo() no longer uses an internal lock to
prevent race conditions when calling getaddrinfo(). getaddrinfo is
thread-safe is macOS 10.5, whereas Python 3.9 requires macOS 10.6 or
newer.

The lock was also used on FreeBSD older than 5.3, OpenBSD older than
201311 and NetBSD older than 4.

Please open a new issue specific to macOS: specify your macOS version, your 
Python version and how you installed or built Python.

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue2142] difflib.unified_diff(...) produces invalid patches

2021-02-18 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy:  -mark.dickinson

___
Python tracker 

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



[issue13433] [doc] Improve string format documentation regarding %g

2021-02-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

Closing; the documentation was updated recently. See #39096 for details.

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

___
Python tracker 

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



[issue42429] Behavior of general (%g, :g) formatting inconsistent for decimal.Decimal

2021-02-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

The documentation did get updates: see #39096 for details. Closing here.

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution: not a bug -> rejected

___
Python tracker 

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



[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread Gilles Duboscq


Gilles Duboscq  added the comment:

I get '0' so it was not built with HAVE_GETHOSTBYNAME_R.

--

___
Python tracker 

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



Re: Problem when scraping the 100 Movie titles.

2021-02-18 Thread Aakash Jana
I have done some webscraping before i think you need to get a slightly more
tactical way to get these titles scraped .
Try to see what classes identify the cards (in which movie title is given)
and then try to pull the heading out of those.
Try to get the divs in a list , something like this "" in my case and then try to
pull
the h3 tag out of it . Onething to note is react os single page heavy
webapps have seemed to be difficult to scrape maybe beautiful
isnt made for JSX .

On Thu, Feb 18, 2021 at 9:09 PM Bischoop  wrote:

>
> I'm learning Scraping actually and would like to scrape the movie titles
> from https://www.empireonline.com/movies/features/best-movies-2 .
> In the course I was learning I was supposed to do it with bs4:
> titles = soup.find_all(name = 'h3', class_ = 'title')
>
> but after after a while I guess the site has changed and now the class
> is: jsx-2692754980
>
> 100) Stand By Me
>
> but anyway if I do try get those titles by name and class, my list is
> empty:
> titles = soup.find_all(name = 'h3', class_ = 'jsx-2692754980')
>
> I tried also selenium and manage get those titles with:
> driver.get('https://www.empireonline.com/movies/features/best-movies-2')
>
> #driver.find_element_by_xpath('/html/body/div/div[3]/div[5]/button[2]').click()
>
> titles = driver.find_elements_by_css_selector("h3.jsx-2692754980")
>
> tit=[]
> for e in titles:
> tit.append(e.text)
>
> print(tit)
>
> But in Chrome I get a popup asking to accept cookies and I need to
> click to accept them.
>
> Is someone here who knows how can I get those titles with BeautifulSoup
> and how to deal with
> cookies if using Selenium?
>
> --
> Thanks
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

"Segmentation fault with (...) threads (...) getaddrinfo"

Aha, another victim on a getaddrinfo() implementation which is not thread safe.

See this code in Modules/socketmodule.c:

/* Lock to allow python interpreter to continue, but only allow one
   thread to be in gethostbyname or getaddrinfo */
#if defined(USE_GETHOSTBYNAME_LOCK)
static PyThread_type_lock netdb_lock;
#endif

Can you please check if your Python was built with HAVE_GETHOSTBYNAME_R?

$ python3
Python 3.9.1 (default, Jan 20 2021, 00:00:00) 
[GCC 10.2.1 20201125 (Red Hat 10.2.1-9)] on linux
>>> import sysconfig; repr(sysconfig.get_config_var('HAVE_GETHOSTBYNAME_R'))
'1'


Modules/socketmodule.c is full of #ifdef involving macOS...

--

___
Python tracker 

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



RE: New Python implementation

2021-02-18 Thread Avi Gross via Python-list
Dennis made the interesting comment "... Python has too much built in ..."

I understand his point. At the same time, I wonder what most people using
computers today, or in the future, need. Given serious amounts of computer
power, what many people may want is higher-level ways to get things done
without worrying how they are done. Python, like many such languages, has a
very basic core that is augmented by what could be libraries, packages,
modules and so on but have been chosen to be built-in to one distribution or
another.

Some people and organizations use some things so commonly, they want python
to start up automatically loading say numpy and pandas and other such
things. They may not care if the programmer knows how to make a linked list
or binary tree data structure. Many such details are encapsulated within
objects built and tested already. 

I have seen subjects taught at various levels and python might qualify too.
I took a Physics course that required Calculus and used it to derive
formulas and other things. Others took one that sort of threw equations at
you without much explanation. I have even seen a course called Physics for
Poets. But at least the poets taking it  knew science existed and perhaps to
take it seriously when others who had studied it better shared their
results, even if they have no interest in the methods.

We routinely have people learn how to use Word Processors or Spreadsheets
with no clue on how to build such a thing or anything about the Object
models used within or even knowing there is such a thing. Do they need to
know how to use the embedded methods to extend things with Visual Basic or
Javascript? They like getting closer to a WYSIWYG interface that handles
most of their usual needs and perhaps farm out harder things to experts when
needed.

So what if you teach some aspects of python that are needed all over, like
how to make things conditional or in a loop, but not how to make every
possible data structure. What if you deliberately do not teach functional
aspects of the language at first or ever? For some people that is enough to
enable them to then use additional instructions on how to find prepared and
tested chunks to use, even if not always optimally or efficiently. For those
who really want to be programmers, that still may actually be enough if
their task is to work using the tools we have developed, not in making new
tools from scratch. Quite a bit of programming today consists of reading
manual pages and cobbling together chunks that together do the job.

But obviously I would choose the classes where I understood more. Many here
would. But where does it end? Do most of us know how compilers or
interpreters get built or do we just work on top of existing implementations
others make available? Can you build an operating system from Scratch or
make microchips to run them on?

If the goal is Computer USE literacy, I think python has more than enough if
you include the modules that make hard things easy.

Just a thought. Admittedly it is hard these days to give a homework
assignment when the student can find a trivial way to get the result and not
do the hard work.


-Original Message-
From: Python-list  On
Behalf Of Dennis Lee Bieber
Sent: Thursday, February 18, 2021 12:45 AM
To: python-list@python.org
Subject: Re: New Python implementation

On Tue, 16 Feb 2021 11:03:33 +, Alan Gauld via Python-list
 declaimed the following:

>On 16/02/2021 07:35, Christian Gollwitzer wrote:
>> Am 16.02.21 um 06:36 schrieb dn:
>>> Pascal's value as a teaching language was that it embodied many 
>>> aspects of structured programming, and like Python, consisted of a 
>>> limited range of items which could be learned very quickly
>> 
>> ROFL. Maybe that was true for Python when it was first invented. 
>> Today it is not "a few simple things". Even just the core language,
>
>Python v1 was a good teaching language. v2 complicated it a bit but it 
>was still usable. v3 is no longer a good teaching language (unless 
>maybe you are teaching CompSci at university.)
>
>In fact in v3 things are so complex that I seriously considered 
>dropping Python as the core language for my programming tutorial.
>Until I started looking for an alternative, and there really isn't 
>anything much better. At least not that can also be used for real 
>projects once you've learned it.

Depending upon the course intentions, I'd say Python is useful for
teaching general programming and getting to usable real-world programs.

For CompSci /theory/, OTOH, Python has too much built in, and would
get in the way of having someone implement things like linked-lists, deques,
hashed structures -- ie; the stuff that lies behind all those Python
built-ins. Pascal, Modula-2 (or is it up to 3 now), or one of the other
system programming languages: Edison from
https://www.amazon.com/Programming-personal-computer-Brinch-Hansen/dp/013730
2673
Implement a hashed-head multiple-linked 

[issue43255] Ceil division with /// operator

2021-02-18 Thread Mark Dickinson


Mark Dickinson  added the comment:

I can't recall where I saw this originally, but you can use the spaceship 
operator "--0--" to turn floor division into ceiling division:

>>> 12//5
2
>>> --0-- 12//5
3

There's also the ++0++ operator when you want to emphasize that you really *do* 
mean floor division:

>>> ++0++ 12//5
2

But yes, -(-n // d) is the easy (if a little bit cryptic) way to get the 
ceiling of n / d.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue43249] sqlite3_column_bytes() should be called after sqlite3_column_blob()

2021-02-18 Thread Berker Peksag


Change by Berker Peksag :


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



[issue43249] sqlite3_column_bytes() should be called after sqlite3_column_blob()

2021-02-18 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset cc96231f0a59cc7393943064800ecb6c18892662 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43249: Improve scoping in _pysqlite_fetch_one_row() (GH-24565)
https://github.com/python/cpython/commit/cc96231f0a59cc7393943064800ecb6c18892662


--

___
Python tracker 

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



[issue39853] Segmentation fault with urllib.request.urlopen and threads

2021-02-18 Thread Gilles Duboscq


Gilles Duboscq  added the comment:

I'm not sure it's the same but we have seen stack traces looking like the one 
there: https://github.com/astropy/astropy/issues/9699

Current thread 0x7fffa857e3c0 (most recent call first):
  File "/sw/lib/python3.7/socket.py", line 748 in getaddrinfo
  File "/sw/lib/python3.7/socket.py", line 707 in create_connection
  File "/sw/lib/python3.7/http/client.py", line 938 in connect
  File "/sw/lib/python3.7/http/client.py", line 966 in send
  File "/sw/lib/python3.7/http/client.py", line 1026 in _send_output
  File "/sw/lib/python3.7/http/client.py", line 1247 in endheaders
  File "/sw/lib/python3.7/http/client.py", line 1298 in _send_request
  File "/sw/lib/python3.7/http/client.py", line 1252 in request

For us it happens when using multiprocessing: the main process forks 2 
processes and both use urlopen at roughly the same time. We are seeing this on 
Python 3.7.2 on macOS 10.14.3.

--
nosy: +gilles-duboscq

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

> You say it's on purpose, what's the purpose? Aren't you worried this is going 
> to break stuff?

There is a subtle behavior difference between Python 3.9 and Python 3.10. 
func_builtins2.py of bpo-43228 works on Python 3.9 but fails on Python 3.10. 
With my PR 24564, func_builtins2.py works again on Python 3.10.

See bpo-43228 for the details.

> And why is this necessary given the LOAD_GLOBAL cache?

My PR 24564 is not related to LOAD_GLOBAL, but how a frame fills its f_builtins 
member from a function.

LOAD_GLOBAL uses f_globals and f_builtins members of a frame.

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

Victor
> the new globals has no "__builtins__" key. This change is backward 
> incompatible on purpose. If someone really wants to run a function in a 
> different builtins namespace, globals['__builtins__'] must be set explicitly.

You say it's on purpose, what's the purpose? Aren't you worried this is going 
to break stuff? And why is this necessary given the LOAD_GLOBAL cache?

Yury
> this hypothetical LEN opcode would still have to check if "len" was shadowed 
> or not, and that's slower than the optimized LOAD_GLOBAL we have now.

It could use the same check though? Just check the version tags.

--

___
Python tracker 

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



[issue43249] sqlite3_column_bytes() should be called after sqlite3_column_blob()

2021-02-18 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +23346
pull_request: https://github.com/python/cpython/pull/24565

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread Yury Selivanov


Yury Selivanov  added the comment:

> So you think that even a dedicated "LEN" opcode would not be any faster? 
> (This is getting in Paul Sokolovsky territory -- IIRC he has a variant of 
> Python that doesn't allow overriding builtins.)

Yeah, a dedicated LEN opcode could only be faster if it would not be possible 
to shadow builtins (or if there was a "len" operator in Python).  If that's not 
the case, this hypothetical LEN opcode would still have to check if "len" was 
shadowed or not, and that's slower than the optimized LOAD_GLOBAL we have now.

--

___
Python tracker 

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



[issue28429] ctypes fails to import with grsecurity's TPE

2021-02-18 Thread Petr Viktorin


Petr Viktorin  added the comment:

Glandos, thank you for the report and fix, and apologies that it wasn't seen by 
the right set of eyes.

--
nosy: +petr.viktorin
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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2021-02-18 Thread Emmanuel Arias


Change by Emmanuel Arias :


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

___
Python tracker 

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



[issue43249] sqlite3_column_bytes() should be called after sqlite3_column_blob()

2021-02-18 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 47feb1feb28631b6647699b7633109aa85340966 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43249: sqlite3_column_bytes() must follow sqlite_column_blob() (GH-24562)
https://github.com/python/cpython/commit/47feb1feb28631b6647699b7633109aa85340966


--

___
Python tracker 

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



Problem when scraping the 100 Movie titles.

2021-02-18 Thread Bischoop


I'm learning Scraping actually and would like to scrape the movie titles
from https://www.empireonline.com/movies/features/best-movies-2 . 
In the course I was learning I was supposed to do it with bs4:
titles = soup.find_all(name = 'h3', class_ = 'title')

but after after a while I guess the site has changed and now the class
is: jsx-2692754980

100) Stand By Me

but anyway if I do try get those titles by name and class, my list is
empty:
titles = soup.find_all(name = 'h3', class_ = 'jsx-2692754980')

I tried also selenium and manage get those titles with:
driver.get('https://www.empireonline.com/movies/features/best-movies-2')
#driver.find_element_by_xpath('/html/body/div/div[3]/div[5]/button[2]').click()

titles = driver.find_elements_by_css_selector("h3.jsx-2692754980")

tit=[]
for e in titles:
tit.append(e.text)

print(tit)

But in Chrome I get a popup asking to accept cookies and I need to
click to accept them.

Is someone here who knows how can I get those titles with BeautifulSoup and how 
to deal with
cookies if using Selenium?

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


[issue42960] resources module, FreeBSD update adding RLIMIT_KQUEUES constant

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks David, I merged your PR.

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

___
Python tracker 

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



EuroPython 2021: Volunteering

2021-02-18 Thread M.-A. Lemburg
The EuroPython 2021 organization is starting and we're looking for more
help with running the conference.

 * EuroPython 2021 *

   https://ep2021.europython.eu/

For EP2021, we are using a slightly different approach compared to
previous years:

- All new volunteers will first join the Plaza – our central
get-together place for all team members – and only later enter the
various work groups (WGs) we have for running the conference.

- Additionally, we will have on-boarding calls with everyone to get to
know each other and give an overview to the structures, information and
groups we have available, as well as the timeline.

If you are interested in helping, please write to
volunte...@europython.eu. Our team will then answer any questions you
may have and get you signed up for the next on-boarding call.


Help spread the word


Please help us spread this message by sharing it on your social
networks as widely as possible. Thank you !

Link to the blog post:

https://blog.europython.eu/europytho-2021-volunteerng/

Tweet:

https://twitter.com/europython/status/1362416745814888451


Enjoy,
--
EuroPython 2021 Team
https://www.europython-society.org/
___
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


[issue42960] resources module, FreeBSD update adding RLIMIT_KQUEUES constant

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7be00ee64a2ced73c00ec855c7265e2ba795213d by David CARLIER in 
branch 'master':
bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251)
https://github.com/python/cpython/commit/7be00ee64a2ced73c00ec855c7265e2ba795213d


--
nosy: +vstinner

___
Python tracker 

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



EuroPython 2021: Volunteering

2021-02-18 Thread M.-A. Lemburg
The EuroPython 2021 organization is starting and we're looking for more
help with running the conference.

 * EuroPython 2021 *

   https://ep2021.europython.eu/

For EP2021, we are using a slightly different approach compared to
previous years:

- All new volunteers will first join the Plaza – our central
get-together place for all team members – and only later enter the
various work groups (WGs) we have for running the conference.

- Additionally, we will have on-boarding calls with everyone to get to
know each other and give an overview to the structures, information and
groups we have available, as well as the timeline.

If you are interested in helping, please write to
volunte...@europython.eu. Our team will then answer any questions you
may have and get you signed up for the next on-boarding call.


Help spread the word


Please help us spread this message by sharing it on your social
networks as widely as possible. Thank you !

Link to the blog post:

https://blog.europython.eu/europytho-2021-volunteerng/

Tweet:

https://twitter.com/europython/status/1362416745814888451


Enjoy,
--
EuroPython 2021 Team
https://www.europython-society.org/

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


[issue43253] asyncio open_connection fails when a socket is explicitly closed

2021-02-18 Thread Daniel Engel


Daniel Engel  added the comment:

It reproduced on a windows machine

--

___
Python tracker 

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not convinced that this operation is so common that it deserves a new 
operator. As Serhiy wrote, it must be first on python-ideas first. I close the 
issue.

--

floor division is x//y

integer ceil division can be implemented with math.ceil(x/y) for small numbers.

For large integer numbers, I like to use something like:

def ceil_div(x, y):
rem=x % y
if rem:
x += y - rem
return x//y

I let you adjust it for negative numbers ;-)

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Since adding new operator is a syntax-level change, it needs a PEP. It is 
better to start with discussing on the Python-ideas mailing list 
(https://mail.python.org/mailman3/lists/python-ideas.python.org/). Let's see if 
this idea will be accepted favorably.

BTW, the ceiling division can be expressed as -(-a // b) or -(a // -b).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2021-02-18 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

I cannot reproduce on a Debian machine. Seems to be a Windows component issue?

--
nosy: +eamanu

___
Python tracker 

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



[issue43256] Document that PyErr_SetInterrupt is async-signal-safe

2021-02-18 Thread Antoine Pitrou


New submission from Antoine Pitrou :

While this makes sense given the exposed functionality, the reader may be wary 
of calling PyErr_SetInterrupt from a C signal handler if it's not explicitly 
documented as signal-safe.

--
assignee: docs@python
components: C API, Documentation
messages: 387234
nosy: docs@python, pablogsal, pitrou, vstinner
priority: low
severity: normal
status: open
title: Document that PyErr_SetInterrupt is async-signal-safe
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread STINNER Victor


Change by STINNER Victor :


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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue since there is bpo-43228 regression, caused by this issue, 
which is still under discussion, and Mark also proposed to add a new builtins 
parameter to the function constructor (FunctionType).

I wrote PR 24564 to help fixing bpo-43228 regression: with this change, 
functions now inherit the current builtins if the globals namespace is 
overriden, but the new globals has no "__builtins__" key. This change is 
backward incompatible on purpose. If someone really wants to run a function in 
a different builtins namespace, globals['__builtins__'] must be set explicitly.

Once PR 24564 will be merged, I plan to write a 3rd PR to add an optional 
builtins keyword-only parameter to the function constructor (FunctionType).

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

___
Python tracker 

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



[issue43228] Regression in function builtins

2021-02-18 Thread STINNER Victor


STINNER Victor  added the comment:

I proposed PR 24564: "bpo-42990: Functions inherit current builtins" which 
should also to fix cloudpickle.

--

___
Python tracker 

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



[issue42990] Improve the C code for calling Python code: _PyEval_EvalCode()

2021-02-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23345
pull_request: https://github.com/python/cpython/pull/24564

___
Python tracker 

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



[issue43255] Ceil division with /// operator

2021-02-18 Thread Boštjan Mejak

New submission from Boštjan Mejak :

I hope I'm not too late for a Python 3.10 feature request. I love the fact that 
Python 3.x does floor division with the // operator.

We, however, don't have a ceil division operator, besides importing the math 
module and using its math.ceil() function.

Is it possible we have /// as a ceil division operator in Python 3.10?

I just wanted to put this thought out of my head if anyone becomes entertained 
by this idea.

--
components: Library (Lib)
messages: 387231
nosy: PedanticHacker, gvanrossum, rhettinger
priority: normal
severity: normal
status: open
title: Ceil division with /// operator
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue43254] Fix *snprintf() man page links

2021-02-18 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Both snprintf and vsnprintf belong to man section 3 (library functions), not 
section 2 (system calls).

Affected doc page: https://docs.python.org/3.10/c-api/conversion.html

--
assignee: docs@python
components: Documentation
messages: 387230
nosy: docs@python, erlendaasland
priority: normal
severity: normal
status: open
title: Fix *snprintf() man page links
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue40077] Convert static types to heap types: use PyType_FromSpec()

2021-02-18 Thread Nicholas Sim


Change by Nicholas Sim :


--
nosy: +nw0

___
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-02-18 Thread Petr Viktorin


Petr Viktorin  added the comment:

PEP 652 is currently draft & it's discussed at 
https://discuss.python.org/t/pep-652-maintaining-the-stable-abi/6986

--

___
Python tracker 

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



[issue43253] asyncio open_connection fails when a socket is explicitly closed

2021-02-18 Thread Daniel Engel


New submission from Daniel Engel :

Python 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit 
(AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import socket
   ...: s1, s2 = socket.socketpair()
   ...: import asyncio
   ...: async def test():
   ...: r1, w1 = await asyncio.open_connection(sock=s1)
   ...: r2, w2 = await asyncio.open_connection(sock=s2)
   ...: s1.close()
   ...: asyncio.run(test())
Exception in callback 
_ProactorBasePipeTransport._call_connection_lost(ConnectionAbo...e, 1236, None))
handle: 
Traceback (most recent call last):
  File "c:\python39\lib\asyncio\events.py", line 80, in _run
self._context.run(self._callback, *self._args)
  File "c:\python39\lib\asyncio\proactor_events.py", line 162, in 
_call_connection_lost
self._sock.shutdown(socket.SHUT_RDWR)
OSError: [WinError 10038] An operation was attempted on something that is not a 
socket

--
components: asyncio
messages: 387228
nosy: asvetlov, danielen1337, yselivanov
priority: normal
severity: normal
status: open
title: asyncio open_connection fails when a socket is explicitly closed
versions: Python 3.9

___
Python tracker 

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



  1   2   >