[issue35118] Add peek() or first() method in queue

2021-03-05 Thread Alexey Volkov


Alexey Volkov  added the comment:

>For Queue, I'm not sure I've ever seen any use case for peek.  What do you 
>have in mind?

I want to examine the first (oldest) element in queue and remove it if it's too 
old.

The queue should not be modified unless the oldest element is too old.

--
nosy: +Ark-kun

___
Python tracker 

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



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

2021-03-05 Thread Nicholas Sim


Change by Nicholas Sim :


--
pull_requests: +23538
pull_request: https://github.com/python/cpython/pull/24770

___
Python tracker 

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



[issue43415] Typo

2021-03-05 Thread Mariatta


Change by Mariatta :


--
keywords: +easy, newcomer friendly

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +lys.nikolaou

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> "If mode is 'repl', compile returns None to indicate that the code is 
> incomplete as is but might become valid if more lines (or maybe just more 
> code) were added"

That would be ideal, but my guess is that is not trivial because even if you 
can intercept the tokenizer when it fetches new lines from the source, you need 
to correctly propagate that information through several tokenized layers and 
the parser trying to backtrack.

If someone manages to do that, that would be the cleanest solution.

--

___
Python tracker 

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



[issue43415] Typo

2021-03-05 Thread Andrei Kulakov


New submission from Andrei Kulakov :

Typo (explicit|ly) in library/dataclasses.rst:139:

139: If :meth:`__hash__` is not explicit defined, or if it is set to 
``None``,

--
assignee: docs@python
components: Documentation
messages: 388193
nosy: andrei.avk, docs@python
priority: normal
severity: normal
status: open
title: Typo
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



[issue43374] Apple refuses apps written in Python

2021-03-05 Thread Ned Deily


Change by Ned Deily :


--
resolution:  -> out of date
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



[issue43374] Apple refuses apps written in Python

2021-03-05 Thread Adrian


Adrian  added the comment:

Terry,

After opening issues on this and other mailing lists (PyObjc) Apple validated 
our app without a comment.  

Adrian

> On 5 Mar 2021, at 21:51, Terry J. Reedy  wrote:
> 
> 
> Terry J. Reedy  added the comment:
> 
> Adrian, when responding by email, please delete the copy of the email you are 
> responding to, except maybe a line or two, as it is redundant when posted on 
> the web page.

--

___
Python tracker 

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



