Re: Friday Finking: Limiting parameters

2020-07-22 Thread dn via Python-list

On 22/07/2020 05:37, Peter J. Holzer wrote:

On 2020-07-13 17:21:40 +1200, dn via Python-list wrote:

On 12/07/20 10:10 PM, Barry Scott wrote:

I'd expect to see something like this:

def mail_label( person, address ):
first_name = person.first_name
# or if you want a function interface
first_line_of_address = address.get_first_line()


Does this idea move whole objects across the interface? (see earlier in the
thread)


Assigning an object in Python only copies a pointer (and may adjust some
house-keeping info, like a reference count). So it doesn't matter
whether the object  has 5 fields or 50. The function will only access
those it knows about and ignore the rest.


Yes, poor choice of words in "move". Perhaps (he says rather weakly), 
think in terms of move-ing control - from the object to the function. Is 
this the best idea?


The point being that the function needs to 'know things' about the 
object, ie 'I want to make the identification line of the address so I 
must retrieve title, first-initial, family-name, ... all names which 
exist inside the object. In our example, the example-object has been 
person, so it's not big deal. What happens if in-future we develop a 
mailing-list for companies? The mail-label function now appears to be 
requiring that the company object use exactly the same attribute-names 
as person!


The obvious alternative might be to pass all three data-values (in the 
example). Now the function only needs to know what it intends to call 
the three parameters - nothing more. However, our argument-count 
increases again...


Another alternative would be to pass a method which will retrieve those 
fields from the object, delivering them in the form[at] expected by the 
function. In this case, the object provides the interface and the 
mail-label routine can get-on with what it knows best, without needing 
to know the who/what/where/how of data held by 'whatever is out-there'. 
(also, counts as only one argument!)




One might argue that mail_label should be a method of the person object
because it depends on the person (e.g., depending on the ethnicity of
the person the name might be written "first_name last_name" or
"last_name firstname"). OTOH a person may have many addresses (and an
address shared by many people), so a function which combines a person
and address (which therefore can't be a method of either person or
address) may be better.

Maybe that should be treated as a model-view relationship: You have two
models (person and address) and a view (which combines some aspects of
both while ignoring others).


So, would this be merely "has-a" composition, or is it where other 
languages would use "interfaces"? (and if-so, what is the pythonic 
solution?)

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


Re: Installing Python 3.8.3 with tkinter

2020-07-22 Thread Klaus Jantzen

On 7/22/20 11:05 PM, Ned Deily wrote:

On 2020-07-22 06:20, Klaus Jantzen wrote:

Trying to install Python 3.8.3 with tkinter I run configure with the
following options

./configure --enable-optimizations --with-ssl-default-suites=openssl
--with-openssl=/usr/local --enable-loadable-sqlite-extensions
--with-pydebug --with-tcltk-libs='-L/opt/ActiveTcl-8.6/lib/tcl8.6'
--with-tcltk-includes='-I/opt/ActiveTcl-8.6/include'

Running Python gives the following information

[...]

How do that correctly?

Try --with-tcltk-libs='-L/opt/ActiveTcl-8.6/lib -ltcl8.6 -ltk8.6'



Thank you for your suggestion; unfortunately it did not help.

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


[issue41045] f-string's "debug" feature is undocumented

2020-07-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

I've reviewed your first PR (#21509).

Regarding your second one, I think there's a misunderstanding. With "pydoc" I 
didn't mean "the Python docs". IMO the documentation of f-strings in the 
language reference is sufficient, there's no need for another section about it 
in the library reference.

What I meant was that the pydoc *module* doesn't have any text about f-strings. 
The help() builtin calls pydoc.help(), and there are some *special* topics that 
you can invoke whose source text is generated
by running `make pydoc-topics` in the Doc directory and copying the output into 
Lib/pydoc_data/. There is a list of topics included in 
Doc/tools/extensions/pyspecific.py (pydoc_topic_labels) and something has to be 
added there. But beware! This code is tricky. You also need to add an entry to 
pydoc.py itself, to the dict named 'topics' around line 1891. I think you can 
just add an entry FSTRINGS to the latter and make it point to the section 
labeled f-strings in the language reference (which you are updating in PR 
21509).

Let me know if you need more help (I had a fun hour figuring out how all this 
works :-).

--

___
Python tracker 

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



[issue41373] IDLE: edit/save files created by Windows Explorer

2020-07-22 Thread Terry J. Reedy


New submission from Terry J. Reedy :

#41300 fixed one bug in the patch for #41158.  A user reported another on on 
idle-dev list.  Create a file in Windows Explorer.  Leave as .txt or rename to 
.py.  Right click and Edit with IDLE 3.8 (.4/.5 or 3.9.0b4 or 5).  Edit works, 
Save (or Run) does not.  Open the same file from Command Prompt, change it, and 
trying to save produces

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Programs\Python38\lib\tkinter\__init__.py", line 1883, in __call__
return self.func(*args)
  File "C:\Programs\Python38\lib\idlelib\multicall.py", line 176, in handler
r = l[i](event)
  File "C:\Programs\Python38\lib\idlelib\iomenu.py", line 200, in save
if self.writefile(self.filename):
  File "C:\Programs\Python38\lib\idlelib\iomenu.py", line 232, in writefile
text = self.fixnewlines()
  File "C:\Programs\Python38\lib\idlelib\iomenu.py", line 252, in fixnewlines
text = text.replace("\n", self.eol_convention)
TypeError: replace() argument 2 must be str, not None

The replacement line is guarded with
if self.eol_convention != "\n":
Either the condition should be include 'and self.eol_convention is not None' or 
the setting of the attribute should be changed.  I will look into how it was 
set before the #41158 patch.

--
messages: 374119
nosy: terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: edit/save files created by Windows Explorer
type: behavior
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue41182] DefaultSelector fails to detect selector on VMware ESXi

2020-07-22 Thread miss-islington


miss-islington  added the comment:


New changeset bcd47837a9bf4806e559b40df73869493efcce27 by Abhijeet Kasurde in 
branch 'master':
bpo-41182 selector: use DefaultSelector based upon implementation (GH-21257)
https://github.com/python/cpython/commit/bcd47837a9bf4806e559b40df73869493efcce27


--
nosy: +miss-islington

___
Python tracker 

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



[issue41371] test_zoneinfo fails

2020-07-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +p-ganssle

___
Python tracker 

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



[issue41357] pathlib.Path.resolve incorrect os.path equivalent

2020-07-22 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


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

___
Python tracker 

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



[issue12423] signal handler doesn't handle SIGABRT from os.abort

2020-07-22 Thread Howard A. Landman


