[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-18 Thread Tim Peters


Tim Peters  added the comment:

I confess I _assumed_ all along that you were generalizing the current code's 
Sunday trick to 7-bit equivalence classes (up from 32 bits total) and 64K 
possible shift counts (up from just 2 total possibilities: 1 or len(needle)+1). 
The Sunday trick couldn't care less where or when the mismatch occurs, just 
that a mismatch occurred somewhere.

In my head I was picturing the paper's code, not the PR.  Whenever it makes a 
shift, it could compare it to the "Sunday-ish shift", and pick the larger.  
That should have no effect on worst case O() behavior - it would always shift 
at least as much as Crochempre-Perrin when a mismatch was hit.

I can't say how it would relate to details of the PR's spelling, because I'm 
still trying to fully understand the paper ;-) I don't believe I can usefully 
review the code before then.

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I posted the example thinking that having a concrete walkthrough might be good 
for discussion, and it looks like it was. ;-)

This makes me curious how a simplified-but-not-as-simplified-as-the-status-quo 
Sunday algorithm would fare: using the Sunday algorithm, but with a shift 
lookup modulo 128 rather than a boolean lookup. It might not be provably O(n), 
but it might be faster for some cases. Although if the common case is already 
fast enough, maybe we do want a provably-linear algorithm for the big stuff.

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> Dennis, I think that's expected, right? Two-way on its own can exploit 
> nothing about individual characters - it only preprocesses the needle to 
> break the possibility for quadratic-time behavior due to periods in the 
> needle.

Yes, that's correct.

> It sounds like you switched the current code's Sunday-ish approach to a more 
> Boyer-Moore-ish approach. That probably hurt, and especially for shorter 
> needles (where Sunday can yield a maximum shift of len(needle)+1, not 
> len(needle) - the "+1" is more significant the smaller len(needle)).

I'm definitely open to switching things up, but I'm not totally sure there 
would be a difference. In Sunday, the pattern is somehow scanned at each step, 
and then upon finding a mismatch, we look up in the table the first character 
outside the window. With the PR as written, when looking up in the table the 
last character of the window, we haven't actually produced a mismatch yet; the 
'continue' statements jump ahead *until* the last characters match (mod 128), 
and then the two-way scanning begins, which determines how the window gets 
shifted after that. But after this two-way-determined shift, the last character 
in the new window immediately gets looked up again in the table at the top of 
the loop, effectively letting the two-way shift immediately be extended to a 
longer shift. I suppose that the line `j += i - suffix + 1;` (which is very 
often an increment by 1) could be changed to a table lookup of the character 
just beyond the window, but I don't quite understand why that would b
 e better than incrementing j and then doing the table lookups at the top of 
the loop.

--

___
Python tracker 

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



[issue40814] Update typing module documentation based on PEP 585

2020-10-18 Thread Ken Jin


Ken Jin  added the comment:

The PR should be ready for review now. Thanks for your patience.

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-18 Thread Tim Peters


Tim Peters  added the comment:

Dennis, I think that's expected, right? Two-way on its own can exploit nothing 
about individual characters - it only preprocesses the needle to break the 
possibility for quadratic-time behavior due to periods in the needle.

It sounds like you switched the current code's Sunday-ish approach to a more 
Boyer-Moore-ish approach. That probably hurt, and especially for shorter 
needles (where Sunday can yield a maximum shift of len(needle)+1, not 
len(needle) - the "+1" is more significant the smaller len(needle)).

Sunday gave 3 variants of his basic algorithm, and in his tests they were all 
faster than Boyer-Moore, and more so the shorter the needle.  Just FYI, here's 
a scanned PDF of his paper:

https://csclub.uwaterloo.ca/~pbarfuss/p132-sunday.pdf

--

___
Python tracker 

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



[issue42077] Some absolute domain name not work in urllib

2020-10-18 Thread Zheng SHAO


Change by Zheng SHAO :


--
title: Some Absolute domain name not work in urllib -> Some absolute domain 
name not work in urllib

___
Python tracker 

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



[issue42077] Some Absolute domain name not work in urllib

2020-10-18 Thread Zheng SHAO


New submission from Zheng SHAO :

```
import ssl
import urllib.request

url_string = "https://kubernetes.default.svc.cluster.local./api/;

ctx = ssl._create_unverified_context()

with urllib.request.urlopen(url_string, context=ctx) as f:
f.read()
```

In running this sample code will got a following handshake error,

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1393, in https_open
return self.do_open(http.client.HTTPSConnection, req,
  File "/usr/lib/python3.8/urllib/request.py", line 1353, in do_open
raise URLError(err)
urllib.error.URLError: 

Instead using absolute domain name, using 
`https://kubernetes.default.svc.cluster.local/api/` then the issue solved. I 
also tried other domains like `google.com.`, but in this case the handshake 
process had no errors.

--
components: Library (Lib)
messages: 378919
nosy: axot
priority: normal
severity: normal
status: open
title: Some Absolute domain name not work in urllib
versions: Python 3.8

___
Python tracker 

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



[issue41982] [Python 3.8] Wrong location flagged as syntax error

2020-10-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Closing this as the new parser in Python3.9+ handles this correctly

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

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

FWIW, one of the "# Made the spaces line up" is actually a "skip ahead by the 
needle length".

--

___
Python tracker 

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



[issue41972] bytes.find consistently hangs in a particular scenario

2020-10-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Below is one of the tests that got run when I happened to import something, and 
I thought it was a good illustration of the Boyer-Moore bad character shift 
table.

It's worth noting in particular that the table is the dominant force for speed 
in some common cases, with the two-way stuff only ever being checked once in 
this example. The shift table can be defeated with pathological strings, and 
that's where the two-way stuff begins to shine.

Checking " 32 bit (ARM)" in "3.10.0a1+ (heads/two-way-dirty:cf4e398e94, Oct 18 
2020, 20:09:21) [MSC v.1927 32 bit (Intel)]".