[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

In particular, [this 
commit](https://github.com/python/cpython/commit/0b5615926a573c19c887a701a2f7047f4fd06de6).

--

___
Python tracker 

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



[issue20186] Derby #18: Convert 31 sites to Argument Clinic across 23 files

2021-03-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I suspect change in this issue led to issue43413.

--
nosy: +jaraco

___
Python tracker 

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



[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I suspect bpo-20186 is implicated.

--

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Add compile(..., mode='repl')?
"If mode is 'repl', compile returns None to indicate that the code is 
incomplete as is but might become valid if more lines (or maybe just more code) 
were added"

Deprecate _maybe_compile (and stop trying to patch it).

--

___
Python tracker 

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



[issue43414] os.get_terminal_size() should use file descriptors in Windows

2021-03-05 Thread Eryk Sun


New submission from Eryk Sun :

Currently os.get_terminal_size() is hard coded to use the process standard 
handles in Windows. The function, however, is intended for arbitrary file 
descriptors, so should not be limited as follows:

>>> f = open('conout$', 'w')
>>> os.get_terminal_size(f.fileno())
Traceback (most recent call last):
  File "", line 1, in 
ValueError: bad file descriptor

This is a simple fix. Rewrite it to use _get_osfhandle(). For example:

#ifdef TERMSIZE_USE_CONIO
{
HANDLE handle;
CONSOLE_SCREEN_BUFFER_INFO csbi;

_Py_BEGIN_SUPPRESS_IPH
handle = (HANDLE)_get_osfhandle(fd);
_Py_END_SUPPRESS_IPH
if (handle == INVALID_HANDLE_VALUE)
return PyErr_SetFromErrno(PyExc_OSError);

if (!GetConsoleScreenBufferInfo(handle, ))
return PyErr_SetFromWindowsErr(0);

columns = csbi.srWindow.Right - csbi.srWindow.Left + 1;
lines = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
}
#endif /* TERMSIZE_USE_CONIO */

--
components: Extension Modules, Windows
keywords: easy (C)
messages: 388187
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: os.get_terminal_size() should use file descriptors in Windows
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



[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

I see that changelog entry traces back to bpo-29695, but I don't believe it's 
relevant to this issue.

--

___
Python tracker 

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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.6, Python 3.7

___
Python tracker 

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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-05 Thread miss-islington


miss-islington  added the comment:


New changeset 65f3a0d20c8198443c5c6cb44410114fe8c4bf4e by Miss Islington (bot) 
in branch '3.9':
bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757)
https://github.com/python/cpython/commit/65f3a0d20c8198443c5c6cb44410114fe8c4bf4e


--

___
Python tracker 

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



[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

To be abundantly clear, the downstream issue was a coding error, but the coding 
error was masked on Python 3.7+ when the subclass didn't reject the invalid 
usage.

--

___
Python tracker 

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



[issue43413] tuple subclasses allow kwargs

2021-03-05 Thread Jason R. Coombs


New submission from Jason R. Coombs :

While troubleshooting a strange problem 
(https://github.com/jaraco/keyring/issues/498) where a program worked on Python 
3.7+ but failed on Python 3.6, I discovered a somewhat unintuitive behavior. On 
Python 3.7+, keyword arguments to tuple subclasses are allowed and ignored:

>>> class Foo(tuple): pass
>>> tuple(name='xyz')
TypeError: tuple() takes no keyword arguments
>>> Foo(name='xyz')
()

But on Python 3.6, the keyword parameter causes an error:

$ python3.6 -c "type('Foo', (tuple,), {})(name='xyz')"
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'name' is an invalid keyword argument for this function

I checked out the What's new in Python 3.7 and I see this notice:

Functions bool(), float(), list() and tuple() no longer take keyword arguments. 
The first argument of int() can now be passed only as positional argument.

Hmm, but in my experience, tuple on Python 3.6 doesn't take keyword arguments 
either:

importlib_metadata main $ python3.6 -c "tuple(name='xyz')"
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'name' is an invalid keyword argument for this function


So that change may be related, but I'm not sure where or how.

The main place my expectation is violated is in the subclass. Why should a 
subclass of tuple allow keyword arguments when the parent class does not? I'd 
expect that the subclass should reject keyword arguments as well.

Less importantly, the What's New doc implies that keyword arguments were 
accepted in Python 3.6; why aren't they?

--
components: Interpreter Core
keywords: 3.7regression
messages: 388183
nosy: jaraco
priority: normal
severity: normal
status: open
title: tuple subclasses allow kwargs
versions: Python 3.10, 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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-05 Thread miss-islington


miss-islington  added the comment:


New changeset e12a9e2f62bea8ddc755e373f17adfbb2740b0b1 by Miss Islington (bot) 
in branch '3.8':
bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757)
https://github.com/python/cpython/commit/e12a9e2f62bea8ddc755e373f17adfbb2740b0b1


--

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

In any case, the underlying problem here is the fact that codeop is deciding to 
continue asking for input of not depending on the repr() of the syntax error 
exception itself, which is the major hack here.

Previously, it worked because for unclosed parens the parser was throwing 
different line numbers for the end of file as codeop keeps adding new lines, 
but now all these points to the same unclosed paren.

--

___
Python tracker 

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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23537
pull_request: https://github.com/python/cpython/pull/24769

___
Python tracker 

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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-05 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +23536
pull_request: https://github.com/python/cpython/pull/24768

___
Python tracker 

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



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset ff5f05934db241dfafc604989b2de3487b09ca82 by Alex Willmer in 
branch 'master':
bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757)
https://github.com/python/cpython/commit/ff5f05934db241dfafc604989b2de3487b09ca82


--
nosy: +terry.reedy

___
Python tracker 

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



[issue43387] Enable pydoc to run as background job

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> test needed
type: behavior -> enhancement
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



[issue43379] Pasting multiple lines in the REPL is broken since 3.9

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

On both Windows and macOS Mohave with both 3.9 and 3.10 I get normal behavior.

If it were not for the $ python3.x line, the missing '... ' in Romain's output 
would have suggested that he was using IDLE.  But IDLE should accept pasted 
ascii statements just fine.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Maybe we need to add an API (e.g. a flag to compile()) so that we can ask the 
> actual parser the question we're interested in, rather than having to use 
> hacks and heuristics?

I was thinking about that, but we need to fix some inconsistencies along the 
way first. I am currently already doing that work (starting with 
https://github.com/python/cpython/pull/24763) and once that is fixed we can 
pass that down with some flags to the compiler.

--

___
Python tracker 

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



[issue43374] Apple refuses apps written in Python

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Adrian, when responding by email, please delete the copy of the email you are 
responding to, except maybe a line or two, as it is redundant when posted on 
the web page.

Have you tried forums where there might be other Apple app developers with 
similar issues?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Guido van Rossum


Guido van Rossum  added the comment:

Maybe we need to add an API (e.g. a flag to compile()) so that we can ask the 
actual parser the question we're interested in, rather than having to use hacks 
and heuristics?

--

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

This is a change I implemented and is explicitly deactivated in the reprl:

https://github.com/python/cpython/blob/master/Parser/pegen.c#L1191

The problem here is that when you call compile() there is no way to know if you 
are doing it to simulate a reprl() or not.

--

___
Python tracker 

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



[issue43366] Unclosed bracket bug in code.interact prevents identifying syntax errors

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#43163 was about the opposite problem of raising SyntaxError too soon, when a 
valid continuation to imcomplete code is possible.  As with that issue, IDLE 
has the same problem, which is not in code.interact() itself but in 
codeop._maybe_compile.. 

Calling compile with, gives message, resulting in user seeing
'[def'unclosed [  
'[def\n'  bad syntax Syntax Error
'[\ndef'  unclosed [
'[\ndef\n'unclosed [ prompt for more input

In the last line, the added \n after [ changes the compile SyntaxError message 
and, after PR 24483 for #43163, results in fruitlessly waiting for non-existent 
correct input until the user enters garbage or hits ^C. This is at best a 
codeop-specific regression from better behavior in 3.9

Changing 'def' to 'def f():' only changes the first message to 'invalid syntax' 
but not the user-visible result.

As near as I can tell, compile('[\n1,', ...) and compile('[\ndef', ...) give 
the same unclosed message pointing to the opening [.  How does the regular REPL 
know to prompt for input for the first and raise SyntaxError for the second?  
Some unobvious flag combination?  (It is not 'exec' versus 'single'.)

>>> [
... 1,
... def
  File "", line 3
def
^
SyntaxError: invalid syntax

Guido, do you have any idea how python decides this or where the code is or who 
might know better?

--
nosy: +gvanrossum, terry.reedy

___
Python tracker 

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



[issue24890] Windows launcher docs don't fully explain shebang semantics

2021-03-05 Thread Eryk Sun


Eryk Sun  added the comment:

In summary, the launcher documentation needs to be extended as follows:

* Include an example of a shebang with a normal Windows path:

  #!"C:\Program Files\Python310\python.exe"

  Highlight the importance of quoting paths that contain spaces.
  Also, quoting ensures a real filesystem path will never
  mistakenly match a virtual command. 

  Due to questionable design in the launcher, it will still try 
  searching [1] for part of the name up to the first space, such
  as "C:\Program", but, presuming the path is quoted, the search
  will at least never succeed since double quotes are not
  allowed in filenames.

* Show how to define custom commands in py.ini:

  [commands]
  pypy3=C:\pypy3.7\pypy3.exe

  The launcher is limited to 100 commands since it uses a hard-
  coded array size.

  Note that regular CLI commands take precedence. In other words,
  if a command name is found in the standard search path [1], then
  the search result is used instead of the value defined in py.ini.

  This is buggy behavior that should be fixed. When reading py.ini, 
  it should not search for the command. The find_command() function
  needs a `search` parameter to support this. If it's false, 
  find_command() should only check its `commands` array.

* Explain that the Unix path prefixes "/usr/bin/env ", 
  "/usr/bin/", and "/usr/local/bin/" are ignored when matching
  a command name -- except for the already documented case of
  "/usr/bin/env python" (without a version spec).

  Except for reserved "python" commands, currently any command
  name will be searched for [1], with or without the
  "/usr/bin/env " prefix. For example:
 
  #!name

  The launcher will search for "name.COM", "name.EXE",
  "name.BAT", and so on.

  This is buggy behavior that should be fixed. The skip-prefix 
  feature needs to be smarter. The launcher should only search
  the filesystem for commands that use the "/usr/bin/env "
  prefix. The find_command() function needs a `search`
  parameter to support this, as mentioned above.


Bugs mentioned in this message need a separate issue. I don't know to what 
extent questionable behavior should be documented, with warnings about security 
and misbehavior. In practice it seems that most users limit themselves to a 
restricted subset of the launcher's capabilities, and never stray from the 
well-worn path. So I don't want to needlessly scare or worry people. But the 
buggy behavior SHOULD be taken seriously and fixed.

---

[1] The launcher uses the system's default non-safe search path
for data files. It should enable the safe search via

SetSearchPathMode(BASE_SEARCH_PATH_ENABLE_SAFE_SEARCHMODE)

The non-safe search path includes the application directory
(of the launcher); the current directory; the System32,
System and Windows directories (unsafe because they're after
the current directory); and the directories in the PATH
environment variable.

If there's no "." in the name, the launcher tries searching 
for the name plus each extension that's listed in the PATHEXT 
environment variable. To search for a filename that has no
extension, add a trailing dot to the command name, e.g.
"spam.".

--
type: behavior -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I modified PR 24763 to implement this idea.

--

___
Python tracker 

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



[issue43365] Operation conflict between time package and file

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I unlinked the preliminary versions of the code minimized in the 3 post.

The posted code is buggy: it opens a file and then start an infinite loop.  It 
has to be interrupted someway, and the file may not be properly closed and 
flushed to disk.  When I make the loop finite and explicitly close the file, or 
even better, use a 'with' statement, the file is written as expected.  At least 
on Windows, it runs noticeably slower with the sleep because the minimum sleep 
is 1/16 second.

Minaki, if you find a problem with unbuggy code, you can post and reopen.  If 
you are a beginner who does not know about things like closing file, flushing 
to disk, and the with statement, you should post to a question and answer forum 
such as python-list and ask 'Is Python or my code buggy?'

--
nosy: +terry.reedy
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
title: Operation conflict between time package and file in python 3.8 3.9 -> 
Operation conflict between time package and file
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



[issue43365] Operation conflict between time package and file in python 3.8 3.9

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg387908

___
Python tracker 

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



[issue43365] Operation conflict between time package and file in python 3.8 3.9

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
Removed message: https://bugs.python.org/msg387907

___
Python tracker 

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



[issue43359] Dead assignment in Py_UniversalNewlineFgets

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Victor and/or Serhiy: This and #43360 and #43361 are similar 1-line changes, 
suggested by scan-build, to eliminate dead or duplicate initializations in C 
code.  Can either of you either handle these or suggest someone else?  Would we 
have preferred 1 issue and PR?  Do we backport such changes?

All 3 diffs have a bunch of github beta check annotation warnings for an 
otherwise unchanged C file.  Fix?  Suppress somehow?

--
nosy: +serhiy.storchaka, terry.reedy, vstinner

___
Python tracker 

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



[issue43355] __future__.annotations breaks inspect.signature()

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

3.7 only gets security fixes

--
nosy: +terry.reedy
versions:  -Python 3.7

___
Python tracker 

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



[issue43332] Make http.client._tunnel send one byte string over the network

2021-03-05 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

FYI another common socket idiom for this, specifically added for use in old 
HTTP 1.x servers building up responses, is setting and clearing the TCP_CORK 
(Linux) or TCP_NOPUSH (FreeBSD, and maybe macos? [buggy?]) socket option before 
and after the set of send()s you want to be optimally buffered into packets.

A more modern approach (often used with TCP_CORK) is not to build up a single 
buffer at all.  Instead use writev().  os.writev() exists in Python these days. 
 It limits userspace data shuffling in the normal case of everything getting 
written.

Unfortunately... this old http client code and API isn't really setup for that. 
 Everything is required to go through the HTTPConnection.send method.  And the 
send method is not defined to take a list of bytes objects as writev() would 
require.  

So for this code, the patch we want is just the joined bytes or BytesIO. It is 
the simple better change that works everywhere without getting into platform 
specific idioms.

For modern best practices I'd look to the async frameworks instead of this 
older library.

--

___
Python tracker 

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



[issue43412] object.h -Wcast-qual warning

2021-03-05 Thread Peter Eisentraut


New submission from Peter Eisentraut :

object.h contains an inline function that causes a -Wcast-qual warning from 
gcc.  Since this file ends up visible in third-party code that includes 
Python.h, this makes it impossible to use -Wcast-qual in such code.

The problem is the change c5cb077ab3c88394b7ac8ed4e746bd31b53e39f1, which 
replaced ob->ob_type by Py_TYPE(ob), which seems reasonable by itself, but 
Py_TYPE casts away the const, so it creates this problem.

This is a regression in Python 3.10.

--
components: Interpreter Core
messages: 388167
nosy: petere
priority: normal
severity: normal
status: open
title: object.h -Wcast-qual warning
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



[issue43338] Provide offical installers for security releases

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

This tracker is only concerned with the PSF/python.org Windows and macOS 
installers, not the *nix distributions, so I assume that one the former is your 
concern.

For those, your request has been made and rejected multiple times before.  A 
request on the tracker won't change this policy decision.  Briefly, we consider 
other actions by the volunteers who make those installers to be more valuable.  
Making more installers means not doing something else, like fixing bugs or 
keeping up with OS changes or enhancing something.

A little more: 1. Many -- maybe most -- security fixes are only or mainly of 
concern to server maintainers.  They mostly run *nix or compile their own 
binaries or pay someone to do so.  2. Running older Python versions instead of 
newer versions is a user choice, not ours.  3. Non-PSF distributors of Python 
for Windows and Mac are free to recompile their binaries whenever they want to.

For Windows, I don't know what your concern is about 'signed' binaries.  Anyone 
can install the Visual Studio Community Edition and Git and clone and compile 
their own binary.  This is at least as secure as a downloaded binary.  If more 
instructions are needed for how to use that binary for production use, that 
would be a different issue. (And perhaps git should be told to git-ignore 
additions to site-packages.)

--
nosy: +ned.deily, steve.dower, terry.reedy
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
title: [feature request] Please provide offical installers for security 
releases -> Provide offical installers for security releases

___
Python tracker 

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



[issue23740] http.client request and send method have some datatype issues

2021-03-05 Thread Alex Willmer


Alex Willmer  added the comment:

http_dump.py now covers CPython 3.6-3.10 (via Tox), and HTTPSConnection 
https://github.com/moreati/bpo-23740

--

___
Python tracker 

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



[issue43332] Make http.client._tunnel send one byte string over the network

2021-03-05 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
stage:  -> needs patch

___
Python tracker 

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



[issue43332] Make http.client._tunnel send one byte string over the network

2021-03-05 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

yep, that'd be a worthwhile improvement.  note that the send method in that 
code also accepts BytesIO objects so rather than doing our own sequence of 
bytes and join we could just buffer in one of those.

--

___
Python tracker 

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



[issue43337] export the set newline value on TextIOBase/TextIOWrapper

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue43336] document whether io.TextIOBase.readline(size>0) will always read the full newline

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue43332] Make http.client._tunnel send one byte string over the network

2021-03-05 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I changed the title to what a PR/commit title should look like.  Your 
justification is that "Multiple writes possibly cause excessive network usage 
and increased implementation complexity on the other end."

I see no problem with the formatting of your first post.

I presume the proposal is to make a list of bytes and then b''.join(the_list).  
This is now a standard idiom.  Have you tested a patch locally?  Can you make a 
PR?

I don't know if there was a particular reason to not join before sending.  
Perhaps because successive sends effectively do the same thing, though with the 
possible  downsides you note.  I am not an expert on network usage.

The _connect method was added by Senthil Kumaran in 2009 in #1424152 and 
revised since.  There is no current http maintainer, so I added as nosy  
Senthil and others who have worked on the module.

--
nosy: +berker.peksag, gregory.p.smith, orsenthil, terry.reedy
title: http/client.py: - uses multiple network writes, possibly causing 
excessive network usage and increased implementation complexity on the other 
end -> Make http.client._tunnel send one byte string over the network

___
Python tracker 

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



[issue28259] Ctypes bug windows

2021-03-05 Thread Eryk Sun


Eryk Sun  added the comment:

I didn't have time to look deeper into this. I'm sorry for not getting back to 
you. The rather-large example that you uploaded didn't and doesn't run for me, 
so I wasn't able to reproduce the problem.

The one bit of advice I have is to always declare required argument types in 
the `argtypes` attribute of ctypes functions. It can be very useful to take 
advantage of the type checking that ctypes provides in order to catch problems 
before they lead to stack or heap corruption, or bad values that lead to 
corruption later on. 

I'm closing this issue as not a bug. ctypes and libffi have been used in a 
broad range of cases in 32-bit Windows for many years, and I wasn't able to 
reproduce the problem with a function of the given call signature when I 
checked in 2016.

--
resolution:  -> not a bug
stage: test needed -> 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



[issue27803] ctypes automatic byref failing on custom classes attributes

2021-03-05 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -terry.reedy

___
Python tracker 

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



[issue43352] Add a Barrier object in asyncio lib

2021-03-05 Thread Emmanuel Arias


Change by Emmanuel Arias :


--
nosy: +eamanu

___
Python tracker 

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



[issue43411] wm_manage fails with ttk.Frame

2021-03-05 Thread Martin Cooper


New submission from Martin Cooper :

Attempting to use a ttk.Frame with wm_manage() causes a TclError:

_tkinter.TclError: window ".!frame" is not manageable: must be a frame, 
labelframe or toplevel

The (Tcl) documentation for wm manage states "Only frame, labelframe and 
toplevel widgets can be used with this command." One might reasonably expect a 
ttk.Frame to appropriately fall under this requirement, especially since the 
name 'frame' is used for them, but it does not. One must use a tk.Frame instead 
to make this work.

At the very least, this needs to be documented. Looking at the error message 
and seeing it complain that a 'frame' is not one of 'frame', 'labelframe' or 
'toplevel' is extremely confusing. There is nothing to lead to the conclusion 
that a ttk Frame is not a 'frame'. Better than documenting it, of course, would 
be to make wm_manage actually work properly with a ttk.Frame, as developers 
would expect.

--
components: Tkinter
messages: 388161
nosy: mfncooper
priority: normal
severity: normal
status: open
title: wm_manage fails with ttk.Frame
type: behavior

___
Python tracker 

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



[issue27926] ctypes is too slow to convert a Python list to a C array

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue22708] httplib/http.client in method _tunnel used HTTP/1.0 CONNECT method

2021-03-05 Thread Senthil Kumaran


Change by Senthil Kumaran :


--
assignee:  -> orsenthil
nosy: +orsenthil

___
Python tracker 

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



[issue43409] [Win] Call subprocess.Popen() twice makes Thread.join() interruptible and deadlock

2021-03-05 Thread Eryk Sun


Eryk Sun  added the comment:

This is a variation on bpo-21822. If join() is called in the main thread, and 
it gets interrupted immediately after the lock.acquire(block, timeout) call, 
then subsequent calls will hang. In Windows, the acquire() call is not 
interruptible with Ctrl+C, so the KeyboardInterrupt gets raised immediately 
after acquire() returns, so the problem is easy to reproduce in Windows.

--
nosy: +eryksun
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> KeyboardInterrupt during Thread.join hangs that Thread

___
Python tracker 

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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-05 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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-05 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I think we should look into having some variable holding all the text that we 
have parsed so far. All the workarounds to fetch the text from the file or from 
stdin or whatnot are getting very very complicated.

--
stage: patch review -> 

___
Python tracker 

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



[issue43401] dbm module doc page redirects to itself

2021-03-05 Thread Numerlor


Numerlor  added the comment:

The issue seems to have resolved itself now, but may be worth a look for the 
cause.

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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue43410] Parser does not handle correctly some errors when parsin from stdin

2021-03-05 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

The parser crashes when there are some syntax errors from stdin:

> echo "(1+34"  | ./python.exe -
[1]54046 doneecho "(1+34" |
   54047 segmentation fault  ./python.exe -

--
components: Interpreter Core
messages: 388157
nosy: lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: Parser does not handle correctly some errors when parsin from stdin
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



[issue41180] marshal load bypass code.__new__ audit event

2021-03-05 Thread Yunfan Zhan


Change by Yunfan Zhan :


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



[issue43409] [Win] Call subprocess.Popen() twice makes Thread.join() interruptible and deadlock

2021-03-05 Thread Zhang Boyang


New submission from Zhang Boyang :

Please run joinbug.py and press Ctrl-C twice.

= The output  =

1st join
PLEASE PRESS CTRL-C TWICE, IGNORE THE 'Press any key to continue'
Press any key to continue . . . Press any key to continue . . .

thread exit
Traceback (most recent call last):
  File "D:\xxx\joinbug.py", line 21, in 
t.join() # subprocess.Popen() makes join() can be interrupted
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\threading.py", 
line 1033, in join
self._wait_for_tstate_lock()
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\threading.py", 
line 1049, in _wait_for_tstate_lock
elif lock.acquire(block, timeout):
KeyboardInterrupt
2nd join
(stuck here)


= Expected behaviour =
either join uninterruptible
or the 2nd join doesn't deadlock.

--
components: Windows
files: joinbug.py
messages: 388156
nosy: paul.moore, steve.dower, tim.golden, zach.ware, zby1234
priority: normal
severity: normal
status: open
title: [Win] Call subprocess.Popen() twice makes Thread.join() interruptible 
and deadlock
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49853/joinbug.py

___
Python tracker 

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



[issue27803] ctypes automatic byref failing on custom classes attributes

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5

___
Python tracker 

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



[issue25653] ctypes+callbacks+fork+selinux = crash

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.2, Python 
3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue8557] subprocess PATH semantics and portability

2021-03-05 Thread Eryk Sun


Eryk Sun  added the comment:

The Popen() docs begin by explaining that it has "os.execvp()-like" behavior in 
POSIX and uses CreateProcess() in Windows. Personally, I do not think it's 
proper for Python's documentation to discuss details of  how CreateProcess() 
handles lpCommandLine (args), lpApplicationName (executable), 
lpCurrentDirectory (cwd), and lpEnvironment (env). So maybe all this needs is 
to clearly map Popen() parameters to the corresponding CreateProcess() 
parameters.

If Popen() implements a parameter on its own, then it makes sense to me to 
document the behavior. For example, in POSIX the behavior of `cwd` is 
implemented by Popen(), and documented as follows:

In particular, the function looks for executable (or for the first 
item in args) relative to cwd if the executable path is a relative
path.

This claim is not always true in POSIX since a base filename without a slash in 
it, which is a relative path, is not searched for in the current directory 
unless "." is in PATH. But the main problem with the above sentence is the lack 
of a disclaimer that it only applies to POSIX. In Windows, `cwd` is passed 
through directly as the lpCurrentDirectory of CreateProcess(). This parameter 
sets the working directory of the child process and has nothing to do with 
searching for an executable parsed out of lpCommandLine or resolving a relative 
path in lpApplicationName. It may affect the result with shell=True, but even 
in that case there are caveats. Regardless, Python doesn't do anything with 
`cwd` in Windows except pass it to CreateProcess(), so the cwd -> 
lpCurrentDirectory parameter mapping is all there is to document.

--
status: languishing -> open
type: behavior -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue43408] about the method: title()

2021-03-05 Thread Christian Heimes


Christian Heimes  added the comment:

This behavior is documented, 
https://docs.python.org/3/library/stdtypes.html#str.title

> The algorithm uses a simple language-independent definition of a word as 
> groups of consecutive letters. The definition works in many contexts but it 
> means that apostrophes in contractions and possessives form word boundaries, 
> which may not be the desired result

The documentation also mentions a workaround.

--
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43408] about the method: title()

2021-03-05 Thread Qihao Chen


New submission from Qihao Chen :

Hello, I'm a student from China, and I think there is a bug in Python3.7.

When I use the method "title()", I think the method should not make "'s" upper.

I would appreciate it if you could consider my advice.

--
files: title().png
messages: 388153
nosy: chinkikoo227
priority: normal
severity: normal
status: open
title: about the method: title()
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49852/title().png

___
Python tracker 

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



[issue30469] Inconsistent Execution of Generic Descriptor Attributes

2021-03-05 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue30469] Inconsistent Execution of Generic Descriptor Attributes

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue16272] C-API documentation clarification for tp_dictoffset

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
type:  -> enhancement
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue16272] C-API documentation clarification for tp_dictoffset

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
Removed message: https://bugs.python.org/msg221020