Howard A. Landman  added the comment:

I don't think changing the documentation makes this not be a bug. My situation: 
I have a Python 3.7.3 program that reliably dies (after about 13 hours, having 
called its measure() method between 118.6M and 118.7M times) with free(): 
invalid pointer, which calls abort(). I believe that this is a bug in Python; 
and it's NOT a memory leak, since the size of the program doesn't change at all 
over time and is under 14 MB (real). I would like to debug it. This basically 
says "you're screwed". I can't catch the abort, and I can't use python3-dbg 
because it won't bind with the RPi.GPIO or spidev libraries. So all I can get 
from a core dump is that free() is being called by list_ass_item() at 
../Objects/listobject.c line 739. Assuming that I'm right and that this is a 
bug in Python, how do you expect anyone to ever debug it? At a bare minimum, 
there needs to be an easy way to get a full stack trace through both Python and 
C.

--
nosy: +Howard_Landman

___
Python tracker 

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



Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Chris Angelico
On Thu, Jul 23, 2020 at 10:30 AM Gene Heskett  wrote:
>
> On Wednesday 22 July 2020 19:51:42 Chris Angelico wrote:
>
> > On Thu, Jul 23, 2020 at 9:17 AM dn via Python-list
> >
> >  wrote:
> > > However, questions remain:-
> > >
> > > Robot: any machine or mechanical device that operates automatically
> > > with humanlike skill
> >
> > What about a human that operates mechanically with merely robot-like
> > skill? I'm pretty sure I've spoken to them on the phone many times.
> >
> > ChrisA
>
> Thats more common than you might think Chris.  Whats nice is that you can
> often take over that robot and use his or her hands to troubleshoot an
> off the air tv transmitter from a thousand miles away.  That was my
> field of expertise for 60 years.
>

Ah yes. I was more thinking of the ones you get when you call for
support. "Have you rebooted your computer and router?" "THERE IS NO
ADSL SYNC. Rebooting my computer is not going to change that."

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


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Gene Heskett
On Wednesday 22 July 2020 19:51:42 Chris Angelico wrote:

> On Thu, Jul 23, 2020 at 9:17 AM dn via Python-list
>
>  wrote:
> > However, questions remain:-
> >
> > Robot: any machine or mechanical device that operates automatically
> > with humanlike skill
>
> What about a human that operates mechanically with merely robot-like
> skill? I'm pretty sure I've spoken to them on the phone many times.
>
> ChrisA

Thats more common than you might think Chris.  Whats nice is that you can 
often take over that robot and use his or her hands to troubleshoot an 
off the air tv transmitter from a thousand miles away.  That was my 
field of expertise for 60 years.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread dn via Python-list

On 23/07/2020 11:51, Chris Angelico wrote:

On Thu, Jul 23, 2020 at 9:17 AM dn via Python-list
 wrote:

However, questions remain:-

Robot: any machine or mechanical device that operates automatically with
humanlike skill



What about a human that operates mechanically with merely robot-like
skill? I'm pretty sure I've spoken to them on the phone many times.

Can't say - I've never tried to speak with @Ethan over the phone.

...and what do you call the robot which can't/won't operate by phone, 
and takes a week to respond to your email - and then often by asking for 
information previously provided, eg a certain book-seller's "Mr Neil 
would you please confirm that your voucher number is 12345?"



However, on the Turing machine side, I recall creating an abbreviated 
version for a University Open Day - way back in the seventies and when 
VDU-terminals were a novelty and thus curiosities.


