Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-16 Thread Jach Feng
Kushal Kumaran 在 2021年2月17日 星期三下午12:11:04 [UTC+8] 的信中寫道:
> On Tue, Feb 16 2021 at 07:24:30 PM, Jach Feng  wrote: 
> > I am experimenting with multithreading-socket these days. I build a 
> > server to handle each client in a separate thread. All are running on 
> > my local PC. It works fine except the listen() method. 
> > 
> > I set listen(2) and expect to see "error" when more clients than "the 
> > maximum number of queued connections" trying to connect the 
> > server. But, no error!! Even 4 clients can run normally without 
> > problem. 
> > 
> > Am I misunderstanding the meaning of this argument? 
> >
> The argument to listen specifies the maximum number of "outstanding" 
> connection requests. These are connections for which the TCP handshake 
> has completed, but for which the application has not called accept. 
> With your multi-threaded application, I assume each new connection 
> request gets picked up immediately by an accept call, so the queue does 
> not generally grow. 
> 
> If you want a limit on the number of concurrent clients you want to 
> handle, you'll have to implement that yourself. If you're using the 
> threading module, threading.Semaphore will let you implement a simple 
> system. 
> 
> -- 
> regards, 
> kushal

You are right! I do misunderstand its meaning:-(

After the server accepts the 1st connection and paused temperately, I saw the 
2nd and 3rd connection is in pending, and the 4th one was rejected immediately.

Thank you (and Jason) for clarifying this mystery:-)

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


School Python

2021-02-16 Thread Avi Gross via Python-list
I wonder if someone has come up with a sort of Python environment that lets 
kids play with more fundamental parts of the language that lets them get 
educated without the confusion. I mean a limited subset and with some 
additions/modifications.

Someone mentioned how something like range(1,10) is confusing as it now not 
only does not produce a list on 1 to 9 or 1 to 10 but produces an object that 
only can be viewed well by doing more advanced things like iterating it.

So why not have a module called something like EDUCATION which is loaded into 
the school version automagically and implements what you want. Make a function 
called SchoolTimeRANGE strange(here, there)  (or whatever) that returns 
something like list( range(here, there)) so the student never sees a range 
object or yet knows there are objects to object to. If you want it to include 
the last item, include "there". Want it to start at 0 or 1, do that.

As I see it, really limited languages make you work hard. Some of the LISP 
variants I used ages ago were so damn simple that you had programs largely 
consisting of combinations of CAR and CDR so dealing with some nested list data 
structure was painful enough that people had functions with name like CDDADAR 
to access some particular part. The same goes for various simple and limited 
languages that can do anything but won't keep a student in a room. Python is 
not limited and should not be but it should be taught progressively so basic 
computer concepts are learned before you learn arguably better ways. A 
beautiful thing about a list is it can be reused. Something with an iterator 
control can mysteriously be drained.

So what is wrong with much of basic python, especially slightly extended? Feel 
free to tell them to use, strange() above for now as it lets them see what is 
happening step by step and mention that LATER they can (or must) switch to 
other functions normally used that may be more efficient or general.

What I like about good parts of Python and that makes it good for teaching is 
that much can be written in almost normal English. Do you even need to use 
range(1,6) when you can ask the students to just type:

numbers = [ 1, 2, 3, 4, 5 ]
for index in numbers:
  ...

Yes, later, introduce ways to loop from 1 to N by using better methods. List 
comprehensions? Why introduce them at all as most other languages do not have 
them and they are just syntactic sugar.  

If the goal is to introduce children to simple algorithms, keep them simple. 
Forget elegance or efficiency or being pythonic. But past a certain point, when 
they are ready, sure, add more. At some point it is helpful to learn that 
instead of keeping multiple arrays or variables in parallel, you could capture 
them in one object and tell the object what to do with itself and so on. Maybe 
later, show some tricks with functional programming. But don't START with 
elegant recursion methods.

I see no major barrier to teaching using python for children who can handle 
indentation  albeit they still have to learn to balance parentheses and quotes 
(sometimes) and brackets and braces ...

What I think is good is that they can practice in front of an interpreter and 
get immediate results, not like I did with index cards that were handed in and 
returned a day later, or having to wait a long time for a compile to complete, 
with errors.



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


[issue43240] IDLE Classic Unix keyboard shortcuts broken

2021-02-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

IDLE just tells tcl/tk via tkinter what function to call when particular UI 
events happen.  Recognizing UI events is handled between the OS window manager 
and tcl/tk. So I am sure this is not an IDLE issue.

For another application to affect the Linux-tcl interaction is new to me.  
Serhiy, have you ever heard of such a thing, or seen it happen?

--
nosy: +serhiy.storchaka
resolution:  -> third party
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



Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-16 Thread Kushal Kumaran
On Tue, Feb 16 2021 at 07:24:30 PM, Jach Feng  wrote:
> I am experimenting with multithreading-socket these days. I build a
> server to handle each client in a separate thread. All are running on
> my local PC. It works fine except the listen() method.
>
> I set listen(2) and expect to see "error" when more clients than "the
> maximum number of queued connections" trying to connect the
> server. But, no error!! Even 4 clients can run normally without
> problem.
>
> Am I misunderstanding the meaning of this argument?
>

The argument to listen specifies the maximum number of "outstanding"
connection requests.  These are connections for which the TCP handshake
has completed, but for which the application has not called accept.
With your multi-threaded application, I assume each new connection
request gets picked up immediately by an accept call, so the queue does
not generally grow.

If you want a limit on the number of concurrent clients you want to
handle, you'll have to implement that yourself.  If you're using the
threading module, threading.Semaphore will let you implement a simple
system.

-- 
regards,
kushal
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-16 Thread Jason Friedman
>
> I set listen(2) and expect to see "error" when more clients than "the
> maximum number of queued connections" trying to connect the server. But, no
> error!! Even 4 clients can run normally without problem.
>
> Am I misunderstanding the meaning of this argument?
>

https://docs.python.org/3/library/socket.html#socket.socket.listen:
Enable a server to accept connections. If backlog is specified ... it
specifies the number of unaccepted connections that the system will allow
before refusing new connections.

So I read that to say that the listen method will accept as many connection
as it can handle, and will put into a backlog those it cannot. Your
argument of 2 tells the method to allow up to 2 not-yet-accepted connection
requests.
-- 
https://mail.python.org/mailman/listinfo/python-list


What's the meaning the "backlog" in the socket.listen(backlog) is?

2021-02-16 Thread Jach Feng
I am experimenting with multithreading-socket these days. I build a server to 
handle each client in a separate thread. All are running on my local PC. It 
works fine except the listen() method.

I set listen(2) and expect to see "error" when more clients than "the maximum 
number of queued connections" trying to connect the server. But, no error!! 
Even 4 clients can run normally without problem.

Am I misunderstanding the meaning of this argument?

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


Re: New Python implementation

2021-02-16 Thread Abdur-Rahmaan Janhangeer
Greetings,

age: After university to retirement
level: school, A Level is high school, not university
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-16 Thread Igor Korot
Hi,



On Tue, Feb 16, 2021, 8:15 PM Abdur-Rahmaan Janhangeer 
wrote:

> Greetings list,
>
> > Even if Python is my choice language for personal projects, I am not
> certain it
> is the right language to use in a classroom context.
>
> This sums the view of most teachers in my country. In here for A level
> at Cambridge for Computer Studies you can choose either Java, or VB or
> Python
>
> The teachers' logic seems to tell them that VB is the simplest of all and
> more fitted for students. Since we organise the local Python usergroup
> ,
> we have been encouraging the adoption of Python. This happens from
> experience when teachers think for students, they think student will think
> like that etc
>

How old are the teachers?
And is it for school or university?


Thank you.


> The way schools examinations are set up, learning  programming is a bore.
> Programming requires experimentation and projects. The students must be
> permitted to explore the wide deep sea that is Python. On one of my
> projects
> on Github, i have a toy language, someone from Slovakia (14 years old)
> built
> an IDE for it, what was needed was only guidance where he was stuck.
>
> The hurdle with Python if any is the setting up and getting the command
> 'python'
> to appear in the terminal, which is very easy to get up and running
> nowadays.
>
> When i was in high school, i did not take Computer Studies, but was
> learning programming
> on my own, including Python. The irony is that my friends who were learning
> Python
> got disgusted with it. Loops and functions turned out to be hard for them.
> That's because
> learning for the exam makes you learn the language close to theory. Some
> commandline
> stuffs and some numbers stuffs surely is not exiting. Mastery comes with
> projects, exciting ones.
> Then whatever the syllabus requires becomes easy. It's a means to an end
> rather than the end
> in itself.
>
> The teachers' reaction is a reaction to the design of the syllabus. The
> folks seem to think that let's
> water it down to a very theoretical approach, strike out practise, strike
> out the fun out of it and
> sure the students will find it easier. Since effort is disliked by humans,
> less effort in learning programming
> will make students happy.
>
> Then, if it was no Python at that time, it might be no Python for life.
> With that mindset ongoing,
> those students think they know Python, they studied it, but they missed the
> whole thing. Forest,
> trees and leaves. They know only the color of the sign board leading to the
> place.
>
> Kind Regards,
>
> Abdur-Rahmaan Janhangeer
> about  | blog
> 
> github 
> Mauritius
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
> Also mind
> http://www.dalkescientific.com/writings/diary/archive/2009/03/27/python_0_9_1p1.html
> for result comparison.