___
Python tracker 

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



[issue29533] urllib2 works slowly with proxy on windows

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.6

___
Python tracker 

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



[issue28356] Windows: os.rename different in python 2.7.12 and python 3.5.2

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
type: behavior -> enhancement
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue42627] urllib.request.getproxies() misparses Windows registry proxy settings

2021-03-05 Thread 狂男风

狂男风  added the comment:

I make some black box tests with the HTTPS proxy. 
Set system proxy `http=https://host:port` and start a HTTPS proxy, then IE, 
Edge (Chromium) and benrg's code (using `urllib3`) work fine while fetching 
`http://website`. Then I shutdown the HTTPS proxy and start a HTTP proxy on the 
same port, I get SSLError. That's it.

benrg should add your patch as soon as possible.
Too few people actually use HTTPS proxy. Even if there is a bug with HTTPS 
proxy, it will not be too late to fix it when it is discovered.

--

___
Python tracker 

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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2021-03-05 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue43395] os.path states that bytes can't represent all MBCS paths under Windows

2021-03-05 Thread Eryk Sun

Eryk Sun  added the comment:

>  instead of the stated 'surrogatepass'

In Python 3.6 and above, you can check this as follows:

>>> sys.getfilesystemencoding()
'utf-8'
>>> sys.getfilesystemencodeerrors()
'surrogatepass'