The program worked in similar manner to the famous "Eliza" 
(https://en.wikipedia.org/wiki/ELIZA) - attempting to give an illusion 
of understanding and conversation. It stored a mere top-twenty phrases. 
When the user entered some text, it would randomly select one of these 
and 'reply'. The user was invited to give feedback, ie whether it was a 
good reply or not. These were used to score/grade the phrases. Then the 
user's data-entry was added to the 'database of phrases' in place of the 
existing phrase with the lowest score. Thus the conversation continued.


'On the day', many of our visitors were convinced that either the 
computer was capable of holding a conversation (à la Turing), or that 
there was a person hidden-away somewhere, providing the 'answers'.


Most telling, reviewing the 'database' at the end, showed twenty of the 
most innocuous phrases in English conversation - those which were so 
multi-purpose that they could be used in almost any situation (phatic 
phrases: https://en.wikipedia.org/wiki/Phatic_expression).


You be sure to have a nice day, now!
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


[issue41265] lzma/bz2 module: inefficient buffer growth algorithm

2020-07-22 Thread Ma Lin


Ma Lin  added the comment:

I'm working on a patch.
lzma decompressing speed increases:

baseline: 0.275722 sec
patched:  0.140405 sec
(Uncompressed data size 52.57 MB)


The new algorithm looks like this:

#define INITIAL_BUFFER_SIZE (16*1024)

static inline Py_ssize_t
get_newsize(Py_ssize_t size)
{
const Py_ssize_t MB = 1024*1024;
const Py_ssize_t GB = 1024*1024*1024;

if (size <= 1*MB) {
return size << 2;   // x4
} else if (size <= 128*MB) {
return size << 1;   // x2
} else if (size <= 1*GB) {
return size + (size >> 1);  // x1.5
} else if (size <= 2*GB) {
return size + (size >> 2);  // x1.25
} else {
return size + (size >> 3);  // x1.125
}
}

--

___
Python tracker 

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



Re: Spam, bacon, sausage and Spam (was: EuroPython 2020: Data Science Track)

2020-07-22 Thread Cameron Simpson
On 22Jul2020 15:00, Christian Heimes  wrote:
>Hi MAL,
>
>would it be possible to reduce the amount of EuroPython spam on
>@python.org mailing lists to a sensible level? This mailing list is a
>general discussion list for the Python programming language. It's not a
>conference advertisement list.
>
>Something between 1 to 3 mails per conference and year (!) sounds
>sensible to me. [...]

I, OTOH, am unperturbed.

Things have been much in flux this year, and a last minute short notice 
thing like this post needs wide dissemination. Normally a conference 
needs few posts, but this year everything is different and plans have 
changed a lot, on the fly.

I have never attended EuroPython and probably never will (I'm on the 
other side of the planet) but I'm still interested. Rather than 
subscribe to every conference thing, getting them here is very 
convenient.

As with all posters and topics, a truly annoying one can always be 
blocked at your personal discretion with a filter rule, eg to discard 
"europython". I know that advice verges on the spammers' claim that "you 
can always opt out" but for me this stuff isn't spam.

Cheers,
Cameron Simpson  (formerly c...@zip.com.au)
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Chris Angelico
On Thu, Jul 23, 2020 at 9:17 AM dn via Python-list
 wrote:
> However, questions remain:-
>
> Robot: any machine or mechanical device that operates automatically with
> humanlike skill
>

What about a human that operates mechanically with merely robot-like
skill? I'm pretty sure I've spoken to them on the phone many times.

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


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread dn via Python-list

On 23/07/2020 10:46, Ethan Furman wrote:

On 7/22/20 2:57 PM, Jeff Linahan wrote:


Subscribing to the mailing list as per the bot's request and resending.


*beep* *whir*

WE ARE NOT

*click* *whi*

A BOT.

*bzzzt*

WE ARE

*bzzzt* *click*

ADVANCED LIFE

*whi*

FORMS

*click*

*beep*

.

--
~eTHAN~
pYTHON lIST mODERATOR
NoT a BoT  (i ThInK...)



Enjoyed the joke!
(and thanks for all the efforts you exert on our behalf)


However, questions remain:-

Robot: any machine or mechanical device that operates automatically with 
humanlike skill


See also, Turing Machine 
(https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/turing-machine/one.html)

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


Re: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread dn via Python-list

On 23/07/2020 10:33, Chris Angelico wrote:

-- Forwarded message -
From: Jeff Linahan 



See attached image.  Would be nice if it printed "SyntaxError: unbalanced
parens" as it can difficult to see the problem if code like this is run in
an environment that only prints the problematic line, which in this case
the compiler is confused and one line off.


Thing is, the syntax error isn't the unbalanced parenthesis, because
you can quite happily span multiple lines:



But if you have a keyword inside there, it won't work:



The parser can't figure out which one is wrong, so it simply reports
the error at the point where it finds it. As a general rule, if you're
pointed to a line that looks fine, try looking above it. (And that's
not just for Python - many many programming languages exhibit this
same behaviour, for the same reason.)



This may change when the new PEG-parser brings us Python 3.9 
(https://www.python.org/dev/peps/pep-0617/)


I'm looking forward to seeing how this change will impact/improve the 
quality of feedback/traces/err.msgs...



OP: you may be interested in SuperHELP - Help for Humans!
https://github.com/grantps/superhelp
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Kyle Stanley
>
> *beep* *whir*
>
> WE ARE NOT
>
> *click* *whi*
>
> A BOT.


*dial up noises*

SPEAK FOR YOURSELF


On Wed, Jul 22, 2020 at 6:46 PM Ethan Furman  wrote:

> On 7/22/20 2:57 PM, Jeff Linahan wrote:
>
> > Subscribing to the mailing list as per the bot's request and resending.
>
> *beep* *whir*
>
> WE ARE NOT
>
> *click* *whi*
>
> A BOT.
>
> *bzzzt*
>
> WE ARE
>
> *bzzzt* *click*
>
> ADVANCED LIFE
>
> *whi*
>
> FORMS
>
> *click*
>
> *beep*
>
> .
>
> --
> ~eTHAN~
> pYTHON lIST mODERATOR
> NoT a BoT  (i ThInK...)
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Joe Pfeiffer
Jeff Linahan  writes:
>
> See attached image.  Would be nice if it printed "SyntaxError: unbalanced
> parens" as it can difficult to see the problem if code like this is run in
> an environment that only prints the problematic line, which in this case
> the compiler is confused and one line off.

It would be indeed be nice, but it's reporting the error when it finds
it.  Suppose you were typing the program in at the console -- how could
it possibly go back and report the error on the previous line?  Given
python's syntax, does the error even really exist yet on that
previous line?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Ethan Furman

On 7/22/20 2:57 PM, Jeff Linahan wrote:


Subscribing to the mailing list as per the bot's request and resending.


*beep* *whir*

WE ARE NOT

*click* *whi*

A BOT.

*bzzzt*

WE ARE

*bzzzt* *click*

ADVANCED LIFE

*whi*

FORMS

*click*

*beep*

.

--
~eTHAN~
pYTHON lIST mODERATOR
NoT a BoT  (i ThInK...)
--
https://mail.python.org/mailman/listinfo/python-list


[issue41372] Log exception never retrieved in concurrent.futures

2020-07-22 Thread Bar Harel


Change by Bar Harel :


--
nosy: +bquinlan, pitrou

___
Python tracker 

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



[issue41357] pathlib.Path.resolve incorrect os.path equivalent

2020-07-22 Thread Jeffrey Kintscher


Jeffrey Kintscher  added the comment:

I uploaded a script illustrating the differences between how Path.resolve(), 
os.path.abspath(), and os.path.realpath() handle symlinks.  As noted by 
Jendrik, Path.resolve() and os.path.realpath() both resolve symlinks, while 
os.path.abspath() does not.  The documentation needs to be updated.  I will 
generate a pull request.

Example run on the master branch:

python version:
3.9.0a0 (heads/master-dirty:f69d5c6198, Jul 16 2019, 12:38:41) 
[Clang 10.0.1 (clang-1001.0.46.4)]

tdir1: /var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1
creating tdir1
tdir2: /var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo2
creating tdir2 as symlink to tdir1
Path(tdir1).resolve(): 
/private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1
Path(tdir2).resolve(): 
/private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1
os.path.abspath(tdir1): 
/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1
os.path.abspath(tdir2): 
/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo2
os.path.realpath(tdir1): 
/private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1
os.path.realpath(tdir2): 
/private/var/folders/w7/mxt827716xs7_3wbk3mqwd3hgn/T/tmpyj7juuca/foo1

--
Added file: https://bugs.python.org/file49333/bpo-41537-test.py

___
Python tracker 

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



[issue41372] Log exception never retrieved in concurrent.futures

2020-07-22 Thread Bar Harel


New submission from Bar Harel :

Asyncio has an amazing mechanism showing "Task exception was never retrieved" 
or "Future exception was never retrieved" if the task threw an exception, and 
no one checked its `.result()` or `.exception()`.

It does so by setting a private variable named `__log_traceback` to False upon 
retrieval, and logging at `__del__` if the exception wasn't retrieved.

I believe it's a very important mechanism missing from concurrent.futures. It's 
very easy to implement.

I wanted to see if there's any disagreement before I implement it though. It's 
small enough to not need python-ideas yet important enough for inclusion I 
believe.

Regarding potential issues - I can only see issues with unlikely deadlocks at 
`__del__` (think of a handler taking a lock and this occurs during the handling 
of another log record). Asyncio however already took that bet, and although 
it's less planned for multi-threading, it's still a bet that was totally worth 
it.

--
components: Library (Lib)
messages: 374114
nosy: bar.harel
priority: normal
severity: normal
status: open
title: Log exception never retrieved in concurrent.futures
type: enhancement
versions: Python 3.10

___
Python tracker 

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



Re: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Chris Angelico
On Thu, Jul 23, 2020 at 8:30 AM Jeff Linahan  wrote:
>
> -- Forwarded message -
> From: Jeff Linahan 
> Date: Wed, Jul 22, 2020, 5:23 PM
> Subject: Fwd: [BUG] missing ')' causes syntax error on next line
> To: 
>
>
> Subscribing to the mailing list as per the bot's request and resending.
>
> -- Forwarded message -
> From: Jeff Linahan 
> Date: Wed, Jul 22, 2020, 5:20 PM
> Subject: [BUG] missing ')' causes syntax error on next line
> To: 
>
>
> See attached image.  Would be nice if it printed "SyntaxError: unbalanced
> parens" as it can difficult to see the problem if code like this is run in
> an environment that only prints the problematic line, which in this case
> the compiler is confused and one line off.

The image doesn't get attached. Use text in future.

Thing is, the syntax error isn't the unbalanced parenthesis, because
you can quite happily span multiple lines:

x = func(
a,
b,
c,
)

But if you have a keyword inside there, it won't work:

x = func(
a,
b,
def foo(): pass

The parser can't figure out which one is wrong, so it simply reports
the error at the point where it finds it. As a general rule, if you're
pointed to a line that looks fine, try looking above it. (And that's
not just for Python - many many programming languages exhibit this
same behaviour, for the same reason.)

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


Re: Installing Python 3.8.3 with tkinter

2020-07-22 Thread Ned Deily
On 2020-07-22 06:20, Klaus Jantzen wrote:
> Trying to install Python 3.8.3 with tkinter I run configure with the
> following options
> 
> ./configure --enable-optimizations --with-ssl-default-suites=openssl
> --with-openssl=/usr/local --enable-loadable-sqlite-extensions
> --with-pydebug --with-tcltk-libs='-L/opt/ActiveTcl-8.6/lib/tcl8.6'
> --with-tcltk-includes='-I/opt/ActiveTcl-8.6/include'
> 
> Running Python gives the following information
[...]
> How do that correctly?

Try --with-tcltk-libs='-L/opt/ActiveTcl-8.6/lib -ltcl8.6 -ltk8.6'


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


Fwd: [BUG] missing ')' causes syntax error on next line

2020-07-22 Thread Jeff Linahan
-- Forwarded message -
From: Jeff Linahan 
Date: Wed, Jul 22, 2020, 5:23 PM
Subject: Fwd: [BUG] missing ')' causes syntax error on next line
To: 


Subscribing to the mailing list as per the bot's request and resending.

-- Forwarded message -
From: Jeff Linahan 
Date: Wed, Jul 22, 2020, 5:20 PM
Subject: [BUG] missing ')' causes syntax error on next line
To: 


See attached image.  Would be nice if it printed "SyntaxError: unbalanced
parens" as it can difficult to see the problem if code like this is run in
an environment that only prints the problematic line, which in this case
the compiler is confused and one line off.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41317] sock_accept() does not remove server socket reader on cancellation

2020-07-22 Thread Alex Grönholm

Change by Alex Grönholm :


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

___
Python tracker 

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



[issue41371] test_zoneinfo fails

2020-07-22 Thread doodspav


doodspav  added the comment:

Note:
=
I marked the type as `crash` because during the test run, the first attempt at 
`test_zoneinfo` failed with a segfault

--

___
Python tracker 

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



[issue4630] IDLE: add cursor noblink option

2020-07-22 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +20733
pull_request: https://github.com/python/cpython/pull/21594

___
Python tracker 

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



[issue41317] sock_accept() does not remove server socket reader on cancellation

2020-07-22 Thread Alex Grönholm

Alex Grönholm  added the comment:

Looks like they do – fantastic!

--

___
Python tracker 

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



[issue41357] pathlib.Path.resolve incorrect os.path equivalent

2020-07-22 Thread Jeffrey Kintscher


Change by Jeffrey Kintscher :


--
nosy: +Jeffrey.Kintscher

___
Python tracker 

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



[issue41317] sock_accept() does not remove server socket reader on cancellation

2020-07-22 Thread Alex Grönholm

Alex Grönholm  added the comment:

Sure, it should be a rather straightforward fix. I have to check if the tests 
for the related methods test for proper cancellation semantics. It should be 
even faster if they do.

--

___
Python tracker 

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



[issue41317] sock_accept() does not remove server socket reader on cancellation

2020-07-22 Thread Yury Selivanov


Yury Selivanov  added the comment:

Alex, do you want to submit a PR?

--

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-07-22 Thread Joseph Perez


Joseph Perez  added the comment:

However, PEP 563 will not solve the recursive type alias issue like `A = 
list["A"]` but this is a minor concern.

--

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2020-07-22 Thread pmp-p


Change by pmp-p :


--
nosy: +pmpp

___
Python tracker 

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



[issue33129] Add kwarg-only option to dataclass

2020-07-22 Thread Prakhar Goel


Prakhar Goel  added the comment:

Hi,

As another piece of evidence: I run into this problem _all the time_. Whenever 
I need a field in the parent with a default, I either need to add bogus default 
values for every field in every subclass or just skip the default in the parent.

I'd like to suggest a middle ground:
1. A field level keyword_only option which forces just that field to be a 
kw-only field (for every subclass as well).
2. A class level keyword_only option that does:
2a. False (default) means current behavior where classes are not keyword only 
(but may be forced to be by the field specific arg).
2b. True means all the fields in this class (but not the subclasses!) Would be 
marked as keyword only. This does affect the order of arguments in the init 
method but that seems acceptable given that keyword only parameters are 
conceptually order independent.
2c. None implies that precisely the fields with a default (or default_factory) 
should be keyword only fields.

Thoughts?

--
nosy: +Prakhar Goel

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-07-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think mentioning this in the docs is the best we can do in 3.9, and for 3.10 
the point will be moot. The next release is release candidate 1, so we're well 
past the point where we can implement new functionality.

--

___
Python tracker 

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



[issue41371] test_zoneinfo fails

2020-07-22 Thread doodspav


New submission from doodspav :

Issue:
==
`_lzma` is not built because the required libraries are not available on my 
machine. `test_zoneinfo` assumes it is always available, leading it to crash on 
my machine.

How I build and ran the tests:
==
git clone https://github.com/python/cpython.git  (bpo-41364)
cd cpython
mkdir build && cd build
../configure
make -j8
make test > test_output.txt

Test traceback:
===
  File 
"/home/doodspav/Jetbrains/CLionProjects/cpython/Lib/test/libregrtest/runtest.py",
 line 272, in _runtest_inner
refleak = _runtest_inner2(ns, test_name)
  File 
"/home/doodspav/Jetbrains/CLionProjects/cpython/Lib/test/libregrtest/runtest.py",
 line 223, in _runtest_inner2
the_module = importlib.import_module(abstest)
  File 
"/home/doodspav/Jetbrains/CLionProjects/cpython/Lib/importlib/__init__.py", 
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 1030, in _gcd_import
  File "", line 1007, in _find_and_load
  File "", line 986, in _find_and_load_unlocked
  File "", line 680, in _load_unlocked
  File "", line 790, in exec_module
  File "", line 228, in _call_with_frames_removed
  File 
"/home/doodspav/Jetbrains/CLionProjects/cpython/Lib/test/test_zoneinfo/__init__.py",
 line 1, in 
from .test_zoneinfo import *
  File 
"/home/doodspav/Jetbrains/CLionProjects/cpython/Lib/test/test_zoneinfo/test_zoneinfo.py",
 line 9, in 
import lzma
  File "/home/doodspav/Jetbrains/CLionProjects/cpython/Lib/lzma.py", line 27, 
in 
from _lzma import *
ModuleNotFoundError: No module named '_lzma'

--
components: Tests
files: test_output.txt
messages: 374106
nosy: doodspav
priority: normal
severity: normal
status: open
title: test_zoneinfo fails
type: crash
versions: Python 3.10
Added file: https://bugs.python.org/file49332/test_output.txt

___
Python tracker 

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



[issue41370] PEP 585 and ForwardRef

2020-07-22 Thread Joseph Perez


New submission from Joseph Perez :

PEP 585 current implementation (3.10.0a0) differs from current Generic 
implementation about ForwardRef, as illustrated bellow:
```python
from dataclasses import dataclass, field
from typing import get_type_hints, List, ForwardRef

@dataclass
class Node:
children: list["Node"] = field(default_factory=list)
children2: List["Node"] = field(default_factory=list)

assert get_type_hints(Node) == {"children": list["Node"], "children2": 
List[Node]}
assert List["Node"].__args__ == (ForwardRef("Node"),)
assert list["Node"].__args__ == ("Node",) # No ForwardRef here, so no 
evaluation by get_type_hints
```
There is indeed no kind of ForwardRef for `list` arguments. As shown in the 
example, this affects the result of get_type_hints for recursive types handling.

He could be "fixed" in 2 lines in `typing._eval_type` with something like this :
```python
def _eval_type(t, globalns, localns, recursive_guard=frozenset()):
if isinstance(t, str):
t = ForwardRef(t)
if isinstance(t, ForwardRef):
   ...
```
but it's kind of hacky/dirty.

It's true that this issue will not concern legacy code, 3.9 still being not 
released. So developers of libraries using get_type_hints could add in their 
documentation that `from __future__ import annotations` is mandatory for 
recursive types with PEP 585 (I think I will do it).

By the way, Guido has quickly given his opinion about it in PR 21553: "We 
probably will not ever support this: importing ForwardRef from the built-in 
generic alias code would be problematic, and once from __future__ import 
annotations is always on there's no need to quote the argument anyway." (So 
feel free to close this issue)

--
messages: 374105
nosy: BTaskaya, eric.smith, gvanrossum, joperez, levkivskyi, lukasz.langa, 
vstinner
priority: normal
severity: normal
status: open
title: PEP 585 and ForwardRef
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: True is True / False is False?

2020-07-22 Thread Chris Angelico
On Thu, Jul 23, 2020 at 5:51 AM Tim Chase  wrote:
>
> On 2020-07-22 11:54, Oscar Benjamin wrote:
> >> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase wrote:
> >>> reading through the language specs and didn't encounter
> >>> anything about booleans returned from comparisons-operators,
> >>> guaranteeing that they always return The One True and The One
> >>> False.
> >>
> >> That said, though, a comparison isn't required to return a bool.
> >> If it *does* return a bool, it has to be one of those exact two,
> >> but it could return anything it chooses. But for built-in types
> >> and most user-defined types, you will indeed get a bool.
> >
> > I'm not sure if this is relevant to the question but thought I'd
> > mention concrete examples. A numpy array will return non-bool for
> > both of the mentioned operators
>
> that is indeed a helpful data-point.  Do you know of any similar
> example in the standard library of things where comparison-operators
> return something other than True or False (or None)?
>

Can't think of any (although that doesn't disprove it). Also, nothing
returns None from a comparison, to my knowledge.

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


[issue41341] Recursive evaluation of ForwardRef (and PEP 563)

2020-07-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

Łukasz, can I please have a decision on whether to backport this bugfix to 3.9?

See my comment about that:
https://github.com/python/cpython/pull/21553#pullrequestreview-452895735

--

___
Python tracker 

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



[issue41369] Update to libmpdec-2.5.1

2020-07-22 Thread Stefan Krah


Stefan Krah  added the comment:


New changeset 9b9f1582753979f38d2fd927cddf0621a65e9ed6 by Stefan Krah in branch 
'master':
bpo-41369 Update to libmpdec-2.5.1: new features (GH-21593)
https://github.com/python/cpython/commit/9b9f1582753979f38d2fd927cddf0621a65e9ed6


--

___
Python tracker 

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



Re: True is True / False is False?

2020-07-22 Thread Tim Chase
On 2020-07-22 11:54, Oscar Benjamin wrote:
>> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase wrote:  
>>> reading through the language specs and didn't encounter
>>> anything about booleans returned from comparisons-operators,
>>> guaranteeing that they always return The One True and The One
>>> False.  
>>
>> That said, though, a comparison isn't required to return a bool.
>> If it *does* return a bool, it has to be one of those exact two,
>> but it could return anything it chooses. But for built-in types
>> and most user-defined types, you will indeed get a bool.  
> 
> I'm not sure if this is relevant to the question but thought I'd
> mention concrete examples. A numpy array will return non-bool for
> both of the mentioned operators

that is indeed a helpful data-point.  Do you know of any similar
example in the standard library of things where comparison-operators
return something other than True or False (or None)?

Thanks,

-tkc


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


[issue41341] Recursive evaluation of ForwardRef (and PEP 563)

2020-07-22 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 653f420b53a3aa87316cef59de8d3f5d9e11deb4 by wyfo in branch 
'master':
bpo-41341: Recursive evaluation of ForwardRef in get_type_hints (#21553)
https://github.com/python/cpython/commit/653f420b53a3aa87316cef59de8d3f5d9e11deb4


--

___
Python tracker 

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



[issue41369] Update to libmpdec-2.5.1

2020-07-22 Thread Stefan Krah


Change by Stefan Krah :


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

___
Python tracker 

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



[issue41369] Update to libmpdec-2.5.1

2020-07-22 Thread Stefan Krah


New submission from Stefan Krah :

This issue tracks the update of the included libmpdec to version 2.5.1.

The version includes features required for #41324.

--
assignee: skrah
components: Extension Modules
messages: 374101
nosy: skrah
priority: normal
severity: normal
status: open
title: Update to libmpdec-2.5.1
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue41368] Allow compiling Python with llvm-clang on Windows.

2020-07-22 Thread William Pickard


William Pickard  added the comment:

Note: Apparently Google-OpenID login button created a seperate account... 
instead of finding this one.

--
nosy: +WildCard65 -William Pickard

___
Python tracker 

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



ANN: Lea 3.3.0 released

2020-07-22 Thread pie.denis
Lea 3.3.0 is now released!
---> http://pypi.org/project/lea/3.3.0

What is Lea?

Lea is a Python module aiming at working with discrete probability
distributions in an intuitive way.

It allows you modeling a broad range of random phenomena: gambling, weather,
finance, etc. More generally, Lea may be used for any finite set of discrete
values having known probability: numbers, booleans, date/times, symbols, ...
Each probability distribution is modeled as a plain object, which can be
named, displayed, queried or processed to produce new probability
distributions. Lea also provides advanced functions, machine learning and
Probabilistic Programming (PP) features; these include conditional
probabilities, Bayesian networks, joint probability distributions, Markov
chains, EM algorithm and symbolic computation. Lea can be used for AI, PP,
gambling, education, etc.

LGPL - Python 2.6+ / Python 3 supported

What's new in Lea 3.3.0?

The version 3.3.0 extends Lea with advanced Monte-Carlo algorithms, for
dealing with problems intractable for exact resolution. These are described
in a dedicated page of the wiki:
http://bitbucket.org/piedenis/lea/wiki/Lea3_Tutorial_3#markdown-header-appro
ximate-inference-by-monte-carlo-approaches
This version contains also a couple of improvements on usability.

To learn more...

Lea 3 on PyPI -> http://pypi.org/project/lea
Lea project page  -> http://bitbucket.org/piedenis/lea
Documentation -> http://bitbucket.org/piedenis/lea/wiki/Home
Statues algorithm ->
http://link.springer.com/chapter/10.1007/978-3-030-52246-9_10

With the hope that Lea can make this Universe less infectious,

Pierre Denis
___
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


[issue41368] Allow compiling Python with llvm-clang on Windows.

2020-07-22 Thread William Pickard


New submission from William Pickard :

Since Visual Studio 2017, Microsoft has an optional C++ Desktop Development 
option for compiling C/C++ code with LLVM's Clang compiler.

It's called: Clang with Microsoft CodeGen.
While the code is parsed with LLVM's Clang parser, the code is generated with a 
MSVC compatible code generator (hence the "with Microsoft CodeGen" name suffix)

Currently, Python 3.10 is uncompilable with Clang, but I would appreciate it if 
it can be supported.

I have attached a build log from MSBuild, below is the commandline I used to 
run the build.

Start-Process -FilePath $(Join-Path $PCBUILD -ChildPath 'build.bat' -Resolve) 
-WorkingDirectory $PCBuild -NoNewWindow -RedirectStandardOut $BUILD_LOG 
-RedirectStandardError $BUILDERROR_LOG -ArgumentList '-m', '-v', '-c', 'Debug', 
'-p', 'x64', '-t', 'Build', '"/p:PlatformToolset=ClangCL"'
PS L:\GIT\cpython> Start-Process -FilePath $(Join-Path $PCBUILD -ChildPath 
'build.bat' -Resolve) -WorkingDirectory $PCBuild -NoNewWindow 
-RedirectStandardOut $BUILD_LOG -RedirectStandardError $BUILDERROR_LOG 
-ArgumentList '-m', '-v', '-c', 'Debug', '-p', 'x64', '-t', 'Build', 
'"/p:PlatformToolset=ClangCL"'

--
components: Cross-Build, Windows
files: build.log
messages: 374099
nosy: Alex.Willmer, William Pickard, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Allow compiling Python with llvm-clang on Windows.
type: compile error
versions: Python 3.10
Added file: https://bugs.python.org/file49331/build.log

___
Python tracker 

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



[issue41365] Python Launcher is sorry to say... No pyvenv.cfg file

2020-07-22 Thread Eryk Sun


Eryk Sun  added the comment:

> "Python Launcher is sorry to say... No pyvenv.cfg file" 

As already mentioned, that it fails with this error means you're running a 
virtual-environment launcher instead of a base Python executable. That it 
displays a message box means you ran a GUI pythonw.exe virtual-environment 
launcher. pyvenv.cfg is a configuration file that the virtual-environment 
launcher looks for beside the executable, or one directory up. It tells the 
launcher where to find the base python[w].exe executable.

As already suggested, you should associate .py[w] scripts with the "Python" app 
that depicts a rocket/shuttle being launched on its icon. This will associate 
.py[w] scripts with the py[w].exe launcher, and it also associates them with a 
shell drop handler that allows files to be dragged and dropped on a script icon 
in Explorer.

--
nosy: +eryksun

___
Python tracker 

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



[issue41100] Build failure on macOS 11 (beta)

2020-07-22 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue41365] Python Launcher is sorry to say... No pyvenv.cfg file