Thanks, Paul. I had lost track of Andrew. Good to know he's still out
there. I wonder why his tar file was never sucked up into the
historical releases page.

Whew! My stupid little extraction script did a reasonable job. I see
plenty of differences, but a cursory examination shows they are only
in leading whitespace. Where I translated "\t" to TAB, it seems Andrew
used a suitable number of spaces. Python modules/scripts seem more
plausibly indented, and the couple I tried worked, so I'm a bit more
confident I have things right:

% PYTHONPATH=lib ./src/python
>>> import string
>>> print string.upper('hello world!')
HELLO WORLD!
>>>
% ./src/python lib/fact.py
9
[3, 3, 41, 271]
4096
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

The tests don't pass though. 1 * 1 raises an integer overflow exception:

>>> 1 * 1
Unhandled exception: run-time error: integer overflow
Stack backtrace (innermost last):
  File "", line 1

I'll let someone figure that out. :-)

At any rate, the git repo has been updated.

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


Re: New Python implementation

2021-02-16 Thread Abdur-Rahmaan Janhangeer
Greetings list,

> Even if Python is my choice language for personal projects, I am not
certain it
is the right language to use in a classroom context.

This sums the view of most teachers in my country. In here for A level
at Cambridge for Computer Studies you can choose either Java, or VB or
Python

The teachers' logic seems to tell them that VB is the simplest of all and
more fitted for students. Since we organise the local Python usergroup
,
we have been encouraging the adoption of Python. This happens from
experience when teachers think for students, they think student will think
like that etc

The way schools examinations are set up, learning  programming is a bore.
Programming requires experimentation and projects. The students must be
permitted to explore the wide deep sea that is Python. On one of my projects
on Github, i have a toy language, someone from Slovakia (14 years old)
built
an IDE for it, what was needed was only guidance where he was stuck.

The hurdle with Python if any is the setting up and getting the command
'python'
to appear in the terminal, which is very easy to get up and running
nowadays.

When i was in high school, i did not take Computer Studies, but was
learning programming
on my own, including Python. The irony is that my friends who were learning
Python
got disgusted with it. Loops and functions turned out to be hard for them.
That's because
learning for the exam makes you learn the language close to theory. Some
commandline
stuffs and some numbers stuffs surely is not exiting. Mastery comes with
projects, exciting ones.
Then whatever the syllabus requires becomes easy. It's a means to an end
rather than the end
in itself.

The teachers' reaction is a reaction to the design of the syllabus. The
folks seem to think that let's
water it down to a very theoretical approach, strike out practise, strike
out the fun out of it and
sure the students will find it easier. Since effort is disliked by humans,
less effort in learning programming
will make students happy.

Then, if it was no Python at that time, it might be no Python for life.
With that mindset ongoing,
those students think they know Python, they studied it, but they missed the
whole thing. Forest,
trees and leaves. They know only the color of the sign board leading to the
place.

Kind Regards,

Abdur-Rahmaan Janhangeer
about  | blog

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


[issue43219] shutil.copy raises IsADirectoryError when the directory does not actually exist

2021-02-16 Thread Eryk Sun


Eryk Sun  added the comment:

I left this open in case someone wants to modify shutil.copy() and 
shutil.copy2() to raise a less misleading exception when `dst` names a 
non-existing directory such as 'not_a_dir/'. Failing with IsADirectoryError 
(errno EISDIR) is confusing since shutil.copy() and shutil.copy2() do support a 
destination directory.

Note that in Windows this case fails with EINVAL, which is at least less 
misleading than EISDIR. The EINVAL error is based on WinAPI ERROR_INVALID_NAME 
(123). CreateFileW() can create a directory if passed particular parameters, in 
which case a trailing slash is allowed. Otherwise it fails with 
ERROR_INVALID_NAME (123), unless it's an open-existing disposition, in which 
case it fails with ERROR_FILE_NOT_FOUND (2). This is specified in [MS-FSA] 
2.1.5.1 [1]:

Phase 6 -- Location of file (final path component):

Search ParentFile.DirectoryList for a Link where Link.Name or
Link.ShortName matches FileNameToOpen. If such a link is found:

Set File = Link.File.
Set Open.File to File.
Set Open.Link to Link.

Else:

If (CreateDisposition == FILE_OPEN || CreateDisposition ==
FILE_OVERWRITE), the operation MUST be failed with
STATUS_OBJECT_NAME_NOT_FOUND.

Phase 7 -- Type of stream to open:

If PathName contains a trailing backslash:

If StreamTypeToOpen is DataStream or
CreateOptions.FILE_NON_DIRECTORY_FILE is TRUE, the operation
MUST be failed with STATUS_OBJECT_NAME_INVALID.

NTAPI STATUS_OBJECT_NAME_NOT_FOUND and STATUS_OBJECT_NAME_INVALID map to WinAPI 
ERROR_FILE_NOT_FOUND and ERROR_INVALID_NAME.

---
[1] 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/8ada5fbe-db4e-49fd-aef6-20d54b748e40

--
components: +Library (Lib)
type:  -> behavior
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
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-16 Thread Skip Montanaro
> If someone knows how to get the original Usenet messages from what Google 
> published, let me know.

Seems the original shar is there buried in a Javascript string toward
the end of the file. I think I've got a handle on it, though it will
take a Python script to massage back into correct format.

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


Re: Best practices for software architecture in Python

2021-02-16 Thread Peter J. Holzer
On 2021-02-11 08:54:11 -0500, Henning Follmann wrote:
> On 2021-02-11, Oscar  wrote:
> > In article ,
> > Henning Follmann   wrote:
> >>On 2021-02-10, Python  wrote:
> >>> and would like to study in-depth an existing open source
> >>> application in order to study how to organize classes hierarchy,
> >>> modules, packages, etc. which one would you recommend ?
> >>
> >>Looks like you (the project leader?) needs training, not the 
> >>software engineers.
> >>
> >>"Making Things Happen" by Scott Berkun
> >
> > This looks like a very interesting book to add to my reading list, but
> > how do you think it will help the OP with his/her quest?
> >
> Well the question makes it very obvious that it is a leadership
> issue. Does he really think giving all engineers the Gang of 4
> book will magically lead to a well run OOP project.

Actually he was asking for "an existing open source application", not a
book.

I think dissecting a non-trivial open source project over the course of
a semester would be a great idea for a university course (sort of like
Tananbaum did with Minix).

I'm not at all convinced that it's a good idea for the OP's team. While
reading other people's code is certainly useful for picking up patterns
and idiomatic style, it is much less clear that you get why the author
structured the code this way and how to structure it for your own
project. At the very least this would require a lot of discussion in the
team (basically a code review), especially if the code in question
doesn't have anything to do with your own project.

A book or a course is probably better to pick up the basics.

One important question is whether there already is someone on the team
who is already an experienced OO programmer (and who can therefore take
the technical lead, coach their team-mates, etc.) or whether all of them
have the same (lack of) experience.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Skip Montanaro
>
> Wow. Was white-space not significant in this release of Python? I see the
>> lack of indentation in the first Python programs.
>>
>
> Indentation most certainly was significant from day 0. I suspect what
> happened is that these files got busted somehow by the extraction process
> used by Skip or Hiromi.
>

Yes, that's certainly possible. While it's nice that Google has archived
this stuff, their faithfulness to the original formats leaves a bit to be
desired (and gmane still doesn't work for me, eliminating that option). Guido's
messages are displayed as HTML, and I saw no way to get at the raw Usenet
messages. I just copied the shar data and saved the result. It seems clear
that tabs copied as spaces. The Makefile indentation was hosed up. It
should have dawned on me that the .py, .c and .h files would be messed up
as well. I was only concerned with building the interpreter.

If someone knows how to get the original Usenet messages from what Google
published, let me know.

Skip

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


[issue43155] PyCMethod_New not defined in python3.lib

2021-02-16 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +23336
pull_request: https://github.com/python/cpython/pull/24554

___
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-16 Thread Peter J. Holzer
On 2021-02-14 00:52:43 +, Alan Gauld via Python-list wrote:
> On 14/02/2021 00:07, Mr Flibble wrote:
> > The neos Python implementation will not be dealing 
> > with Python byte code in any form whatsoever.
> 
> Ok  but what do you do with the disassembler module?

What do PyPy, Jython, IronPython etc. do with the disassembler module?
My guess is that they simply don't implement it. It's tightly coupled to
the CPython implementation and useless on any other implementation. A
disassembler module for their respective bytecode or machine language
might be useful, but that wouldn't be compatible with CPython's
disassembler in input nor output.

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Python-Dev] Re: Python 0.9.1