In Python 3.5 and previous:

>>> sys.getfilesystemencoding()
'mbcs'

In 3.5, the error handler used by fsencode() and fsdecode() was hard coded as 
'strict' for the 'mbcs' encoding, and otherwise 'surrogateescape'.

> https://docs.python.org/3/library/os.html#os.fsencode
> https://docs.python.org/3/library/os.html#os.fsdecode

The above documentation needs to be updated to reference 
sys.getfilesystemencodeerrors(), as do the doc strings:

>>> print(textwrap.dedent(os.fsencode.__doc__))

Encode filename to the filesystem encoding with 'surrogateescape' error
handler, return bytes unchanged. On Windows, use 'strict' error handler if
the file system encoding is 'mbcs' (which is the default encoding).

>>> print(textwrap.dedent(os.fsdecode.__doc__))

Decode filename from the filesystem encoding with 'surrogateescape' error
handler, return str unchanged. On Windows, use 'strict' error handler if
the file system encoding is 'mbcs' (which is the default encoding).

> https://docs.python.org/3/library/os.html#file-names-command-line-arguments-and-environment-variables

This should be rewritten to link to sys.getfilesystemencodeerrors(). I'm fine 
with only discussing the use of "surrogateescape", which is a significant 
concern in POSIX systems, for which it is very easy and common for filenames to 
be created with an arbitrary encoding. 