2020-07-22 Thread Chuck


Chuck  added the comment:

Does anyone know why when Python Launcher is executed by double clicking on the 
Python script called ecrypt_bitcoinj_seed.pyw a small window pops of stating... 
"Python Launcher is sorry to say... No pyvenv.cfg file" as in the image? Why 
wouldn't the pyvenv.cfg file NOT get created like it's supposed to.  After 
doing a search for it on C: drive it is not found.  If anyone has a copy of the 
file, would you please provide it and also tell me the folder to place it in? 
Thank you

--
Added file: https://bugs.python.org/file49330/screenshot.png

___
Python tracker 

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



[issue37095] [Feature Request]: Add zstd support in tarfile

2020-07-22 Thread Wicher Minnaard


Change by Wicher Minnaard :


--
nosy: +wicher

___
Python tracker 

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-07-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

> It should also include 0x20 (space) since that can also be used to manipulate 
> the request.

Can you indicate how to use a space in the HTTP verb as part of an attack?

--

___
Python tracker 

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



[issue41335] free(): invalid pointer in list_ass_item() in Python 3.7.3

2020-07-22 Thread Howard A. Landman


Howard A. Landman  added the comment:

This is not a memory leak problem. "Top" reports VIRT 21768 RES 13516 for the 
whole run, and Python internal resource reporting says 13564 kb for the whole 
run. So that's less than 1 kb leaked in 118.6M measurement cycles; most likely 
zero.