2021-02-16 Thread Guido van Rossum
On Tue, Feb 16, 2021 at 2:59 PM Senthil Kumaran  wrote:

> On Tue, Feb 16, 2021 at 1:58 PM Skip Montanaro 
> wrote:
>
>>
>> I then pushed the result to a Github repo:
>>
>> https://github.com/smontanaro/python-0.9.1
>>
>
> Wow. Was white-space not significant in this release of Python? I see the
> lack of indentation in the first Python programs.
>

Indentation most certainly was significant from day 0. I suspect what
happened is that these files got busted somehow by the extraction process
used by Skip or Hiromi.

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

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


Re: [Python-Dev] Python 0.9.1

2021-02-16 Thread Mats Wichmann

On 2/16/21 3:44 PM, Guido van Rossum wrote:

Awesome, Skip!

Was there a date somewhere? I can't recall if this would have been the
first open source release (from just about 30 years ago, sometime in
February 1991) or some time later in the same year?


Guido van Rossum
unread,
Python 0.9.1 part 01/21
XThis is Python, an extensible interpreted programming language that 
Xcombines remarkable power with very clear syntax. X XThis is version 
0.9 (the first beta release), patchlevel

2/19/91
--
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-16 Thread Roel Schroeven

Christian Gollwitzer schreef op 16/02/2021 om 8:25:

Am 15.02.21 um 21:37 schrieb Roel Schroeven:


So your claim is that your compiler is able to, or will be able to,
compile any language just by specifying a small schema file. Great!

Do you maybe have a proof-of-concept? A simple language with a simple
schema file to test the basic workings of your compiler,


Here is the git repo:

https://github.com/i42output/neos

under languages/ you'll find different schema files.


I saw that, and I saw the schema files. I had a look at the one for C, 
because I don't know the first thing about Ada, and it's not nearly 
enough to describe even the tiniest subset of C. And I saw the example 
session he posted here, where he supposedly compiles something, but 
doesn't even run it. It looked like that compilation did nothing but 
folding and folding and folding. And he didn't run it!


So it looks like that's the status of the project now: a compilation 
step that does /something/, but apparently doesn't result in anything 
runnable. And some work-in-progress (seemingly) schema files, but 
nothing concrete yet.


But I wanted to give Mr Flibble to benefit of the doubt, and asked more 
explicitly about the status of the project. Apparently I was too late, 
Mr Flibble was already banned, but I didn't know that yet.


I've thougt about downloading the whole thing and trying to build it. 
But I'd have to install Visual Studio 2019 first and probably some 
dependencies. It didn't seem worth the effort.



Regards,
Roel

--
"Honest criticism is hard to take, particularly from a relative, a
friend, an acquaintance, or a stranger."
-- Franklin P. Jones

Roel Schroeven

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


Re: Python 2.7 and 3.9

2021-02-16 Thread Richard Damon
On 2/16/21 4:16 PM, Ethan Furman wrote:
> Kevin, please reply to the list (preferably Reply-to-list, or
> Reply-all), that way others can chime in with help.
>
> On 2/16/21 12:55 PM, Kevin M. Wilson wrote:
>
>> Windows 7 OS, and typically run in conjunction with testing SSD', as
>> for stand alone scripts.
>> Those require: python BogusFile.py. I too was expecting users to
>> type: python my_Script.py!
>
> I'm afraid I have no experience with the above, hopefully somebody
> else on the list does.
>
> -- 
> ~Ethan~

It depends a lot on how everything was installed and how the path was
setup. You will at least need the version 2 and version 3 pythons to be
given different names, like python3 and then start the python 3 scripts
with python3 my_script.py

-- 
Richard Damon

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


Re: [Python-Dev] Python 0.9.1

2021-02-16 Thread Guido van Rossum
Awesome, Skip!

Was there a date somewhere? I can't recall if this would have been the
first open source release (from just about 30 years ago, sometime in
February 1991) or some time later in the same year?

On Tue, Feb 16, 2021 at 1:57 PM Skip Montanaro 
wrote:

> 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. As that
> wasn't listed in the historical releases README file:
>
> https://legacy.python.org/download/releases/src/README
>
> I pulled the shar files (and a patch), then made a few tweaks to get it to
> build:
>
> % ./python
> >>> print 'hello world!'
> hello world!
> >>> import sys
> >>> dir(sys)
> ['argv', 'exit', 'modules', 'path', 'ps1', 'ps2', 'stderr', 'stdin',
> 'stdout']
> >>> sys.modules
> {'builtin': ; 'sys': ; '__main__':  '__main__'>}
> >>> sys.exit(0)
>
> I then pushed the result to a Github repo:
>
> https://github.com/smontanaro/python-0.9.1
>
> There is a new directory named "shar" with the original files, a small
> README file and a compile.patch file between the original code and the
> runnable code.
>
> It was a pleasant diversion for a couple hours. I was tired of shovelling
> snow anyway... Thank you, Hiromi.
>
> Skip
>
> *  Hiromi is bcc'd on this note in case he cares to comment. I didn't want
> to publish his email beyond the bounds of the webmaster alias without his
> permission.
>
> ___
> Python-Dev mailing list -- python-...@python.org
> To unsubscribe send an email to python-dev-le...@python.org
> https://mail.python.org/mailman3/lists/python-dev.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-...@python.org/message/VZYELIYAQWUHHGIIEPPJFREDX6F24KMN/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

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


PyCA cryptography 3.4.6 released

2021-02-16 Thread Paul Kehrer
PyCA cryptography 3.4.6 has been released to PyPI. cryptography
includes both high level recipes and low level interfaces to common
cryptographic algorithms such as symmetric ciphers, asymmetric
algorithms, message digests, X509, key derivation functions, and much
more. We support Python 3.6+, and PyPy3.

