[issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently

2021-06-25 Thread Steven D'Aprano
Steven D'Aprano added the comment: Dennis is correct: these are working as attended, you have just misunderstood what they are supposed to do. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python

[issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently

2021-06-25 Thread Dennis Sweeney
Dennis Sweeney added the comment: This is the intended behavior. Use s.removeprefix() and s.removesuffix() instead. -- nosy: +Dennis Sweeney ___ Python tracker ___

[issue44513] for string methods strip, lstrip, rstrip, when param is a string which has more than one char, those methods is no useful currently

2021-06-25 Thread redrose2100
New submission from redrose2100 : for string methods strip, lstrip, rstrip, when param is a string which has more than 1 char, currently those methods remove char ,but not remove string , it is no useful following is the results in python 3.9.5 Python 3.9.5 (default, May 18 2021, 14:42:02)

[issue44504] Make docstring quotes consistent in Lib/_collections_abc.py

2021-06-25 Thread Raymond Hettinger
Raymond Hettinger added the comment: Marking as closed for the reasons listed in the PR comments. -- nosy: +rhettinger resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue44512] csv.DictWriter: inconsistency in handling of extrasaction arg

2021-06-25 Thread Andrei Kulakov
New submission from Andrei Kulakov : In csv.DictWriter, the arg `extrasaction` case is handled inconsistently: - if it's misspelled, e.g. ignor instead of 'ignore', a ValueError is raised by the __init__ method. - if it's 'Ignore', 'IGNORE', it will work properly - if it's 'raise', it will

[issue44510] file.read() UnicodeDecodeError with UTF-8 BOM in files on Windows

2021-06-25 Thread Eryk Sun
Eryk Sun added the comment: > On Windows we currently still default to your console encoding In Windows, the default encoding for open() is the ANSI code page of the current process [1], from GetACP(), which is based on the system locale, unless it's overridden to UTF-8 in the application

[issue44510] file.read() UnicodeDecodeError with UTF-8 BOM in files on Windows

2021-06-25 Thread Steve Dower
Steve Dower added the comment: The file that fails contains a UTF-8 BOM at the start, which is a multibyte character indicating that the file is definitely UTF-8. Unfortunately, none of Python's default settings will handle this, because it's a convention that only really exists on Windows.

[issue44511] Improve the bytecode for mapping patterns

2021-06-25 Thread Brandt Bucher
New submission from Brandt Bucher : The generated bytecode for mapping patterns is more complicated than it needs to be: - Matching sub-patterns involves indexing into a tuple of values in order to extract them. We already know the size of this tuple at compile-time, so we can just unpack

[issue44510] file.read() UnicodeDecodeError with large files on Windows

2021-06-25 Thread Jason Yundt
Change by Jason Yundt : -- nosy: +jayman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44510] file.read() UnicodeDecodeError with large files on Windows

2021-06-25 Thread Rohan Amin
New submission from Rohan Amin : When using file.read() with a large text file, there is a UnicodeDecodeError. I expected file.read(1) to read one character from the file. It works with a smaller text file. I experienced this bug on Windows 10 version 20H2. My teacher couldn't reproduce

[issue36265] Remove ABCs from collections

2021-06-25 Thread Irit Katriel
Irit Katriel added the comment: This was updated in later 3.8.X versions: https://github.com/python/cpython/blob/71ba16b21cb35923098026117b5e6d823c5f5707/Lib/collections/__init__.py#L49 warnings.warn("Using or importing the ABCs from 'collections' instead " "of from

[issue44509] Build in type alias for paths

2021-06-25 Thread alex rakowski
alex rakowski added the comment: I just noticed this issue was raised and dismissed in PEP 519 -- Adding a file system path protocol. -- stage: -> resolved status: open -> closed ___ Python tracker

[issue38055] Starting multiprocessing.Process raises FileNotFoundError unexpectedly

2021-06-25 Thread Irit Katriel
Irit Katriel added the comment: Closing as there isn't enough information about the problem. If you are still seeing it, please create a new issue with full details. -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python

[issue32215] sqlite3 400x-600x slower depending on formatting of an UPDATE statement in a string

2021-06-25 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue41866] Document error in chinese version of contextlib.

2021-06-25 Thread Irit Katriel
Change by Irit Katriel : -- nosy: +zhsj ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue41539] print blocks with multiprocessing and buffered output

2021-06-25 Thread Irit Katriel
Irit Katriel added the comment: Is there anything left here? I've seen it mentioned on other issues of this sort that mixing multiprocessing and threading leads to problems. Should we document that? -- ___ Python tracker

[issue15066] make install error: ImportError: No module named _struct

2021-06-25 Thread Irit Katriel
Change by Irit Katriel : -- stage: -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38146] QVariant NULL returns anomalous values in equality statements

2021-06-25 Thread Irit Katriel
Change by Irit Katriel : -- stage: -> resolved status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue44109] missing dataclass decorator in match-statement example

2021-06-25 Thread Andrei Kulakov
Andrei Kulakov added the comment: I agree the example is confusing for all of the stated reasons. It seems to me it's better to use a plain class with a `__init__()` for two reason: - for people who are not familiar with namedtuples or dataclasses, it would be harder to learn two fairly

[issue44509] Build in type alias for paths

2021-06-25 Thread alex rakowski
New submission from alex rakowski : Hello, I've noticed that when type hinting paths, it often becomes a bit verbose: from typing import Union import pathlib custom_path = Union[str, pathlib.Path] def foobar(x:custom_path): ... Writing functions which handle paths are pretty routine,

[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-06-25 Thread miss-islington
miss-islington added the comment: New changeset 88970125e7a4917966f711dc7e93cf170977034f by Miss Islington (bot) in branch '3.10': bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864)

[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-06-25 Thread miss-islington
Change by miss-islington : -- pull_requests: +25484 pull_request: https://github.com/python/cpython/pull/26908 ___ Python tracker ___

[issue43977] Implement the latest semantics for PEP 634 for matching collections

2021-06-25 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset ca2009d72a52a98bf43aafa9ad270a4fcfabfc89 by Brandt Bucher in branch 'main': bpo-43977: Properly update the tp_flags of existing subclasses when their parents are registered (GH-26864)

[issue44508] asyncio: document failure mode for loop.call_soon_threadsafe

2021-06-25 Thread Mark Dickinson
New submission from Mark Dickinson : `loop.call_soon_threadsafe` raises `RuntimeError` when the event loop has been closed, but that fact doesn't seem to be documented. It would be useful to document it so that that it's clear that that behaviour is part of the API, and can be depended on.

[issue43944] Processes in Python 3.9 exiting with code 1 when It's created inside a ThreadPoolExecutor

2021-06-25 Thread Alexandre Sicard
Alexandre Sicard added the comment: Thank you very much for this report, Genaro. I encountered the same bug with a Process running in the context of a Django view. Downgrading to Python 3.8 also fixed the issue for me. Versions: python:3.9-alpine Docker image, running Python 3.9.5 and

[issue36392] IPv4Interface Object has no attributte prefixlen

2021-06-25 Thread Václav Šmilauer
Václav Šmilauer added the comment: This one works: addr.network.prefixlen. It took me a while to find out; I find the documentation somewhat confusing in this point. -- nosy: +eudoxos ___ Python tracker