--

___
Python tracker 

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



[issue41365] Python Launcher is sorry to say... No pyvenv.cfg file

2020-07-22 Thread Chuck


Chuck  added the comment:

Mr. Dower, I apologize for not being more specific... since this is Windows 
based and not console driven, the file used for execution should be pythonw.exe 
according to the instructions at 
https://github.com/gurnec/decrypt_bitcoinj_seed so I right clicked on 
decrypt_bitcoinj_seed.pyw and went to properties and changed it's association 
to pythonw.exe so it would run in a non-console manner.  After doing this 
however, it still didn't work with the error "No pyvenv.cfg file".  Would I 
still follow your instructions, choosing Python instead of pythonw.exe?  Do you 
happen to know why the pyvenv.cfg never got created in the first place?  After 
all, when I do a search it's no where to be found on my C: drive.

--

___
Python tracker 

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



[issue39603] [security] http.client: HTTP Header Injection in the HTTP method

2020-07-22 Thread Max


Max  added the comment:

I've just noticed an issue with the current version of the patch. It should 
also include 0x20 (space) since that can also be used to manipulate the request.

--

___
Python tracker 

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



Re: Python Program Help

2020-07-22 Thread Elias Fotinis

On 21/07/2020 22:25, Terry Reedy wrote:
The only way I discovered to get that error, on Windows, is to hit 
control-D in response to the prompt.