Changelog (https://cryptography.io/en/latest/changelog.html#v3-4-6):
* Updated Windows, macOS, and manylinux wheels to be compiled with
OpenSSL 1.1.1j.

-Paul Kehrer (reaperhulk)
___
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


[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Thanks, Victor.

For PySequence_ITEM, I guess adding a private C version (for example 
_PySequence_Item) and redirecting the macro to the C version would be 
acceptable.

Ditto for PyHeapType_GET_MEMBERS and PyType_SUPPORTS_WEAKREFS.

--

___
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-16 Thread boB Stepp

On 21/02/16 11:03AM, Alan Gauld wrote:


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


[...]


And that's just one example, the language is now full of meta goodness
that makes it incomprehensible to beginners. In a teaching environment,
with a teacher present to answer questions, it's probably usable,
but for a self guided course it's increasingly inscrutable.


Hmm.  I'm not sure I can agree, Alan.  My son took to Python 3 like a duck to
water.  Occasionally he has had questions for me, but, for the most part, he
has been entirely on his own with no issues.  He now has several projects that
others are using, including a significant update to someone else's project he
was interested online to both update the Python and Qt.

Yes, there is a ton of meta-goodness in Python, but most of it can be ignored
to be able to *just use it*.  My wife is using Python 3 in a robotics class
she teaches and her high school students find it accessible.  AP computer
science second semester uses Python.  I really don't think it is much of a
problem for most people.  Of course on the Tutor list there often seems to be
some greatly puzzled people, but I think their issues stem from *never* having
tried to do anything even remotely technical other than clicking around in
the GUI programs they have become comfortable with.

--
Wishing you only the best,

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


Python 0.9.1

2021-02-16 Thread 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. As that
wasn't listed in the historical releases README file:

https://legacy.python.org/download/releases/src/README

I pulled the shar files (and a patch), then made a few tweaks to get it to
build:

% ./python
>>> print 'hello world!'
hello world!
>>> import sys
>>> dir(sys)
['argv', 'exit', 'modules', 'path', 'ps1', 'ps2', 'stderr', 'stdin',
'stdout']
>>> sys.modules
{'builtin': ; 'sys': ; '__main__': }
>>> sys.exit(0)

I then pushed the result to a Github repo:

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

There is a new directory named "shar" with the original files, a small
README file and a compile.patch file between the original code and the
runnable code.

It was a pleasant diversion for a couple hours. I was tired of shovelling
snow anyway... Thank you, Hiromi.

Skip

*  Hiromi is bcc'd on this note in case he cares to comment. I didn't want
to publish his email beyond the bounds of the webmaster alias without his
permission.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-16 Thread Dan Stromberg
On Tue, Feb 16, 2021 at 1:23 PM Tarjei Bærland via Python-list <
python-list@python.org> wrote:

> Sure, Brainfuck is two steps too far, but Scheme or Logo I'd wager be
> excellent languages to get the students into computational
> thinking. Haskell might be a good choice as well, I do not have enough
> experience with it to say.
>
I am not a Haskell expert by any stretch.  But I did play with it a bit.

It's a fascinating language. But I think the language is hobbled by poor
error messages from the main compiler, GHC.  I've been told GHC has a
rather elegant implementation, but that came at the cost of the quality of
error messages.
https://www.reddit.com/r/haskell/comments/54l3ug/readable_error_messages_like_in_elm/

There was a project to produce a somewhat restricted Haskell implementation
with better error messages, but sadly that project is no longer maintained.
https://wiki.haskell.org/Hugs
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +23335
pull_request: https://github.com/python/cpython/pull/24553

___
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-16 Thread STINNER Victor


STINNER Victor  added the comment:

> builds a 31/32 bit Python 3.10 on an s390x system.

What is the use case or benefit of building Python for 32-bit rather than 
64-bit?

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

> For PyExceptionClass_Name: Is it ok to just remove the macro version (like 
> with GH-24548)?

Yes, I think so.

--

___
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-16 Thread Tarjei Bærland via Python-list

Christian Gollwitzer writes:

> I agree to all the rest of your post, but this:
>
> Am 16.02.21 um 09:57 schrieb Tarjei Bærland:
>> I am not sure I agree that a language like Scheme or Logo or Brainfuck, with
>> their small number of building blocks, would be harder to learn.
>
>
> is strange. I'm not sure, have you actually looked at Brainfuck? Maybe 
> there is also confusion what means "learning" a programming language. 
> For me, learning a language does not mean to remember the rules and 
> keywords, but to be able to write useful programs. Indeed, Brainfuck 
> with its 8 commands is easy to remember, but it comes at a very high 
> price: you can't do anything useful with it with reasonable effort. It 
> is unusable even for pure computer science stuff. It is easy to see that 
> BF is Turing complete, so please write a BF program to compute the 
> ackermann function. Should be easy, just three rules ;) I'd definitely 
> choose Python to do it here.
>
> In that sense, Scheme also appears to be the Brainfuck of functional 
> programming to me. It is not much more than the pure untyped lambda 
> calculus, and by definition this allows you to compute anything, just 
> like Brainfuck is a Turing machine. Actually it is impressive that you 
> can write actual useful code with such a minimalist language (infix 
> math? Pure bloat!). OTOH it feels like "assembly" compared to more 
> evolved functional languages like, e.g. Haskell.
>
>Christian

To me, it depends on what you want out of including programming in
mathematics education.

Sure, Brainfuck is two steps too far, but Scheme or Logo I'd wager be
excellent languages to get the students into computational
thinking. Haskell might be a good choice as well, I do not have enough
experience with it to say.

If the aim is to quickly get the students to "be creative" with
programming by themselves, my feeling is that Python is too unwieldy for
a beginner.

In a programming course I am teaching, one of the goals is for the
students to distinguish "high level" and "low level" languages. I've
used Brainfuck as an example of a programming language at a low level of
abstraction. That session is often the most engaging throughout the
year. The students are sitting writing their own code after a few
minutes. They get the feeling of designing their own computational
procedure much quicker than in Python. (Yes, of course, the introductory
excercises in Python are a bit more advanced than "add two numbers".)

I am honestly not sure what quite what my feelings are regarding this,
perhaps Python is the best of all possible options.

- Tarjei

Note, I am emphatically saying this in the context of a maths class.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python 2.7 and 3.9

2021-02-16 Thread Ethan Furman
Kevin, please reply to the list (preferably Reply-to-list, or 
Reply-all), that way others can chime in with help.


On 2/16/21 12:55 PM, Kevin M. Wilson wrote:

Windows 7 OS, and typically run in conjunction with testing SSD', as for 
stand alone scripts.
Those require: python BogusFile.py. I too was expecting users to type: 
python my_Script.py!


I'm afraid I have no experience with the above, hopefully somebody else 
on the list does.


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


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

2021-02-16 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

> Are you sure about that? It seems SLE-12 support s390x not s390. Maybe it's 
> multilib support in a similar manner that I've mentioned about RHEL7?

I work at SUSE. I looked at the internal build system. Debian also still build 
s390 multilib libraries, i.e. on zelenka.debian.org, I can still install 
"libc6-s390".

And I still don't understand why you are so keen at keeping people from 
building Python 3.10 on a certain architecture. You don't gain anything by 
removing these few lines of codes. But you risk at making someone unhappy who - 
for whatever reason - builds a 31/32 bit Python 3.10 on an s390x system.

--

___
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-16 Thread Tarjei Bærland via Python-list

David Lowry-Duda writes:

>> In Norway, where I try to teach mathematics to highschoolers, 
>> programming has recently entered the teaching of stem subjects.
>> 
>> Even if Python is my choice language for personal projects, I am not 
>> certain it is the right language to use in a classroom context.
>> ...
>> I am not sure I agree that a language like Scheme or Logo or 
>> Brainfuck, with their small number of building blocks, would be harder 
>> to learn.
>
> Does this mean that you also try to teach programming to highschoolers, 
> or is there a different (maybe dedicated) teacher to that? What language 
> do they use? And does it influence math education at all? (Coming from 
> someone who sometimes tries to teach undergraduates about math).
>
> - David Lowry-Duda

Yes, that also means that mathematics teachers are teaching programming
as well. For my part, it's a welcome change, and I've already been
teaching another programming course for a couple of years, but a lot of
teachers are having to start programming alongside their students.

I don't have any numbers for this, but I'd be surprised if less than 95%
of all teachers used Python for this. (I know of no exception.)

I think it's too soon to tell whether it affects the education. However,
I would have liked to better know the motivation for including
it. Python seems like one of several good choices if you want to
manipulate mathematical objects, perhaps mixing in som symbolic algebra
via Sympy, and other "high level concepts". However, if the aim is for
the students to quickly experience what it's like to design their own
simple algorithm without excessive guidance, Python might not then be the
optimal choice.

- Tarjei Bærland

PS: I can't remember in what context I visited it, but thanks for an
inspiring site.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

For PyExceptionClass_Name: Is it ok to just remove the macro version (like with 
GH-24548)?

--

___
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-16 Thread STINNER Victor


Change by STINNER Victor :


--
title: Remove 32-bit s390 Linux support (s390-linux-gnu triplet) -> Remove 
31/32-bit s390 Linux support (s390-linux-gnu triplet)

___
Python tracker 

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



[issue43233] test_os: test_copy_file_range_offset fails on FreeBSD CURRENT

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

AMD64 FreeBSD Shared 3.x is also affected:
https://buildbot.python.org/all/#/builders/483/builds/813

FAIL: test_copy_file_range_offset (test.test_os.FileTests)

--
title: test_copy_file_range_offset fails on AMD64 FreeBSD Shared 3.9 -> 
test_os: test_copy_file_range_offset fails on FreeBSD CURRENT
versions: +Python 3.10

___
Python tracker 

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



Re: Python 2.7 and 3.9

2021-02-16 Thread Ethan Furman

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.  :)


How are those scripts being run?  Microsoft Windows or Unix/Linux/BSD?

Typically, the first line of a script will say which version of Python 
is needed.  For example, on a *nix type system:


#!/usr/bin/python2

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


Python 2.7 and 3.9

2021-02-16 Thread Kevin M. Wilson via Python-list
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!
KMW
John 1:4  "In him was life; and the life was the light of men."
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: New Python implementation

2021-02-16 Thread Michael Torrie
On 2/16/21 10:58 AM, Ben Bacarisse wrote:
> Attempts at a universal compiler stalled in the 1980s (though there may
> have been some new developments since I stopped looking) because
> expressing the semantics of different languages is so very hard.  In
> fact, much of the interest in pursuing the idea came from benefits that
> would be derived simply from having a language's semantics formally
> described.
> 
> I don't think there is anything to see here.  If the author had come up
> with some new ways to tackle any of the problems, he would be telling> people 
> about these, not saying "be patient" (and bad-mouthing CPython).

Indeed, in all seriousness if he is successful, I look forward to
reading his PhD dissertation, because it would be worthy of a PhD,
especially if he made some breakthroughs in metacompiler design.  His
comments don't give me hope, though.

Seems a bit paradoxical to me to, on the one hand, express a desire to
build a Python implementation, but on the other hand, mock Python as a
toy language.  Why bother with Python at all?

I wish him luck and maybe he'll eventually come back to the community
with something to show and impress with.

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


[issue43240] IDLE Classic Unix keyboard shortcuts broken

2021-02-16 Thread Alan Moore


Alan Moore  added the comment:

OK, it seems that closing all my firefox windows restored correct behavior to 
IDLE.  I can only guess that somehow firefox was eating the Ctrl-x.

Not sure if this is a firefox issue, a window manager issue, or an IDLE issue.  
If you think it's not the latter, feel free to close.

--

___
Python tracker 

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