Two-way with needle=" 32 bit (ARM)" and 
haystack="(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 
32 bit (Intel)]"
Split " 32 bit (ARM)" into " 32 bit" and " (ARM)".
needle is NOT completely periodic.
Using period 8.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
> " 32 bit (ARM)"
Last character not found in string.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>  " 32 bit (ARM)"
Table says shift by 11.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
> " 32 bit (ARM)" # Made the '3's line up
Table says shift by 5.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>  " 32 bit (ARM)" # Here made the spaces line up
Last character not found in string.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>   " 32 bit (ARM)" # Made the spaces 
> line up
Checking the right half.
No match.
Jump forward without checking left half.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>" 32 bit (ARM)" # Made the spaces 
> line up
Table says shift by 5.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
> " 32 bit (ARM)" # Made the 
> spaces line up
Table says shift by 5.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>  " 32 bit (ARM)" # Made 
> the spaces line up
Table says shift by 10.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>" 32 bit 
> (ARM)" # Made the spaces line up
Table says shift by 4.
> "(heads/two-way-dirty:cf4e398e94, Oct 18 2020, 20:09:21) [MSC v.1927 32 bit 
> (Intel)]"
>" 32 bit 
> (ARM)" # Made the lparens line up
Last character not found in string.
Reached end. Returning -1.

--

___
Python tracker 

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



[issue40484] Document existing compiler flags under ast

2020-10-18 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40484] Document existing compiler flags under ast

2020-10-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 155938907c2b3df71608ddeaa0a43d2ec1f2c699 by Batuhan Taskaya in 
branch 'master':
bpo-40484: Document compiler flags under AST module (GH-19885)
https://github.com/python/cpython/commit/155938907c2b3df71608ddeaa0a43d2ec1f2c699


--
nosy: +pablogsal

___
Python tracker 

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



[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2020-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

I think you may have meant this issue (which is not related to field()):

from dataclasses import dataclass
from typing import Callable

@dataclass(init=True)
class Foo:
callback: Callable[[int], int] = lambda x: x**2
 
@dataclass(init=False)
class Bar:
callback: Callable[[int], int] = lambda x: x**2

print('Foo().callback:', Foo().callback)
print('Foo().callback(2):', Foo().callback(2))

print('Bar().callback:', Bar().callback)
print('Bar().callback(3):', Bar().callback(3))

Output:
Foo().callback:  at 0x019592F8>
Foo().callback(2): 4
Bar().callback:  of Bar(callback= of ...>)>
Traceback (most recent call last):
  File "C:\Users\User\src\cpython\x.py", line 17, in 
print('Bar().callback(3):', Bar().callback(3))
TypeError: Bar.() takes 1 positional argument but 2 were given

--

___
Python tracker 

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



[issue38947] dataclass defaults behave inconsistently for init=True/init=False when default is a descriptor

2020-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

If I change Foo in your code to:

@dataclass(init=False)
class Foo:
callback: Callable[[int], int] = lambda x: x**2

Then the same TypeError exception is raised for Foo. 

If I then change it back (remove the init=False so that it picks up the default 
value of True), and then change init=True in field:

@dataclass
class Bar:
callback: Callable[[int], int] = field(init=True, default=lambda x: x**2)

Then I get the expected output of 
4
4

What do you consider to be an inconsistency here?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue42075] Verbose/confusing default format on warnings

2020-10-18 Thread Mithil


Mithil  added the comment:

I also ran this on Fedora 32, python 3.8.6 and still got the same result.

--

___
Python tracker 

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



[issue42076] urllib ResourceWarning in case of usage of FTP

2020-10-18 Thread Serhiy Ivanov


New submission from Serhiy Ivanov :

In case when FTP url is successfully connected via default FTPHandler in 
FTPHandler.connect_ftp then release of this stuff becomes total responsibility 
of user i.e. socket remains open, which leads to ResourceWarning in the garbage 
collector, in case if the user does nothing.

Something like this solves issue in user area:

class SafeFTPHandler(urllib.request.FTPHandler):
  ftp_object = None

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

  def connect_ftp(self, user, passwd, host, port, dirs, timeout):
  self.ftp_object = super().connect_ftp(user, passwd, host, port, 
dirs, timeout)
  return self.ftp_object

  def ftp_response(self, req, response):
  self._close_ftp()
  return response

  def ftp_open(self, req):
try:
  return super().ftp_open(req)
except:
  self._close_ftp()
  raise

  def _close_ftp(self):
if self.ftp_object:
self.ftp_object.close()

and further usage in OpenerDirector...

In general case FTPHandler should be able to close immediately (in case if it 
raises as well) while re-using of the socket should be implemented only within 
CacheFTPHandler

--
components: Library (Lib)
messages: 378911
nosy: icegood
priority: normal
severity: normal
status: open
title: urllib ResourceWarning in case of usage of FTP
type: resource usage
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



[issue42075] Verbose/confusing default format on warnings

2020-10-18 Thread Mithil


Mithil  added the comment:

I ran the file that you linked and this is what it printed.