Slight correction: On Windows, EOF is signaled with Ctrl-Z. This is the 
same as hitting F6 in the legacy console (can't check with Win10 at the 
moment, but I believe it's the same there).


Ctrl-D (the Unixy EOF) is returned simply as '\x04' on Windows.

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


Installing Python 3.8.3 with tkinter

2020-07-22 Thread Klaus Jantzen

Hi,

Trying to install Python 3.8.3 with tkinter I run configure with the 
following options


./configure --enable-optimizations --with-ssl-default-suites=openssl 
--with-openssl=/usr/local --enable-loadable-sqlite-extensions 
--with-pydebug --with-tcltk-libs='-L/opt/ActiveTcl-8.6/lib/tcl8.6' 
--with-tcltk-includes='-I/opt/ActiveTcl-8.6/include'


Running Python gives the following information

Python 3.8.3 (default, Jul 22 2020, 11:52:15)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> import tkinter
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.8/tkinter/__init__.py", line 36, in 
    import _tkinter # If this fails your Python may not be configured 
for Tk

ModuleNotFoundError: No module named '_tkinter'
>>>

Obviously there is something wrong with my configure options.

How do that correctly?

Thanks for any help.

K.D.J.


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


Re: Upgrade from Python 3.6 to 3.8 and cx-freeze is not available more

2020-07-22 Thread Souvik Dutta
Py2exe might help in making .exe files

On Tue, Jul 21, 2020, 11:42 PM Christian SCHEIBER / KLS GmbH <
c...@kls-system.de> wrote:

>
>
> I’d like to do exe files, so the pythin interpreter has not tob e
> installed.
>
> That’s why I use cx-freeze, but installing Python 3.8 after using Python
> 3.6
> does not work.
>
>
>
> Can you tell me how I can make cx-freeze in Python 3.8 or how I can produce
> exe files for Windows 7 32 / 64 Bit and Win10?
>
> Thanx in advance
>
>
>
>
>
> Mit freundlichen Grüßen
>
>
>
> Christian Scheiber
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Spam, bacon, sausage and Spam (was: EuroPython 2020: Data Science Track)

2020-07-22 Thread Christian Heimes
Hi MAL,

would it be possible to reduce the amount of EuroPython spam on
@python.org mailing lists to a sensible level? This mailing list is a
general discussion list for the Python programming language. It's not a
conference advertisement list.

Something between 1 to 3 mails per conference and year (!) sounds
sensible to me. You have posted 21 new threads about EP 2020 since
January on this list, thereof 5 threads this month. In comparison I
could only find two ads for other conferences in the last 12 month
(FlaskCon, PyCon TZ).

Christian

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


[issue41365] Python Launcher is sorry to say... No pyvenv.cfg file

2020-07-22 Thread Steve Dower


Steve Dower  added the comment:

It seems like you're trying to launch the python.exe that is created for a 
virtual environment rather than the actual one. This probably means that at 
some point you created a virtual environment and updated your file association 
to launch it.

The best thing to do is to right-click your .pyw file, choose "Open With", 
"Choose another app", enable "Always open ..." and choose "Python" from its 
list (the icon should have a space shuttle being launched). That will switch 
you back to the original file association.

--

___
Python tracker 

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



[issue41364] Optimise uuid platform detection

2020-07-22 Thread Steve Dower


Steve Dower  added the comment:


New changeset a18f22ab11a7bfb5ff3e74c737ca9e1bebe4abf9 by Steve Dower in branch 
'3.8':
bpo-41364: Reduce import overhead of uuid module (GH-21586)
https://github.com/python/cpython/commit/a18f22ab11a7bfb5ff3e74c737ca9e1bebe4abf9


--

___
Python tracker 

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



[issue41364] Optimise uuid platform detection

2020-07-22 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



Re: True is True / False is False?

2020-07-22 Thread Oscar Benjamin
On Wed, 22 Jul 2020 at 02:12, Chris Angelico  wrote:
>
> On Wed, Jul 22, 2020 at 11:04 AM Tim Chase
>  wrote:
> >
> > I know for ints, cpython caches something like -127 to 255 where `is`
> > works by happenstance based on the implementation but not the spec
> > (so I don't use `is` for comparison there because it's not
> > guaranteed by the language spec). On the other hand, I know that None
> > is a single object that can (and often *should*) be compared using
> > `is`. However I spent some time reading through the language specs and
> > didn't encounter anything about booleans returned from
> > comparisons-operators, guaranteeing that they always return The One
> > True and The One False.
...
>
> That said, though, a comparison isn't required to return a bool. If it
> *does* return a bool, it has to be one of those exact two, but it
> could return anything it chooses. But for built-in types and most
> user-defined types, you will indeed get a bool.

I'm not sure if this is relevant to the question but thought I'd
mention concrete examples. A numpy array will return non-bool for both
of the mentioned operators:


In [2]: import numpy as np

In [3]: a = np.array([2, 2, 2])

In [4]: a == a
Out[4]: array([ True,  True,  True])

In [5]: a > 4
Out[5]: array([False, False, False])


With sympy expressions == will strictly always return a bool but
inequality operators can return instances of Relational. When they can
be evaluated those will give sympy's Booleans rather than bool.


In [6]: import sympy as sym

In [7]: x = sym.Symbol('x')

In [8]: x > 0
Out[8]: x > 0

In [9]: type(_)
Out[9]: sympy.core.relational.StrictGreaterThan

In [10]: (x > 0).subs(x, 2)
Out[10]: True

In [11]: type(_)
Out[11]: sympy.logic.boolalg.BooleanTrue


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


[issue40979] typing module docs: keep text, add subsections

2020-07-22 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

FWIW I like Guido's suggestion in the PR, I would rather use "importance order" 
than alphabetical order.

--

___
Python tracker 

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



EuroPython 2020: Data Science Track

2020-07-22 Thread M.-A. Lemburg
We are excited to announce a complete two day data science track at
EuroPython 2020 Online, happening on Thursday and Friday (July 23 -
24).

Yes, that’s starting tomorrow. Sorry for the short notice :-)


  * Data Science @ EuroPython 2020 *

  https://ep2020.europython.eu/events/data-science/