[issue43236] Windows IDLE taskbar icon jump list fails to open recent files

2021-02-16 Thread Ned Deily


Ned Deily  added the comment:

> Ned, do you have any comments, pro or con, about doing so.

I don't think there is a conflict here and I don't really have an opinion as I 
don't use Windows regularly. From a bit of web research, it looks like the 
closest thing to Windows jump lists on macOS are control-clicking on an app 
icon (like IDLE.app) in the dock which then may show some recent files used 
with the app. As you note, IDLE's recent file list is also available, a good 
cross-platform choice.

--

___
Python tracker 

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



[issue39093] tkinter objects garbage collected from non-tkinter thread cause crash

2021-02-16 Thread John Rouillard


John Rouillard  added the comment:

Sorry for the spam, but there is no silent post setup for this tracker.

On https://github.com/python/psf-infra-meta/issues/74 in July E-paine reports 
that he can't post to this issue. I just created an account linked to github to 
see if I am able to post.

--
nosy: +rouilj

___
Python tracker 

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



[issue43240] IDLE Classic Unix keyboard shortcuts broken

2021-02-16 Thread Alan Moore


New submission from Alan Moore :

Using IDLE 3.9.1 on Arch Linux.

In IDLE I've selected the "classic unix" key set.  It worked for a while, then 
stopped registering key combinations for more than one key (e.g. Ctrl-x Ctrl-s).

Have tried creating a custom key set and manually setting the shortcuts, but it 
still fails the same way.  Caps lock is not on (disabled on my system).

Have also tried moving configs and starting fresh, does not help.

It had been working, then suddenly stopped in the middle of a work day and I 
can't get it working again.

--
assignee: terry.reedy
components: IDLE
messages: 387124
nosy: Alan Moore, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE Classic Unix keyboard shortcuts broken
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: New Python implementation

2021-02-16 Thread Christian Gollwitzer

I agree to all the rest of your post, but this:

Am 16.02.21 um 09:57 schrieb Tarjei Bærland:

I am not sure I agree that a language like Scheme or Logo or Brainfuck, with
their small number of building blocks, would be harder to learn.



is strange. I'm not sure, have you actually looked at Brainfuck? Maybe 
there is also confusion what means "learning" a programming language. 
For me, learning a language does not mean to remember the rules and 
keywords, but to be able to write useful programs. Indeed, Brainfuck 
with its 8 commands is easy to remember, but it comes at a very high 
price: you can't do anything useful with it with reasonable effort. It 
is unusable even for pure computer science stuff. It is easy to see that 
BF is Turing complete, so please write a BF program to compute the 
ackermann function. Should be easy, just three rules ;) I'd definitely 
choose Python to do it here.


In that sense, Scheme also appears to be the Brainfuck of functional 
programming to me. It is not much more than the pure untyped lambda 
calculus, and by definition this allows you to compute anything, just 
like Brainfuck is a Turing machine. Actually it is impressive that you 
can write actual useful code with such a minimalist language (infix 
math? Pure bloat!). OTOH it feels like "assembly" compared to more 
evolved functional languages like, e.g. Haskell.


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


Re: IDLE

2021-02-16 Thread Terry Reedy

On 2/16/2021 11:52 AM, Mats Wichmann wrote:

On 2/16/21 8:09 AM, Will Anderson wrote:

    Hi, I hope you are having a good day. I have a small IDLE problem and
    can’t seem to fix it. I have a .py file that I want to open using 
IDLE but

    there is no option I have even tried totally wiping python and
    reinstalling it nothing seems to work. Please help.


Can you describe what you mean by "there is no option"?

Normally, you click on the File menu, then click on Open. If you don't 
see these, maybe you have the wrong thing open in the first place?


Will, include what version of what operating system, the python versions 
you have and where obtained, whether you can run python itself, and how 
you tried run IDLE and open a file.


--
Terry Jan Reedy


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


[issue43236] Windows IDLE taskbar icon jump list fails to open recent files

2021-02-16 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Eryk, thank you for the research.   Our macOS installer already adds an 
'idlex.y' executable.  Ned, do you have any comments, pro or con, about doing 
so.

(I worry a bit about reinforcing the beginner delusion that IDLE is Python or 
that IDLE executes Python code.  But this appears to already be as common for 
Windows beginners as for Mac beginners.)

--
nosy: +ned.deily

___
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-16 Thread Ben Bacarisse
"Avi Gross"  writes:

> Thanks for sharing. I took a look and he does have a few schemas for Ada and
> C from TWO YEARS ago. Nothing about the infinite number of other languages
> he plans on supporting, let alone Python. And what he has is likely not
> enough to do what he claims he can do easily and rapidly.

The C schema says almost nothing about C.  It lists one kind of comment
and a few type names.  Significantly, it says almost nothing about the
semantics of even the tiny fragment of C presented.

Attempts at a universal compiler stalled in the 1980s (though there may
have been some new developments since I stopped looking) because
expressing the semantics of different languages is so very hard.  In
fact, much of the interest in pursuing the idea came from benefits that
would be derived simply from having a language's semantics formally
described.

I don't think there is anything to see here.  If the author had come up
with some new ways to tackle any of the problems, he would be telling
people about these, not saying "be patient" (and bad-mouthing CPython).

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


Re: IDLE

2021-02-16 Thread Mats Wichmann

On 2/16/21 8:09 AM, Will Anderson wrote:

Hi, I hope you are having a good day. I have a small IDLE problem and
can’t seem to fix it. I have a .py file that I want to open using IDLE but
there is no option I have even tried totally wiping python and
reinstalling it nothing seems to work. Please help.


Can you describe what you mean by "there is no option"?

Normally, you click on the File menu, then click on Open. If you don't 
see these, maybe you have the wrong thing open in the first place?

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


RE: New Python implementation

2021-02-16 Thread Avi Gross via Python-list
Christian,

Thanks for sharing. I took a look and he does have a few schemas for Ada and
C from TWO YEARS ago. Nothing about the infinite number of other languages
he plans on supporting, let alone Python. And what he has is likely not
enough to do what he claims he can do easily and rapidly.

What gets me is that many languages severely overload the use of some
characters and tokens so they can mean many things based on the context and
capturing that is much harder than declaring what is a keyword. Worse, some
languages like PERL make so many things optional, that you can write very
brief programs that keep implicitly assuming the previous part stored
results in $_ and seem at first to be magical as the actual code does not
seem connected to anything. I am not so sure there is a reasonable way to
program ALL existing language his way & to have one ring-like compiler to
rule them all, albeit you might be able to consolidate several somewhat
similar languages.

I also wonder how efficient such a universal compiler (maybe technically not
a compiler) would be but if it was only used once, maybe not. But didn't he
also say this thing would work in an interactive mode line by line?

It reminds me of when I was studying concepts about various takes on a
Turing Machine for my thesis. It has been proven that a Turing Machine can
theoretically solve any problem you can solve with a non-quantum computer. I
emphasize  it is theoretical because we are talking about an infinite tape
with squares containing symbols that are read by a head that moves over it
either to the left or right based on the current state and so on. Fairly
simple programs like copying a million instances of "1" in a row can take
quite a while and really complex programs need near-infinite times or
infinitesimal time per step. What is POSSIBLE is far from useful.

I feel the same way about NEOS. Given a sufficiently advanced and convoluted
schema you can write a sufficiently convoluted computer program that might
halt with an answer -- meaning it will compile a valid program written in a
language that is completely defined by that schema and perhaps additional
info. We know it can be done because each language has existing compilers
and/or interpreters that do so, without an explicit schema.

But to have a program that can take any schema whatsoever and do what is
needed is a bit much. Existing languages were simply not designed with this
in mind and new/old languages might feel constrained about designing new
features that will not be able to fit within an existing schema.

In particular, how do you handle multiple versions of a language like Python
2.X and the incompatible Python 3.X and the eventual re-re-designed Python
4.Y? They all may be placed in files ending in .py!

There is nothing wrong with thinking out of the box or making grand plans.
But I have known people ranging from overly optimistic to manic who think
nothing of making extraordinary claims and may actually believe it. I would
not be shocked if a subset of what is being suggested for NEOS might be done
by a large team in a few decades but by then, we may all be using quantum
computers and a whole new set of languages to take advantage of new
paradigms like superposition ...

-Original Message-
From: Python-list  On
Behalf Of Christian Gollwitzer
Sent: Tuesday, February 16, 2021 2:25 AM
To: python-list@python.org
Subject: Re: New Python implementation

Am 15.02.21 um 21:37 schrieb Roel Schroeven:
> 
> So your claim is that your compiler is able to, or will be able to, 
> compile any language just by specifying a small schema file. Great!
> 
> Do you maybe have a proof-of-concept? A simple language with a simple 
> schema file to test the basic workings of your compiler,

Here is the git repo:

https://github.com/i42output/neos

under languages/ you'll find different schema files.

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

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