C:\Users\mithi\p\test\file.py:3: UserWarning: Danger danger danger Will 
Robinson!!!
  warnings.warn(

As you see, the warnings.warn( line is not desirable.
More details about my machine -
Windows 10
python 3.9.0

I have also tried running this with Python 3.10.0a1. Same result.

--

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Eryk Sun


Eryk Sun  added the comment:

> For platform semantics, I'd prefer a link to the CreateProcessW docs, 
> with advice to read about the lpApplicationName parameter with 
> respect to `executable` and lpCommandLine with respect to `args` 
> and the platform search semantics. 

For example, let's help someone figure out that because "python3.8" has a ".8" 
filename 'extension', ".exe" may or may not be appended in a search.

>>> print(shutil.which('python3.8'))
C:\Users\someone\AppData\Local\Microsoft\WindowsApps\python3.8.EXE

>>> subprocess.call(['python3.8.exe', '-V'])
Python 3.8.6
0

SearchPathW (called internally by CreateProcessW) won't append the ".exe" 
default extension to a name that already has a ".8" extension:

>>> try: subprocess.call(['python3.8', '-V'])
... except OSError as e: print(e)
...
[WinError 2] The system cannot find the file specified

But with shell=True it works because CMD always appends the PATHEXT extensions 
(thankfully there isn't a "python3.8.com" file to get in the way, since .COM is 
usually listed before .EXE in PATHEXT):

>>> subprocess.call('python3.8 -V', shell=True)
Python 3.8.6
0

SearchPathW does append the default ".exe" extension for a qualified path:

>>> 
subprocess.call([r'C:\Users\someone\AppData\Local\Microsoft\WindowsApps\python3.8',
 '-V'])
Python 3.8.6
0

--

___
Python tracker 

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



[issue42075] Verbose/confusing default format on warnings

2020-10-18 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

3.9 and older are all in feature freeze, so no changes in behaviour will be 
considered for them.

I'm afraid I cannot replicate the behaviour you describe. When I try, the full 
warning message is correctly displayed. See the attached file.

Importing it from the interactive interpreter gives:

>>> import warntest
/home/steve/warntest.py:5: UserWarning: Danger danger danger Will 
Robinson!!!
  "Danger danger danger Will Robinson!!!"


and running it from the commandline:


$ python3 ~/warntest.py 
/home/steve/warntest.py:5: UserWarning: Danger danger danger Will Robinson!!!
  "Danger danger danger Will Robinson!!!"


Can you provide a minimal working example of the issue?

--
nosy: +steven.daprano
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49526/warntest.py

___
Python tracker 

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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2020-10-18 Thread Erik Welch


Change by Erik Welch :


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

___
Python tracker 

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



[issue19072] classmethod doesn't honour descriptor protocol of wrapped callable

2020-10-18 Thread Erik Welch


Change by Erik Welch :


--
nosy: +eriknw
nosy_count: 8.0 -> 9.0
pull_requests: +21721
pull_request: https://github.com/python/cpython/pull/22757

___
Python tracker 

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



[issue42074] setup error on windows

2020-10-18 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi CaptainMitsumoto,

Did you follow the instructions given by the installer to read the log file? We 
don't have access to your log file, only you do. Can you see what file cannot 
be found?

Did you try some basic googling? I'm not a Windows guru, but this:

https://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/0x80070002-the-system-cannot-find-the-file/cad10f8d-79f2-4a10-953f-b85478b3e1b7


suggests that the problem is related to permissions, or your OS installation, 
not to the installer itself. Do you have administrator privileges? Did you 
check your .Net framework? What version of Windows are you using?

If you have already received some suggestions which did not work, would you 
mind telling us what you already tried so we don't waste our time, and yours, 
telling you what you have already tried.

Did you successfully install the older version of Python? If so, there is 
nothing stopping you from coding in 3.8 and upgrading later.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue42074] setup error on windows

2020-10-18 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
components: +Installation -Unicode
type: crash -> behavior

___
Python tracker 

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



[issue42075] Verbose/confusing default format on warnings

2020-10-18 Thread Mithil


New submission from Mithil :

The default format prints a lot of details like filename, line number, and the 
source code on that line. A particular case where the warn message is written 
on the next line like -
warn(
   "Message here")
Will only print warn( as the source code and not the entire block.
My concern is, can this formatting be less detailed by default. Or, can this 
format be freely changed in a project A without worrying about affecting the 
global usage in any other project B that imports it.
Or at the very least, can this be made to print the entire block of code and 
not just the one line, because that makes it very confusing for the user.

More takes on the issue here - https://github.com/PyCQA/isort/issues/1568

--
components: Library (Lib)
messages: 378906
nosy: Mithil
priority: normal
severity: normal
status: open
title: Verbose/confusing default format on warnings
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42074] setup error on windows

2020-10-18 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
title: f***ing setup failed is driving me insane -> setup error on windows

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-10-18 Thread Chris Jerdonek


Change by Chris Jerdonek :


--
pull_requests: +21719
pull_request: https://github.com/python/cpython/pull/22756

___
Python tracker 

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



[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2020-10-18 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

FYI, WIP branch for this bpo is here: 
https://github.com/erlend-aasland/cpython/commits/bpo-42064/all
This currently includes items 1 though 6. I'll update the WIP branch with a 
draft of items 7 and 8, hopefully tomorrow.

--

___
Python tracker 

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



[issue42074] f***ing setup failed is driving me insane

2020-10-18 Thread CaptainMitsumoto


New submission from CaptainMitsumoto :

I am frustrated now. I was about to install Python 3.9.0 in my gaming laptop 
then I get this thing.

I tried to google the hex error and the error name. I tried getting help in 
Python Discord but no good luck, they're weren't any good solutions. I got this 
bug yesterday and I waited 1 day later (which is today) and it still existed. I 
tried installing the old versions before Python 3.9.0, still nope. Wow, this 
crap is driving me crazy, all I wanted to do is to code in Python.

Error: 0x80070002 - The system cannot find the file specified.

--
components: Unicode
files: dsafdsfdsfdsfdsfsafsafsadfsa.PNG
messages: 378904
nosy: ezio.melotti, rikkuguzai, vstinner
priority: normal
severity: normal
status: open
title: f***ing setup failed is driving me insane
type: crash
versions: Python 3.9
Added file: 
https://bugs.python.org/file49525/dsafdsfdsfdsfdsfsafsafsadfsa.PNG

___
Python tracker 

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



[issue42060] Usage of assert in http/client.py

2020-10-18 Thread Vedran Čačić

Vedran Čačić  added the comment:

If I understand correctly, those are _private methods_ (names start with 
underscore). In such cases, asserts can be completely fine, since the library 
writer controls the situations where the method is called. If it is never 
called with _UNKNOWN argument, assert is just that, assertion that it is so. 
(It would be different if it were a public method, since the library writer 
doesn't know it will never be called with _UNKNOWN.)

--
nosy: +veky

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Eryk Sun


Eryk Sun  added the comment:

> You can build a cross-platform wrapper on top of native behaviour 
> (witness `shutil.which`) but you can't do the opposite.

Nothing would prevent adding a parameter to use the platform semantics, if that 
had been in the design from the outset. But it's not something we should change 
at this stage. It's too fundamental.

> I'm not convinced that using `shutil.which` is the right 
> answer for anything other than "python".

Actually, I think shutil.which() is the right answer generally (within the 
filesystem scope) except for "python", for which sys.executable is usually what 
people want, i.e. the current interpreter. A PATH search via 
shutil.which('python') doesn't necessarily find the current interpreter, if 
anything at all. So I'm not arguing against advice to use sys.executable, but 
rather that recommmending shutil.which() should be done in a more generic way 
that's separate from the "python" problem. 

For platform semantics, I'd prefer a link to the CreateProcessW docs, with 
advice to read about the lpApplicationName parameter with respect to 
`executable` and lpCommandLine with respect to `args` and the platform search 
semantics. The CreateProcessW docs are rather long and off-putting, so I think 
it helps to narrow it down for people, and explicitly map between Popen() and 
CreateProcessW parameters.

Over the years, I've come across many forum questions in which novice users 
waste days on problems with respect to Windows quirks that can be resolved in a 
minute or so by someone with knowledge and experience. They get lots of advice 
with good intentions from programmers who only have POSIX experience (the 
Python ecosystem online is still heavily dominated by POSIX, despite the number 
of Windows users), and it's mostly wrong advice and a waste of their time (not 
even a learning experience). Documenting platform inconsistencies helps 
experienced programmers to use the docs in order to help novice programmers. 
It's not necessarily about helping novices directly. Often just a nudge in the 
right direction is enough.

--

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:


New changeset 7c949020ef2520d7a7cbc978f0b34423e6c2a94c by Anthony Sottile in 
branch '3.9':
bpo-40492: Fix --outfile with relative path when the program changes it working 
dir (GH-19910)
https://github.com/python/cpython/commit/7c949020ef2520d7a7cbc978f0b34423e6c2a94c


--

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:


New changeset 1c5a65723e623be32e246f58b8797a263f616295 by Anthony Sottile in 
branch '3.8':
bpo-40492: Fix --outfile with relative path when the program changes it working 
dir (GH-19910)
https://github.com/python/cpython/commit/1c5a65723e623be32e246f58b8797a263f616295


--

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the report and the PR, Stein!

And thanks for the PR for 3.8, Irit!

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:


New changeset 1a3f7c042a32fb813835243bd7f96e47c665bfdc by Irit Katriel in 
branch '3.8':
[3.8] bpo-32498: Improve exception message on passing bytes to 
urllib.parse.unquote (GH-22746)
https://github.com/python/cpython/commit/1a3f7c042a32fb813835243bd7f96e47c665bfdc


--

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:

Many thanks for the report and the PR, Anthony!

Serhiy, do you think it is worth also calling abspath in the profile._Utils as 
you mentioned, for cases where those may be called directly?

--

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Change by Tal Einat :


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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +21718
pull_request: https://github.com/python/cpython/pull/22755

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +21717
pull_request: https://github.com/python/cpython/pull/22754

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +21716
pull_request: https://github.com/python/cpython/pull/22753

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Anthony Sottile


Change by Anthony Sottile :


--
pull_requests: +21715
pull_request: https://github.com/python/cpython/pull/22752

___
Python tracker 

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



[issue42070] I think the rationale to keep IsoCalendarDate private from the pickle perspective should get revisited

2020-10-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

That's a reasonable enough objection, though what use case do you have for 
storing the IsocalendarDate object? The main reason we switched to using a 
named tuple like this was because the vast majority of uses of `isocalendar()` 
that I saw were people doing stuff like `dt.isocalendar()[0]`, rather than 
destructuring the tuple or accessing more than one element from the result.

It seems to me that if you are using a pickle for a cache, you'd either pickle 
the `datetime` itself (and call `.isocalendar()` in the process that has read 
from the cache already), or you'd store one or more of the fields directly on 
the object that you are caching.

A real life use case for this would help.

--

___
Python tracker 

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



[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:


New changeset 3c0ac18504cfeed822439024339d5717f42bdd66 by Anthony Sottile in 
branch 'master':
bpo-40492: Fix --outfile with relative path when the program changes it working 
dir (GH-19910)
https://github.com/python/cpython/commit/3c0ac18504cfeed822439024339d5717f42bdd66


--

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Paul Moore


Paul Moore  added the comment:

Exactly. Why isn't the current directory searched? Why isn't foo/bar searched 
for on PATH? Why is it possible for the user to accidentally remove system 
commands from PATH and lose access to them? Any system is confusing and 
surprising to users only familiar with another system.

And I've had very bad experiences in the past with languages/applications that 
presume to define a "cross-platform" abstraction that ends up just "not 
behaving how I expect a native app to". You can build a cross-platform wrapper 
on top of native behaviour (witness `shutil.which`) but you can't do the 
opposite.

Maybe there's scope for a section in the documentation that discusses how to 
use `subprocess` in a platform-agnostic manner. I'd be OK with that, although 
I'd want it to read along the lines of "these are places where Windows and 
POSIX behave differently" and not "here's some weird stuff Windows does that 
POSIX users need to be aware of" which was how your comment read to me.

Never mind, I think we can just agree to differ on this. It's not likely to 
impact this issue or the PR for it.

--

___
Python tracker 

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



[issue42073] classmethod does not pass "type/owner" when invoking wrapped __get__

2020-10-18 Thread Erik Welch


New submission from Erik Welch :

The following is new to Python 3.9, and I consider the implementation 
incomplete.  I have code that works for Python 3.8 and before, but not for 
Python 3.9:

"Class methods can now wrap other :term:`descriptors ` such as 
:func:`property`."

https://github.com/python/cpython/pull/8405
https://bugs.python.org/issue19072

As implemented, `classmethod` does not correctly wrap descriptors that mimic 
classmethod.  Previously, __get__of wrapped objects wasn't invoked by 
classmethod, so it was safe to have an object with both __call__ and __get__ 
behave like a classmethod.  Now, classmethod calling __get__ first gives 
incorrect results.

Here is a minimal example:
```
from types import MethodType


class myclassmethod:
def __init__(self, func):
self.func = func

def __call__(self, cls):
return self.func(cls)

def __get__(self, instance, owner=None):
if owner is None:
owner = type(instance)
return MethodType(self, owner)


class A:
@myclassmethod
def f1(cls):
return cls

@classmethod
@myclassmethod
def f2(cls):
return cls


assert A.f1() is A
assert A.f2() is A  # <-- fails in 3.9, works in 3.8 and before
```
This pattern would typically be used to do something extra in __call__.

For the sake of discussion, let's call the two arguments to __get__ "instance" 
and "owner".  Typically, "instance" is an instance of "owner", or, 
equivalently, "owner" is the type of "instance".  If "owner" is None, it is 
generally assumed to be the type of "instance".

In bpo19072 (and gh8405), classmethod was changed to call `obj.__get__(owner)` 
if the wrapped object "obj" has __get__.  Notice that only the "instance" 
argument is provided.  Moreover, the type `owner` is passed as the "instance" 
argument.  This means that the "owner" argument (which is None) will be assumed 
to be the type of the "instance" argument, which is the type of the `owner` 
type.  This is wrong.  The "owner" argument should be `owner`.

I believe it would be better for classmethod to call `obj.__get__(owner, 
owner)` if "obj" has __get__.

This is kind of difficult to explain.  I will make a PR with more informative 
tests shortly.  Here is the simple diff to make the above example pass:
```
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index bd24f67b97..74f9167566 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -739,7 +739,7 @@ cm_descr_get(PyObject *self, PyObject *obj, PyObject *type)
 type = (PyObject *)(Py_TYPE(obj));
 if (Py_TYPE(cm->cm_callable)->tp_descr_get != NULL) {
 return Py_TYPE(cm->cm_callable)->tp_descr_get(cm->cm_callable, type,
-  NULL);
+  type);
 }
 return PyMethod_New(cm->cm_callable, type);
 }

```
Since I consider the new behavior to have introduced a regression, I think this 
change should be applied to both 3.9 and 3.10.

Cheers!

--
components: Interpreter Core
messages: 378893
nosy: berker.peksag, eriknw, rhettinger, serhiy.storchaka
priority: normal
severity: normal
status: open
title: classmethod does not pass "type/owner" when invoking wrapped __get__
type: behavior
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue42072] requests

2020-10-18 Thread Grisha Lukovnikov


New submission from Grisha Lukovnikov :

Traceback (most recent call last):
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 670, in urlopen
httplib_response = self._make_request(
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 381, in _make_request
self._validate_conn(conn)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 978, in _validate_conn
conn.connect()
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py",
 line 343, in connect
self.ssl_context = create_urllib3_context(
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\ssl_.py",
 line 301, in create_urllib3_context
context.keylog_filename = os.environ.get("SSLKEYLOGFILE")
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\dns\\Desktop'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py",
 line 439, in send
resp = conn.urlopen(
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 726, in urlopen
retries = retries.increment(
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py",
 line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\packages\six.py",
 line 734, in reraise
raise value.with_traceback(tb)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 670, in urlopen
httplib_response = self._make_request(
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 381, in _make_request
self._validate_conn(conn)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py",
 line 978, in _validate_conn
conn.connect()
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py",
 line 343, in connect
self.ssl_context = create_urllib3_context(
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\ssl_.py",
 line 301, in create_urllib3_context
context.keylog_filename = os.environ.get("SSLKEYLOGFILE")
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 
'Permission denied'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\dns\Desktop\kurs.py", line 3, in 
print(requests.get("https://yandex.ru;, verify=False).content)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py",
 line 76, in get
return request('get', url, params=params, **kwargs)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py",
 line 61, in request
return session.request(method=method, url=url, **kwargs)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py",
 line 530, in request
resp = self.send(prep, **send_kwargs)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py",
 line 643, in send
r = adapter.send(request, **kwargs)
  File 
"C:\Users\dns\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py",
 line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', 
PermissionError(13, 'Permission denied'))

--
components: Windows
files: kurs.py
messages: 378892
nosy: grishalukovnikov97, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: requests
versions: Python 3.9
Added file: https://bugs.python.org/file49524/kurs.py

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Eryk Sun


Eryk Sun  added the comment:

> Also, why would we document the Windows rules, but not the POSIX 
> rules? They are arguably just as strange to someone who doesn't 
> know them.

POSIX rules are simply to search PATH for the filename as passed, and if it has 
a slash in it, the path is resolved against the working directory. There is no 
implicit search of the application directory, current directory, and system 
directories. There is no search for "dir/file" in *every* search path directory 
instead of just resolving against the working directory. There is no figuring 
out when ".exe" or PATHEXT extensions will be appended or how to search for a 
filename that has no extension by appending a trailing "." to the name. And 
there is no massive inconsistency between the search semantics of shell=True 
and shell=False. What happens with "platform semantics" in Windows is 
complicated compared to POSIX. I'm more comfortable telling people to search 
via shutil.which() than relying on the platform search. I'd be much more 
comfortable if that's what subprocess.Popen() just did on its own. But we're 
locked into platform semantics, and I don't see that changing.

--

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Paul Moore


Paul Moore  added the comment:

Well, I'm not convinced that using `shutil.which` is the right answer for 
anything other than "python". And even there, I'd recommend using 
`sys.executable` over `shutil.which` in pretty much every case.

My view is that if we ignore the "weirdness" introduced by the redirector[1], 
for everything else `subprocess` is fine - it searches for the executable using 
the normal platform semantics. That's nearly always the same across platforms, 
and when it isn't, users may well prefer consistency with the platform over 
identical cross-platform behaviour. And if they *do* want cross-platform 
consistency, at the cost of occasional differences between their program's 
behaviour and (for example) the shell, then they have `shutil.which` available.

Saying that `subprocess` follows platform semantics is easy, and clear. People 
who need to know platform details can find them out. People who want 
Python-defined cross-platform semantics have `shutil.which`.

That's the basis on which I feel that documenting the Windows rules is 
unnecessary. Also, why would we document the Windows rules, but not the POSIX 
rules? They are arguably just as strange to someone who doesn't know them.

[1] I would characterise that weirdness as being that the redirector impacts 
the behaviour of how the platform locates the "python" command under the 
platform search rules of the platform the redirector is used on - even though 
we don't document the behaviour of the redirector so the user cannot infer the 
actual rules without knowing implementation details.

--

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Eryk Sun


Eryk Sun  added the comment:

> I don't think we should document this level of detail

But a lot of it -- most of it -- is also strange behavior that no one would 
expect without reading about it somewhere. Most users of subprocess.Popen() 
will never wade through the documentation of CreateProcessW, SearchPathW, 
ShellExecuteExW, and cmd.exe -- to the extent that the behavior is usefully and 
correctly documented by Microsoft.

One of the reasons I bother writing it out in detail here is to make the case 
for always using shutil.which(), regardless of the value of `shell` (unless 
shell=True is being used beyond the filesystem scope). We have complete control 
of the implementation and documentation of shutil.which(). I don't want that 
advice to be narrowed down to just talking about running "python".

--

___
Python tracker 

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



[issue42071] Shelve should default to the default Pickle protocol instead of hardcoding version 3

2020-10-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This seems reasonable to me.

There might be some issue is existing code where different versions of Python 
are sharing the same shelf, but I don't think this is common.

--
nosy: +rhettinger

___
Python tracker 

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



[issue42071] Shelve should default to the default Pickle protocol instead of hardcoding version 3

2020-10-18 Thread Zackery Spytz


Zackery Spytz  added the comment:

Unfortunately, this is a duplicate of bpo-34204 (which already has a pull 
request).

--
nosy: +ZackerySpytz
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Bump the default pickle protocol in shelve
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Paul Moore


Paul Moore  added the comment:

I don't think we should document this level of detail, both because it's 
basically Windows standard behaviour and therefore not up to us to document, 
and because it's *way* too overwhelming for the average user.

--

___
Python tracker 

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



[issue42071] Shelve should default to the default Pickle protocol instead of hardcoding version 3

2020-10-18 Thread Marco Castelluccio


Change by Marco Castelluccio :


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

___
Python tracker 

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



[issue42071] Shelve should default to the default Pickle protocol instead of hardcoding version 3

2020-10-18 Thread Marco Castelluccio


New submission from Marco Castelluccio :

Shelve is currently defaulting to Pickle protocol 3, instead of using Pickle's 
default protocol for the Python version in use.

This way, Shelve's users don't benefit from improvements introduced in newer 
Pickle protocols, unless they notice it and manually pass a newer protocol 
version to shelve.open or the Shelf constructor.

--
components: Library (Lib)
messages: 378885
nosy: marco-c
priority: normal
severity: normal
status: open
title: Shelve should default to the default Pickle protocol instead of 
hardcoding version 3
type: enhancement
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue42070] I think the rationale to keep IsoCalendarDate private from the pickle perspective should get revisited

2020-10-18 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



[issue42070] I think the rationale to keep IsoCalendarDate private from the pickle perspective should get revisited

2020-10-18 Thread Msimpasona


New submission from Msimpasona :

IsoCalendarDate is pickled as a regular tuple and so requires a slightly 
different code flow in case the pickle file is used as cache. More details 
here: 
https://stackoverflow.com/questions/64408303/python-3-9-unpickling-of-isocalendardate-data-returns-a-tuple

My question is what's the benefit of hiding the new class IsoCalendarDate?

--
components: Library (Lib)
messages: 378884
nosy: msimpasona
priority: normal
severity: normal
status: open
title: I think the rationale to keep IsoCalendarDate private from the pickle 
perspective should get revisited
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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Ned Deily


Ned Deily  added the comment:

Marc, thanks for your suggestion. I'm the one responsible for how Tcl and Tk 
are currently packaged in the python.org framework build and I know exactly 
what you are suggesting so there is no need for you to make a PR. There were 
reasons why I chose to set things up the way they are now but it doesn't mean 
we need to continue to do it that way.  I will be looking at macOS packaging 
issues this week during our development sprint and I will respond further to 
this issue then.

--

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> ned.deily

___
Python tracker 

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



[issue42066] CookieJar cookies should not be sorted

2020-10-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The seems reasonable to me.  Likely, the sorting was originally added to make 
the execution order deterministic.  Now that dicts remember insertion order, 
that is no longer necessary.  Helpfully, the docs do not specify sorting, so 
there is no guaranteed behavior.  That said, there is some risk that 
applications or their tests depend on the existing behavior.

--
nosy: +rhettinger

___
Python tracker 

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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Eryk Sun


Eryk Sun  added the comment:

I don't know how much should be documented for subprocess.Popen, but here are 
the details for how searching works with shell=False (default) and shell=True.

For shell=False, the search path used by WinAPI CreateProcessW checks 
%__APPDIR__%; %__CD__% (unless %NoDefaultCurrentDirectoryInExePath% is defined 
and the name to search contains no backslashes); %SystemRoot%\System32; 
%SystemRoot%\System; %SystemRoot%; and then the %PATH% directories. The search 
path is passed to WinAPI SearchPathW, with a default ".exe" extension. 
SearchPathW tries to resolve a relative path (but not a drive-relative or 
rooted-relative path) against every directory in the search path, unless it 
explicitly begins with a "." or ".." component. For the relative case, it 
appends the default ".exe" extension to a name if and only if it has no 
extension (a trailing "." counts as an extension). For the non-relative case, 
it first tries to find the name as given and then with the default extension 
appended, even if the filename already has an extension (no exception is made 
for a trailing dot, i.e. searching for "C:\Temp\spam." will check for "spam." 
and then "spam..exe"
 ).

>From the POSIX perspective, the implicit inclusion of the application 
>directory, working directory, and system directories is strange and, regarding 
>the inclusion of the working directory, troubling. The fact that searching for 
>a relative name with one or more slashes, such as "spam\\python", is not 
>resolved against *only* the working directory is strange and not documented. 
>The rules governing when ".exe" will be appended are complicated and 
>incorrectly documented (e.g. the claim "if the file name contains a path, .exe 
>is not appended").

With shell=True, the CMD shell simply checks %__CD__% (unless 
%NoDefaultCurrentDirectoryInExePath% is defined and the name to search contains 
no slashes) and %PATH%. Support for forward slash in the name to search is 
wonky; it works only for quoted paths. But at least a relative path that 
contains slashes is only resolved against the current working directory instead 
of every directory in the search path. CMD's rules for appending default 
extensions are simpler than SearchPathW in some ways, but also more complicated 
because it's generalized as the PATHEXT list of extensions. In each directory, 
CMD always looks first for the searched name as given and then the name plus 
each extension in PATHEXT, regardless of the filepath type or whether the 
searched name already has an extension. It will not find a name that has no 
extension unless PATHEXT includes a "." entry for the empty extension. (This is 
consistent with the desktop shell API, which supports defining an association 
for the "."
  filetype.)

--

___
Python tracker 

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



[issue37931] crash reimporting posix after Py_Finalize on mac

2020-10-18 Thread STINNER Victor


STINNER Victor  added the comment:

Right, I close the issue.

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

___
Python tracker 

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



[issue42069] Make filecmp more pythonic

2020-10-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

In general, we don't accept patches like this:

* It risks breaks (in fact the tests are failing.
* We're not apply Black's quoting preferences to existing files.
* We're not yet adding type annotations through out.
* The PR introduces multiple new dependencies on other modules.
  This tends to slow down load time and complicate maintenance.
* There are subtle changes to the logic and API because
  of the dataclasses, cached_property, and lru_cache.
* We want to avoid code churn because it reduces stability
  and because it complicates maintenance (making it harder to
  apply fixes across versions).

Thank you for the suggestion, but we'll decline.

--
nosy: +rhettinger
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue28660] TextWrapper break_long_words=True, break_on_hyphens=True on long words

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b81c833ab51fb7d7f0f8eaace37f60ef7455aa85 by Irit Katriel in 
branch 'master':
bpo-28660: Make TextWrapper break long words on hyphens (GH-22721)
https://github.com/python/cpython/commit/b81c833ab51fb7d7f0f8eaace37f60ef7455aa85


--

___
Python tracker 

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



[issue42069] Make filecmp more pythonic

2020-10-18 Thread Alex


Change by Alex :


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

___
Python tracker 

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



[issue42069] Make filecmp more pythonic

2020-10-18 Thread Alex


New submission from Alex :

Cleanup the filecmp file add typing and make it more pythonic

--
components: Library (Lib)
messages: 378877
nosy: alex.briskin
priority: normal
severity: normal
status: open
title: Make filecmp more pythonic
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



[issue38252] Use 8-byte step to detect ASCII sequence in 64bit Windows builds

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue42041] venv subprocess call to python resolves to wrong interpreter

2020-10-18 Thread Paul Moore


Paul Moore  added the comment:

OK, PR updated as per discussion.

--

___
Python tracker 

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



[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1040299e9283609f3de0f6e32a0d43458fe7f4f6 by Miss Skeleton (bot) 
in branch '3.8':
bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22748)
https://github.com/python/cpython/commit/1040299e9283609f3de0f6e32a0d43458fe7f4f6


--

___
Python tracker 

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



[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a055ced9d43630cadc3c1d5edab0884f2c5131ea by Miss Skeleton (bot) 
in branch '3.9':
bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731) (GH-22747)
https://github.com/python/cpython/commit/a055ced9d43630cadc3c1d5edab0884f2c5131ea


--

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Marc Culler


Marc Culler  added the comment:

Dear Ronald,

You are correct that "It is already possible to replace the Tcl/Tk libraries by 
replacing the relevant files in Python.framework."
I know that because I have done it.  Moreover, having done it, I
know that it is much more difficult than it should be.  A large
part of the difficulty is that the directory structure of the
Tcl/Tk installation within the Python framework is undocumented and
completely different from that used within Tcl.framework and
Tk.framework.  There is no need for that.  The versions of those
frameworks with Python wants to use could simply be embedded within
the Python.framework as subframeworks.  That simplifies the build and
it simplifies upgrades and it costs nothing as far as Python is
concerned.

The backwards compatibility promise offered by Tk and Tcl means that
replacing Tcl/Tk 8.6.X with Tcl/Tk 8.6.Y will work with no change to
the binary _tkinter. module.  When improvements or bug fixes are
made to Tcl and Tk it should be straightforward for users to update
Python so that it will take advantage of those improvements.  Before
Tcl and Tk were included in the Python framework that was simple.
You could just install the newer release of Tcl/Tk (at least for patch
releases).  Since _tkinter would look in the standard places, i.e.
/Library/Frameworks/Tk.framework (or Tcl.framework) for its shared
libraries, that would automatically work.

The point is that it could, and should, be just as simple to make such
an upgrade with the new where Tcl and Tk are included within the 
Python.framework.

That is what I am trying to accomplish.  The scope of this change will
probably be clearer if I make a pull request.  So I will do that.

--

___
Python tracker 

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



[issue20184] Derby #16: Convert 50 sites to Argument Clinic across 9 files

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 1bcaa81e520e30f920bd69e46fbf1d67a9107ce1 by Serhiy Storchaka in 
branch 'master':
bpo-20184: Convert termios to Argument Clinic. (GH-22693)
https://github.com/python/cpython/commit/1bcaa81e520e30f920bd69e46fbf1d67a9107ce1


--

___
Python tracker 

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



[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +21711
pull_request: https://github.com/python/cpython/pull/22748

___
Python tracker 

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



[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c304c9a7efa8751b5bc7526fa95cd5f30aac2b92 by scaramallion in 
branch 'master':
bpo-41966: Fix pickling pure datetime.time subclasses (GH-22731)
https://github.com/python/cpython/commit/c304c9a7efa8751b5bc7526fa95cd5f30aac2b92


--

___
Python tracker 

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



[issue41966] datetime.time issue with pickling in PyPy

2020-10-18 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +21710
pull_request: https://github.com/python/cpython/pull/22747

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2020-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

Ah yes, I missed that. I've pushed a PR for 3.8 that does this:

>>> urllib.parse.unquote(b'abc%20def')
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Users\User\src\cpython\lib\urllib\parse.py", line 635, in unquote
raise TypeError('Expected str, got bytes')
TypeError: Expected str, got bytes

--

___
Python tracker 

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



[issue38252] Use 8-byte step to detect ASCII sequence in 64bit Windows builds

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a0c603cb9d4dbb9909979313a88bcd1f5fde4f62 by Ma Lin in branch 
'master':
bpo-38252: Use 8-byte step to detect ASCII sequence in 64bit Windows build 
(GH-16334)
https://github.com/python/cpython/commit/a0c603cb9d4dbb9909979313a88bcd1f5fde4f62


--

___
Python tracker 

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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2020-10-18 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +21709
pull_request: https://github.com/python/cpython/pull/22746

___
Python tracker 

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



[issue42051] plistlib inherits XML vulnerabilities: we should document them

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Oh, I missed that there is a handler for EntityDecl. Well, then we can fix this 
issue in few lines of code.

I think it should be backported. We can add private flag (global or class 
variable) to enable entity declarations, but do not support them in 3.10.

--

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm not sure what you are trying to accomplish.  It is already possible to 
replace the Tcl/Tk libraries by replacing the relevant files in 
Python.framework. However: these aren't meant to be user serviceable parts, the 
copy of Tcl/Tk that we include is tested with Tkinter.

I assume a future release of python will include a new copy of Tk when tests 
indicate it is an improvement for Tkinter. I won't make any promises because 
I'm not doing the integration work.

--

___
Python tracker 

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



[issue42004] Allow uploading files with SimpleHTTPRequestHandler

2020-10-18 Thread Jake


Jake  added the comment:

I would find this very useful.

--

___
Python tracker 

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



[issue42067] Type annotation in for-loops

2020-10-18 Thread Ken Jin


Ken Jin  added the comment:

That's an interesting syntax suggestion, you might want to suggest that in the 
python-ideas mailing list for other people to read about it rather than post it 
on python bugs.

IMO, this isn't really an issue since you can specify the type of the elements 
in generic types via::

   my_list: list[int] = [1, 2, 3]
   for element in my_list:
   process(element)

Your type checker should be able to infer that ``element`` is of type ``int`` 
(or hopefully, it will in the near future).

--
nosy: +kj

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Marc Culler


Marc Culler  added the comment:

Dear Eric,

I am aware that python is cross platform.

The change that I am proposing would be almost entirely limited to
the file:
 Mac/BuildScript/build-installer.py
which is entirely mac-specific.  It controls how the Mac installer is
constructed.  Specifically, the effect would be to change the
directory structure of the Python framework which is installed by the
Python installer package in /Library/Frameworks/Python.framework.

There presumably would also be a very small change in the _tkinter
module to account for the fact that the Tcl and Tk shared libraries
would acquire new pathnames.

My sincere apologies for offending you by my use of the words
"crazy" and "random noise". I hope you will be able to focus on the
content of the ticket in spite of my use of those offensive words.

--

___
Python tracker 

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



[issue42051] plistlib inherits XML vulnerabilities: we should document them

2020-10-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

One option is to copy what defusedxml does to forbid a number of unsafe 
operations, see 
https://github.com/tiran/defusedxml/blob/eb38a2d710b67df48614cb5098ddb8472289ce6d/defusedxml/ElementTree.py#L68

Defusedxml uses an XMLParser subclass that optionally disables some features 
(such as entity definitions), for plistlib those features can be disabled 
unconditionally. 

I haven't thought much about the exceptions to use, probably a similar 
exception as is used for invalid plist files. 

Another thing I haven't really thought about: would such a change be 3.10 only 
or is this something we could backport?  

The following plist file currently works with plistlib, but does not work with 
plutil(1) on macOS 10.15 (parse error in the DTD definition).  That indicates 
that entity definitions aren't supposed to be used in plist files and it would 
be safe to disable this feature in plistlib.


http://www.apple.com/DTDs/PropertyList-1.0.dtd; [
   
  ]>

  
A

  


--

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

It sounds like your solution is macOS only, where as Python needs to be cross 
platform.

Further, I assume there are good reasons that it's implemented the way it is. 
Perhaps there was no alternative when it was initially developed? And we're 
constrained by backward compatibility to at least some extent.

I'm sure that we'd accept contributions that used a more modern approach, if 
they were cross platform and didn't break anything.

By the way, getting volunteers to pay attention to your issue isn't helped by 
using words like "pretty crazy" and "random noise".

--
nosy: +eric.smith

___
Python tracker 

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



[issue42051] plistlib inherits XML vulnerabilities: we should document them

2020-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Seems that we can not control entity definitions and expansions. We only can 
limit the number of expanded entities per element (the size of self.data).

What is the reasonable default limit (taking into account that every  and 
 is a separate entity)? How to name the limit parameter if we make it 
configurable? What type of exceptions should be raised?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-10-18 Thread Marc Culler


New submission from Marc Culler :

Packaging Tcl and Tk within the python framework is a great idea
and a big improvement.  But the way it is being done is pretty crazy,
and makes it unnecessarily difficult to upgrade the version of Tcl/Tk
that python is using.  That is something which should be easy,
especially since python is still using version 8.6.8 even though 8.6.11
is about to be released and includes the results of a huge effort to
improve and stabilize the macOS port of Tk.

There is a standard and completely straightforward way of including
a framework within a framework.  The normal thing to do would be
to create a directory Python.framework/Versions/X.Y/Frameworks/ which
contains Tcl.framework and Tk.framework.  Upgrading to a newer version
of Tcl and Tk would then simply require updating those frameworks, which
would be very easy to accomplish, for example, with a .pkg file.

Instead of doing this, Python currently jams everything related to Tcl
and Tk into its lib directory, changing the library and directory names
randomly and breaking the standard directory structure that Tcl and Tk
use in their frameworks.

Why not make it standard and simple?  Why add all of this random noise?

--
components: macOS
messages: 378860
nosy: culler, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: For macOS, package the included Tcl and Tk frameworks in a rational way.
type: enhancement
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



[issue42066] CookieJar cookies should not be sorted

2020-10-18 Thread Iman Kermani


Change by Iman Kermani :


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

___
Python tracker 

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



[issue42067] Type annotation in for-loops

2020-10-18 Thread barak dopama


New submission from barak dopama :

Why do I have to do this:
for element in my_list:
element: ElementType = element
process(element)
And can't do this:
for element: ElementType  in my_list:
process(element)

--
components: Build
messages: 378859
nosy: gaaartner
priority: normal
severity: normal
status: open
title: Type annotation in for-loops
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



[issue32498] urllib.parse.unquote raises incorrect errormessage when string parameter is bytes

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:

Thanks for the reminder Irit!

No, this should not be closed yet, as there is still the possibility of 
improving the exception in version 3.8.

--
versions: +Python 3.8

___
Python tracker 

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



[issue42004] Allow uploading files with SimpleHTTPRequestHandler

2020-10-18 Thread Jake


Change by Jake :


--
nosy: +jacobsorme

___
Python tracker 

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



[issue35414] A reference counting bug in PyState_RemoveModule()

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue35436] Add missing PyErr_NoMemory() calls

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue36285] Integer overflow in array.array.remove()

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue36398] A possible crash in structseq.c's structseq_repr()

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue36583] Do not swallow exceptions in the _ssl module

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue26423] Integer overflow in wrap_lenfunc() on 64-bit build of Windows with len > 2**31-1

2020-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue40507] FileNotFound error raised by os.exec* doesn't contain filename

2020-10-18 Thread Tal Einat


Tal Einat  added the comment:

After further reading, especially the docs for OSError which describe the 
filename and filename2 attributes, I agree that setting .filename on the 
FileNotFoundError exception is the way to go.

--

___
Python tracker 

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



[issue41822] Document the meaning of values for sys.float_info.rounds

2020-10-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Here's a link:  http://c0x.coding-guidelines.com/5.2.4.2.2.html

--

___
Python tracker 

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



[issue42066] CookieJar cookies should not be sorted

2020-10-18 Thread Iman Kermani


New submission from Iman Kermani :

Lib/http/cookiejar.py

By default python handle cookies based on regular Netscape cookie protocol and 
the protocol defined by RFC 2965.

There is a behavior in python which sort cookies in CookieJar by default:
https://github.com/python/cpython/blob/975d10a4f8f5d99b01d02fc5f99305a86827f28e/Lib/http/cookiejar.py#L1220

Moreover there is no definition in the 2965 about the cookie ordering in Cookie 
Header when cookies have equal-length path fields.

This is a undesirable behavior when working with certain libraries like 
requests. https://github.com/psf/requests/issues/5630
 
In this case browser implements the RFC 6265 which obsoletes the RFC 2965. 
Therefore The behavior is based on 
https://tools.ietf.org/html/rfc6265#section-5.4:
"The user agent SHOULD sort the cookie-list in the following order:
Cookies with longer paths are listed before cookies with shorter paths.
Among cookies that have equal-length path fields, cookies with earlier 
creation-times are listed before cookies with later creation-times."

This means that the order of the cookies with same path attribute in Cookie 
header follow the Set-Cookie order in the HTTP response.

RFC 6265 compliance is not what this issue is meant rather it imply on the 
sorting of cookies which is unnecessary here and not mentioned in RFC 2965 or 
the regular Netscape cookie protocol.

Thanks in advance for looking into this issue

Regards.

--
components: Library (Lib)
messages: 378855
nosy: IKermani
priority: normal
severity: normal
status: open
title: CookieJar cookies should not be sorted
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



  1   2   >