The data science track is part of EuroPython 2020, so you won’t need
to buy an extra ticket to attend.

We will have a two day track featuring more than 20 keynotes,
full-length talks and posters:

- Keynotes in the Microsoft Room
- Talks in the Parrot Room
- Posters in the Poster Rooms

The full program is available on our data science page:

https://ep2020.europython.eu/events/data-science/

If you’d like to attend the data science track at EuroPython 2020,
please register for EuroPython 2020 soon.


Dates and Registration
--

EuroPython 2020 will be held online from July 23-26 2020. You can
register on our website:

https://ep2020.europython.eu/registration/buy-tickets/

If you want to learn more about the online setup, please check the
Setup section on our website:

https://ep2020.europython.eu/setup/online-conference/

After buying a ticket, please register on our Discord server,
following the instructions in the order confirmation email.

You will even be able to buy tickets on the days themselves, however,
please be aware that this may cause delays in your Discord signup.

Please see our website for more information.


Help spread the word


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

Link to the blog post:

https://blog.europython.eu/post/624331411913146368/europython-2020-data-science-track

Tweet:

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

Thanks,
--
EuroPython 2020 Team
https://ep2020.europython.eu/
https://www.europython-society.org/
___
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/
Member address: arch...@mail-archive.com


EuroPython 2020: Data Science Track