I don't know if the use of "surrogatepass" in Windows warrants discussion. It 
is uncommon to need the error handler because the filesystem is Unicode. A user 
is unlikely to create a filename with an unpaired surrogate code. 

That said, before Windows 10, the legacy console allowed copying half of a 
surrogate pair to the clipboard, and a program could have a bug that nulls the 
second surrogate code in the pair (e.g. when limiting the length of a 
filename). Anyway, it's technically possible, so we support it. For example, 
"" (U+0001F608) is encoded in UTF-16 as the pair (U+D83D, U+DE08). A filename 
could end up with only the first of the two codes:

>>> open('devil\ud83d', 'w').close()
>>> print(ascii(os.listdir('.')[0]))
'devil\ud83d'

--

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-05 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
pull_requests: +23534
pull_request: https://github.com/python/cpython/pull/24762

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-05 Thread Antoine Pitrou


Antoine Pitrou  added the comment:


New changeset 68245b7a1030287294c65c298975ab9026543fd2 by Antoine Pitrou in 
branch 'master':
bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to 
execute a non-Python signal handler (GH-24756)
https://github.com/python/cpython/commit/68245b7a1030287294c65c298975ab9026543fd2


--

___
Python tracker 

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



[issue43406] Possible race condition between signal catching and signal.signal

2021-03-05 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +23533
pull_request: https://github.com/python/cpython/pull/24761

___
Python tracker 

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