Re: SSL/TLS certificate verification suddenly broken, Python 3 on Windows 10

2021-02-16 Thread Michał Jaworski
I’ve had similar issue today on macOS when trying to download something from 
PyPI with Python 3.9.1 but I didn’t try to debug it and just moved on to 
different things. Maybe we both have outdated ca bundles?

Michał Jaworski

> Wiadomość napisana przez Carlos Andrews  w dniu 
> 16.02.2021, o godz. 16:42:
> 
> Hi All,
> 
> I ran into an error I, so far, cannot explain regarding Python's general
> ability to communicate via SSL/TLS.
> 
> I'm using Python a lot to communicate with web servers and APIs, which
> worked just fine until yesterday (or somewhen late last week).
> 
> I first noticed yesterday, when a requests-based call to a local web server
> with a self-signed certificate failed. No worries, I thought, passing the
> "verify=False" parameter to the request fixed the issue.
> 
> Later on I used the same call to a public web server with a valid,
> CA-signed certificate and got the same error:
> SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: unable to get local issuer certificate
> (_ssl.c:1123)'))
> 
> That caused me to stop and try simple calls like
> import requests
> resp = requests.request('GET', 'https://www.nytimes.com/')
> to fail alike. And I surely would not turn off certificate verification to
> public websites.
> 
> First assuming a network connection problem I tried curl, openssl or a web
> browser, all worked fine. Only Python fails.
> 
> I checked the installed certificate bundle, all correct and even upgraded
> it to the latest version. No effect. I replaced it with the one curl is
> using and that curl managed to verify the cert with. No effect.
> 
> By that time I was using a Python 3.7.9 installation on Windows 10 that ran
> fine for months (and also before upgrading to 3.7.9).
> 
> I tried upgrading certifi and requests to the latest versions, which also
> caused the same SSLError, so I downloaded the wheel packages and forced a
> local upgrade - to no help.
> 
> After that I deleted the whole Python installation directory and replaced
> it with a backup copy of a known-working version from a month ago. The
> error kept appearing.
> 
> I then uninstalled Python completely, rebooted and installed Python 3.9.1,
> downloaded from python.org.
> 
> The first to commands to issue were:
> C:\Users\Carlos>python -V
> Python 3.9.1
> 
> C:\Users\Carlos>pip list
> PackageVersion
> -- ---
> pip20.2.3
> setuptools 49.2.1
> Could not fetch URL https://pypi.org/simple/pip/: There was a problem
> confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org',
> port=443): Max retries exceeded with url: /simple/pip/ (Caused by
> SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
> certificate verify failed: unable to get local issuer certificate
> (_ssl.c:1123)'))) - skipping
> 
> So there went my theory of the requests module... It already happens with
> the Python base installation (urllib3?). Obviously a freshly installed
> Python with no modifications and no other modules installed fails to verify
> each and every certificate.
> 
> I can rule out network errors as other machines using the same Internet
> breakout work just fine with the same code. And it happens using a web
> proxy and using no web proxy at all.
> 
> Aunty Google always tells me to set "verify=False" but that can't be the
> solution for *this* problem. Unfortunately I have no idea where to look
> next - not with a fresh installation failing.
> 
> Does anybody have a useful pointer for me? TIA!
> 
> Regards,
> Carlos
> -- 
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

> By the way, I would suggest to move "#define PyCFunction_New(ML, SELF) 
> PyCFunction_NewEx((ML), (SELF), NULL)" to Include/cpython/methodobject.h 

Wait no, I wrote too soon.
PyCFunction_NewEx is part of the limited API as well, even though it's 
undocumented. People can call it.

--

___
Python tracker 

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



[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

> By the way, I would suggest to move "#define PyCFunction_New(ML, SELF) 
> PyCFunction_NewEx((ML), (SELF), NULL)" to Include/cpython/methodobject.h 

OK, I'll add that move to the PR.

> Oh, it's not listed by Doc/data/stable_abi.dat and so not checked by 
> Tools/scripts/stable_abi.py.

I'm planning to rework this for PEP 652 (which is how I found the issue in the 
first place), so I'll not add it there now.

--

___
Python tracker 

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



[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-16 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, it's not listed by Doc/data/stable_abi.dat and so not checked by 
Tools/scripts/stable_abi.py.

It's implemented explicitly as a function only for the stable ABI:

PyObject *
PyCFunction_New(PyMethodDef *ml, PyObject *self)
{
return PyCFunction_NewEx(ml, self, NULL);
}

So yeah, it should be exported.

By the way, I would suggest to move "#define PyCFunction_New(ML, SELF) 
PyCFunction_NewEx((ML), (SELF), NULL)" to Include/cpython/methodobject.h to 
clarify that the limited C API should call "PyCFunction_New()" and not call 
"PyCFunction_NewEx()".

--
nosy: +vstinner

___
Python tracker 

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



[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-02-16 Thread Petr Viktorin


New submission from Petr Viktorin :

PyCFunction_New is part of the Stable ABI (see bpo-21354), but it is not 
declared as PyAPI_FUNC, and thus not exported with GCC's -fvisibility=hidden.
To match Windows, it should be declared.

(I don't think this has any real impact, I just want to fix it before enabling 
automatic tests on such issues.)

--
assignee: petr.viktorin
components: C API
messages: 387119
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: PyCFunction_New is not exported with PyAPI_FUNC
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



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

2021-02-16 Thread Petr Viktorin


Petr Viktorin  added the comment:

I plan to do this slightly differently, see PEP 652.

--
nosy: +petr.viktorin

___
Python tracker 

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



IDLE

2021-02-16 Thread Will Anderson
   Hi, I hope you are having a good day. I have a small IDLE problem and
   can’t seem to fix it. I have a .py file that I want to open using IDLE but
   there is no option I have even tried totally wiping python and
   reinstalling it nothing seems to work. Please help.

    

    

   Will Anderson

   [1]andersonwill...@gmail.com

   [2]Website

    

    

References

   Visible links
   1. mailto:andersonwill...@gmail.com
   2. https://sites.google.com/view/willanderson/home
-- 
https://mail.python.org/mailman/listinfo/python-list


SSL/TLS certificate verification suddenly broken, Python 3 on Windows 10

2021-02-16 Thread Carlos Andrews
Hi All,

I ran into an error I, so far, cannot explain regarding Python's general
ability to communicate via SSL/TLS.

I'm using Python a lot to communicate with web servers and APIs, which
worked just fine until yesterday (or somewhen late last week).

I first noticed yesterday, when a requests-based call to a local web server
with a self-signed certificate failed. No worries, I thought, passing the
"verify=False" parameter to the request fixed the issue.

Later on I used the same call to a public web server with a valid,
CA-signed certificate and got the same error:
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate
(_ssl.c:1123)'))

That caused me to stop and try simple calls like
import requests
resp = requests.request('GET', 'https://www.nytimes.com/')
to fail alike. And I surely would not turn off certificate verification to
public websites.

First assuming a network connection problem I tried curl, openssl or a web
browser, all worked fine. Only Python fails.

I checked the installed certificate bundle, all correct and even upgraded
it to the latest version. No effect. I replaced it with the one curl is
using and that curl managed to verify the cert with. No effect.

By that time I was using a Python 3.7.9 installation on Windows 10 that ran
fine for months (and also before upgrading to 3.7.9).

I tried upgrading certifi and requests to the latest versions, which also
caused the same SSLError, so I downloaded the wheel packages and forced a
local upgrade - to no help.

After that I deleted the whole Python installation directory and replaced
it with a backup copy of a known-working version from a month ago. The
error kept appearing.

I then uninstalled Python completely, rebooted and installed Python 3.9.1,
downloaded from python.org.

The first to commands to issue were:
C:\Users\Carlos>python -V
Python 3.9.1

C:\Users\Carlos>pip list
PackageVersion
-- ---
pip20.2.3
setuptools 49.2.1
Could not fetch URL https://pypi.org/simple/pip/: There was a problem
confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org',
port=443): Max retries exceeded with url: /simple/pip/ (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed: unable to get local issuer certificate
(_ssl.c:1123)'))) - skipping

So there went my theory of the requests module... It already happens with
the Python base installation (urllib3?). Obviously a freshly installed
Python with no modifications and no other modules installed fails to verify
each and every certificate.

I can rule out network errors as other machines using the same Internet
breakout work just fine with the same code. And it happens using a web
proxy and using no web proxy at all.

Aunty Google always tells me to set "verify=False" but that can't be the
solution for *this* problem. Unfortunately I have no idea where to look
next - not with a fresh installation failing.

Does anybody have a useful pointer for me? TIA!

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


Re: New Python implementation

2021-02-16 Thread Alan Gauld via Python-list
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.

But the sort of change that has made it complicated for beginners
is range(). range() used to be simple - it returned a list of numbers
in the range specified. The hardest thing to explain was why it
stopped one short of the upper limit. Now range returns a
"range object". Say what? How do explain a range object to a beginner?
And you can't avoid it because the name pops up in the interpreter.

And that's just one example, the language is now full of meta goodness
that makes it incomprehensible to beginners. In a teaching environment,
with a teacher present to answer questions, it's probably usable,
but for a self guided course it's increasingly inscrutable.

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


[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Eryk Sun


Eryk Sun  added the comment:

Can't there be a library named "libc" with the shared module "liblibc.so"? It 
seems to me that the _is_elf() function added in issue 41976 is breaking the 
contract that "[i]f no library can be found, returns None". It's not supposed 
to leak arbitrary exceptions from the implementation if the library isn't found.

--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

The documentation is explicit: you must not include the "lib" prefix.
https://docs.python.org/dev/library/ctypes.html#ctypes.util.find_library

See also examples:
https://docs.python.org/dev/library/ctypes.html#finding-shared-libraries

If it worked with "lib" prefix in Python 3.8, it wasn't on purpose.

You should fix your code, but Python works as expected. I close the issue.

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



Re: New Python implementation

2021-02-16 Thread David Lowry-Duda
> In Norway, where I try to teach mathematics to highschoolers, 
> programming has recently entered the teaching of stem subjects.
> 
> Even if Python is my choice language for personal projects, I am not 
> certain it is the right language to use in a classroom context.
> ...
> I am not sure I agree that a language like Scheme or Logo or 
> Brainfuck, with their small number of building blocks, would be harder 
> to learn.

Does this mean that you also try to teach programming to highschoolers, 
or is there a different (maybe dedicated) teacher to that? What language 
do they use? And does it influence math education at all? (Coming from 
someone who sometimes tries to teach undergraduates about math).

- David Lowry-Duda
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset cc54001c2eb3b14320c1667b22602d69c90d5865 by Erlend Egeberg 
> Aasland in branch 'master':
> bpo-40170: Always define PyIter_Check() as a function (GH-24548)

For macOS which doesn't use LTO compiler optimization, we added private static 
inline functions of some "Check" functions. But I don't think that it's worth 
it here (I don't think that the function is commonly called in "hot code").

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset cc54001c2eb3b14320c1667b22602d69c90d5865 by Erlend Egeberg 
Aasland in branch 'master':
bpo-40170: Always define PyIter_Check() as a function (GH-24548)
https://github.com/python/cpython/commit/cc54001c2eb3b14320c1667b22602d69c90d5865


--

___
Python tracker 

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



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

2021-02-16 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

> s390 is being built for SLE-12, for example, on the internal SUSE build 
> system and SLE-12 is still supported. So if a customer wants to use Python 
> 3.10 in a SLE-12 s390 environment, why keep them from doing so?

Are you sure about that? It seems SLE-12 support s390x not s390. Maybe it's 
multilib support in a similar manner that I've mentioned about RHEL7?

--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-02-16 Thread Nicholas Sim


Change by Nicholas Sim :


--
pull_requests: +2
pull_request: https://github.com/python/cpython/pull/24550

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Vadym Stupakov


Vadym Stupakov  added the comment:

I mean, find_library relies on gcc linker, when you pass library name to the 
linker, it automatically ads "lib" prefix to the library
so, when you pass "libc", linker ads "lib" so u have an error with "liblibc" 
name.

just man ld and see "-l" option:

"
-l namespec
   --library=namespec
   Add the archive or object file specified by namespec to the
   list of files to link.  This option may be used any number of
   times.  If namespec is of the form :filename, ld will search
   the library path for a file called filename, otherwise it
   will search the library path for a file called libnamespec.a.
"

as you can see, you pass not a library name, but a "namespec"
which then transforms to "libnamespec"

--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Vadym Stupakov


Vadym Stupakov  added the comment:

> ctypes.util.find_library("libc") used to work in 3.8, not working in 3.9. As 
> I said before, ctypes.util.find_library("c") works in both 3.8 and 3.9.

no, it doesn't work (and it shouldn't) neither in python 3.8 nor 3.7

Python 3.8.5 (default, Sep  4 2020, 07:30:14) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.19.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import ctypes.util
In [2]: a = ctypes.util.find_library("libc")
In [3]: print(a)
None

Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 

import ctypes.util
a = ctypes.util.find_library("libc")
print(a)
None

as I said, adding prefix "lib" is wrong

--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Eryk Sun


Eryk Sun  added the comment:

Issue 41976 added ctypes.util._is_elf() to filter out linker scripts such as 
"libc.so". The PR was backported to 3.7. _is_elf() assumes the trace result has 
absolute paths that can be opened, but Matthias is getting the relative 
filename "liblibc.a" in the result. Whatever the reason, I think if the file 
can't be opened for reading, then _is_elf() should just return False. For 
example:

def _is_elf(filename):
"Return True if the given file is an ELF file"
elf_header = b'\x7fELF'
try:
with open(filename, 'br') as thefile:
return thefile.read(4) == elf_header
except OSError:
return False

--
nosy: +eryksun

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Matthias Klose


Matthias Klose  added the comment:

ctypes.util.find_library("libc") used to work in 3.8, not working in 3.9. As I 
said before, ctypes.util.find_library("c") works in both 3.8 and 3.9.

--

___
Python tracker 

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



[issue41282] Deprecate and remove distutils

2021-02-16 Thread Lumír Balhar

Change by Lumír Balhar :


--
pull_requests: +23332
pull_request: https://github.com/python/cpython/pull/24549

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Vadym Stupakov


Vadym Stupakov  added the comment:

So, can we close it?

--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

Oh right, I always use find_library("c"), not find_library("libc").

--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread Vadym Stupakov


Vadym Stupakov  added the comment:

Note, that adding "lib" prefix to any library is wrong, that's why it returns 
"None" or raises the exception.

And it works fine when you call find_library("c")

I guess the issue, that was reported here, is about raising and exception 
instead of returning "None", but not about finding library, isn't it?

--

___
Python tracker 

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



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 17dbd4078b68db8954df6b5cdc40b786bc4ad7af by Nicholas Sim in 
branch 'master':
bpo-35134, Include: Move pytime.h to cpython/pytime.h (GH-23988)
https://github.com/python/cpython/commit/17dbd4078b68db8954df6b5cdc40b786bc4ad7af


--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

> _findLib_gcc() uses "gcc -Wl,-t -o tmp -lc" command and search for "lib" in 
> the created "tmp" file.

Oh, it looks for the "lib" in the process stdout (not in the created "tmp" 
file).

--

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

This function is quite complicated on Linux:

def find_library(name):
# See issue #9998
return _findSoname_ldconfig(name) or \
   _get_soname(_findLib_gcc(name)) or 
_get_soname(_findLib_ld(name))

_findSoname_ldconfig() uses "/sbin/ldconfig -p" and searchs for 'libc6,x86-64' 
in the output (on x86-64).

_findLib_gcc() uses "gcc -Wl,-t -o tmp -lc" command and search for "lib" in the 
created "tmp" file.

_findLib_ld() uses "ld -t -lc" command and searchs for "lib" pattern.

The exact code is more complicated :-) You should debug this issue by running 
these commands manually on Debian.

Note: python3.9 -c 'import ctypes.util; print(ctypes.util.find_library("c"))' 
commands displays libc.so.6 with Python 3.8, 3.9 and 3.10 on Fedora. I cannot 
reproduce the issue on Fedora 33 (x86-64).

--
nosy: +vstinner

___
Python tracker 

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



[issue42580] ctypes.util.find_library("libc") fails

2021-02-16 Thread RedEyed

RedEyed  added the comment:

can't reproduce

(py39) ➜  ~ ipython 
Python 3.9.1 (default, Dec 11 2020, 14:32:07) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.20.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import ctypes.util
In [2]: a = ctypes.util.find_library("libc")
In [3]: print(a)
None

--
nosy: +RedEyed

___
Python tracker 

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



[issue43175] filecmp is not working for UTF-8 BOM file.

2021-02-16 Thread Eryk Sun


Eryk Sun  added the comment:

The two files in "files.zip" have the same contents:

>>> open('source.css', 'rb').read() == open('destination.css', 'rb').read()
True

Maybe there's something peculiar about the stat results. Check that they're 
both reported as regular files with the same size:

import os
for f in ('source.css', 'destination.css'):
print(f, os.path.isfile(f), os.path.getsize(f))

--
nosy: +eryksun

___
Python tracker 

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



[issue43237] datetime.__eq__ returns true when timezones don't match

2021-02-16 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +belopolsky, p-ganssle

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2021-02-16 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
pull_requests: +23331
pull_request: https://github.com/python/cpython/pull/24548

___
Python tracker 

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



[issue43237] datetime.__eq__ returns true when timezones don't match

2021-02-16 Thread Mark Dickinson


Mark Dickinson  added the comment:

Hi Richard. Thanks for the report. Python's working as designed (and as 
documented and tested) here. IOW, the behaviour is deliberate - this isn't a 
bug.

Any change in behaviour would have to target 3.10 at the earliest (and it's 
already quite late in the release process for 3.10). A couple of questions: (1) 
what would you want the comparisons `datetime_in_sgt <= datetime_in_utc` and 
`datetime_in_utc <= datetime_in_sgt` to give? (2) How would you propose to 
change the behaviour without breaking existing code that makes use of the 
current behaviour?

> This is confusing and non-intuitive.

That's a rather subjective judgement. I'd personally find the behaviour you 
suggest non-intuitive (and I find the behaviour of Java's order comparisons on 
ZonedDateTime to be highly non-intuitive). We'd need something a bit more 
objective and/or widely supported to justify a behaviour change.

--
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: New Python implementation

2021-02-16 Thread Tarjei Bærland via Python-list


Christian Gollwitzer writes:

> 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 (in contrast to PL/I's many
>> 'bells and whistles'). 
>
> 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, anything 
> that's built into the interpreter if you leave out any standard 
> function, is enormous. To name a few: List comprehension, format 
> strings, iterator protocol, asynchronous programming, everything called 
> __dunderland. A minimal language with only very few basic rules, that 
> would be Scheme e.g. Of course, it doesn't mean that Scheme is easier to 
> program, but it is easier to write a compiler for it than for Python.
>
> That is a misundestanding often presented - a language that is simple in 
> the sense of having a few simple rules, is usually hard to use. (e.g. 
> Brainfuck). A language which is easy to use, often comes with a large 
> variety of building blocks, to give you the right tool to choose for the 
> job at hands (e.g. Python), and therefore is "complex".
>
>   Christian

In Norway, where I try to teach mathematics to highschoolers, programming has
recently entered the teaching of stem subjects.

Even if Python is my choice language for personal projects, I am not certain it
is the right language to use in a classroom context. My feeling is that Python
comes with way too much packed in, making it very hard for the students to get
to a level where they can sit down and be creative with their own
programming. You either guide them very, very deliberately, exposing piece by
piece of the language ... or you let them loose, having to explain the
difference in scoping between list comprehensions and for loops after three
weeks.

I am exaggerating ... a little.

I am not sure I agree that a language like Scheme or Logo or Brainfuck, with
their small number of building blocks, would be harder to learn.

To me, Python is the lego boxes from the early 2000s, where there were so many
specialized pieces that you felt that the original design might as well be the
only design.

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


[issue43238] python picking garbage values randomly incase running palindrome function

2021-02-16 Thread Mark Dickinson


Mark Dickinson  added the comment:

Hi Raghav.

I think you think you're found a bug in Python, but I'm afraid it's difficult 
to tell from your report what you think that bug is. Please state clearly what 
you did, what you expected to happen (and why), and what actually happened. You 
may find this article useful: 
https://www.chiark.greenend.org.uk/~sgtatham/bugs.html

You might also consider asking for help on user forums. It's much more likely 
that any surprising behaviour you're seeing here is due to a bug in your code 
rather than in Python itself.

--
components:  -Windows
nosy: +mark.dickinson -paul.moore, rv.raghav23, steve.dower, tim.golden, 
zach.ware
resolution:  -> not a bug
status: open -> pending

___
Python tracker 

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



[issue43236] Windows IDLE taskbar icon jump list fails to open recent files

2021-02-16 Thread Eryk Sun


Eryk Sun  added the comment:

The IDLE shortcut that's installed by the development distribution runs 
`"\pythonw.exe" "\Lib\idlelib\idle.pyw"`. 
Thus opening a file that's pinned to the jumplist will execute it as a script 
via "pythonw.exe". 

To integrate better with the Windows shell, IDLE would need its own executable. 
Moreover, AFAICT, it isn't enough to use a launcher that executes 
"pythonw.exe", such as a distlib launcher installed by pip for an entrypoint 
script. Using a launcher disassociates the executable that the shell runs to 
open a file from the application that creates the UI. It needs to be a simple C 
application that hard codes executing the idlelib module, similar in spirit to 
what's implemented in PC/python_uwp.cpp for the store app. I created a test app 
that implements this, and I can confirm that pinned and recent files in the 
jumplist open as desired in IDLE.

The development distribution would install the new binary (e.g. "idle3.10.exe") 
in the installation directory beside the DLL. That's the simplest way to link 
with the interpreter DLL and find the standard library. The IDLE shortcut 
target and "Edit with IDLE" command would be updated to use the new executable 
instead of "pythonw.exe".

--
nosy: +eryksun

___
Python tracker 

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



[RELEASE] Python 3.7.10 and 3.6.13 security updates now available

2021-02-16 Thread Ned Deily
Python 3.7.10 and 3.6.13, the lastest security fix rollups for Python 3.7 and 
Python 3.6, are now available. You can find the release files, links to the 
changelogs, and more information here:

https://www.python.org/downloads/release/python-3710/
https://www.python.org/downloads/release/python-3613/

These releases are source code only; Windows and macOS binary installers are 
not provided for security fix releases.

Note that Python 3.9 is now the latest feature release series of Python 3. You 
should consider upgrading to 3.9 as soon as practical. Get the latest release 
of 3.9.x here:

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

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.

https://www.python.org/psf-landing/

--
  Ned Deily
  n...@python.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


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

2021-02-16 Thread STINNER Victor


STINNER Victor  added the comment:

> s390 is being built for SLE-12, for example, on the internal SUSE build 
> system and SLE-12 is still supported. So if a customer wants to use Python 
> 3.10 in a SLE-12 s390 environment, why keep them from doing so?

I don't think that SuSE plans to provide Python 3.10 on SLE-12.

cc @mcepl

--
nosy: +mcepl

___
Python tracker 

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



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

2021-02-16 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

> This thread is an excellent example why ignoring platforms comes at a cost. 
> It will only get worse when are going to introduce platform and architecture 
> specific code for optimizations and features.

Which is purely hypothetical at the moment. You are arguing with something that 
might happen in the future but currently doesn't exist to justify the removal 
of 5 lines of preprocessor and autoconf "code".

You can still drop these lines in the future _if_ they happen to cause any 
headache. But that is currently not the case, so there isn't really a burden.

>> You can view test results any time by going to https://buildd.debian.org/ 
>> and searching for "pythonX.Y". So there is actually a CI for release builds.

> The site does not list a s390 builder. There is only a s390x builder.

s390 is being built for SLE-12, for example, on the internal SUSE build system 
and SLE-12 is still supported. So if a customer wants to use Python 3.10 in a 
SLE-12 s390 environment, why keep them from doing so?

In my experience some upstream projects make the mistake that they think they 
always know how users are using their software. But since there is no dedicated 
feedback channel, you have no means in knowing whether someone is building 
Python for a given architecture for their custom project. After all, there are 
source-only distributions like Gentoo, so you don't have to rely on any 
existing binary builds.

--

___
Python tracker 

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



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

2021-02-16 Thread Christian Heimes


Christian Heimes  added the comment:

> You don't need to support a platform. Just call it unsupported and ignore 
> issues if people report them unless they provide a patch themselves.

This thread is an excellent example why ignoring platforms comes at a cost. It 
will only get worse when are going to introduce platform and architecture 
specific code for optimizations and features.

> You can view test results any time by going to https://buildd.debian.org/ and 
> searching for "pythonX.Y". So there is actually a CI for release builds.

The site does not list a s390 builder. There is only a s390x builder.

--

___
Python tracker 

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



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

2021-02-16 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

> So IMO it's fine to remove the support.

You are not removing "support". You're just disallowing users to use the Python 
interpreter - which works perfectly fine on all architectures we have in 
current and previous releases - on Debian.

A few preprocessor macros plus some lines in a configure.ac aren't something 
that would qualify as platform support. There is no architecture-specific code 
and the Python interpreter is highly portable and just works whereever we build 
it in Debian (and openSUSE).

I would unterstand the reasoning of such a change if there was a swath of users 
filing bug reports about s390 and you just don't want to deal with that any 
longer. But that's not the case as far as I can see.

--

___
Python tracker 

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



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

2021-02-16 Thread John Paul Adrian Glaubitz


John Paul Adrian Glaubitz  added the comment:

> The guidelines for platform support are explained in PEP 11 
> (https://www.python.org/dev/peps/pep-0011/#supporting-platforms). We don't 
> support platforms unless we have maintainers and CI (builtbots) in place for 
> the platform.

You don't need to support a platform. Just call it unsupported and ignore 
issues if people report them unless they provide a patch themselves.

FWIW, the Python interpreter has never caused any issues on any platform that 
we support in Debian. We are regularly building the latest upstream versions of 
all available Python interpreters thanks to the packaging work of Matthias 
Klose.

You can view test results any time by going to https://buildd.debian.org/ and 
searching for "pythonX.Y". So there is actually a CI for release builds.

--

___
Python tracker 

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