2020-07-22 Thread M.-A. Lemburg
We are excited to announce a complete two day data science track at
EuroPython 2020 Online, happening on Thursday and Friday (July 23 -
24).

Yes, that’s starting tomorrow. Sorry for the short notice :-)


  * Data Science @ EuroPython 2020 *

  https://ep2020.europython.eu/events/data-science/


The data science track is part of EuroPython 2020, so you won’t need
to buy an extra ticket to attend.

We will have a two day track featuring more than 20 keynotes,
full-length talks and posters:

- Keynotes in the Microsoft Room
- Talks in the Parrot Room
- Posters in the Poster Rooms

The full program is available on our data science page:

https://ep2020.europython.eu/events/data-science/

If you’d like to attend the data science track at EuroPython 2020,
please register for EuroPython 2020 soon.


Dates and Registration
--

EuroPython 2020 will be held online from July 23-26 2020. You can
register on our website:

https://ep2020.europython.eu/registration/buy-tickets/

If you want to learn more about the online setup, please check the
Setup section on our website:

https://ep2020.europython.eu/setup/online-conference/

After buying a ticket, please register on our Discord server,
following the instructions in the order confirmation email.

You will even be able to buy tickets on the days themselves, however,
please be aware that this may cause delays in your Discord signup.

Please see our website for more information.


Help spread the word


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

Link to the blog post:

https://blog.europython.eu/post/624331411913146368/europython-2020-data-science-track

Tweet:

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

Thanks,
--
EuroPython 2020 Team
https://ep2020.europython.eu/
https://www.europython-society.org/

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


[issue41367] Popen Timeout raised on 3.6 but not on 3.8

2020-07-22 Thread Joan Prat Rigol


New submission from Joan Prat Rigol :

If I run this code in Python 3.8 I get the result as expected:

Python 3.8.2 (default, Apr 27 2020, 15:53:34) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> process = subprocess.Popen("sudo -Si ls -l /home", shell=True, stdin=-1, 
>>> stdout=-1, stderr=-1)
>>> out, err = process.communicate(input="Pr4tR1g01J04n\n".encode(), timeout=2)
>>> print(out)
b'total 4\ndrwxr-xr-x 43 joan joan 4096 Jul 22 09:46 joan\n'
>>> 
But If I run the code in Python 3.6 I am getting a timeout:

Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> process = subprocess.Popen("sudo -Si ls -l /home", shell=True, stdin=-1, 
>>> stdout=-1, stderr=-1)
>>> out, err = process.communicate(input="Pr4tR1g01J04n\n".encode(), timeout=2)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.6/subprocess.py", line 863, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
  File "/usr/lib/python3.6/subprocess.py", line 1535, in _communicate
self._check_timeout(endtime, orig_timeout)
  File "/usr/lib/python3.6/subprocess.py", line 891, in _check_timeout
raise TimeoutExpired(self.args, orig_timeout)
subprocess.TimeoutExpired: Command 'sudo -Si ls -l /home' timed out after 2 
seconds
>>> 
Is this a bug?

--
messages: 374089
nosy: Joan Prat Rigol
priority: normal
severity: normal
status: open
title: Popen Timeout raised on 3.6 but not on 3.8
versions: Python 3.6, Python 3.8

___
Python tracker 

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



[issue41358] Unable to uninstall Python launcher using command line

2020-07-22 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue41356] Convert bool.__new__ to argument clinic

2020-07-22 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

More microbenchmarks:

pyperf timeit "bool()"
Before: 63.1 ns +- 0.7 ns
After:  51.7 ns +- 1.2 ns

pyperf timeit "bool(0)"
Before: 77.4 ns +- 1.9 ns
After:  67.2 ns +- 1.3 ns

pyperf timeit "bool(17)"
Before: 77.3 ns +- 2.3 ns
After:  67.1 ns +- 1.0 ns

--

___
Python tracker 

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



[issue41361] Converting collections.deque methods to Argument Clinic

2020-07-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I think we should skip applying the clinic to the code. It jumbles the code 
quite a bit but doesn't give any real benefit.

--
resolution:  -> not a bug
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue41361] Converting collections.deque methods to Argument Clinic

2020-07-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger

___
Python tracker 

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