Change by Matthew Rahtz :
--
pull_requests: +30197
pull_request: https://github.com/python/cpython/pull/32119
___
Python tracker
<https://bugs.python.org/issue43
Matthew Rahtz added the comment:
Since things are piling up, here's a quick record of what I think the remaining
tasks are: (in approximate order of priority)
1. Finish writing docs (is updating library/typing.html sufficient?
https://github.com/python/cpython/pull/32103)
2. Impl
Change by Matthew Rahtz :
--
pull_requests: +30237
pull_request: https://github.com/python/cpython/pull/32159
___
Python tracker
<https://bugs.python.org/issue43
Matthew Barnett added the comment:
For reference, I also implemented .regs in the regex module for compatibility,
but I've never used it myself. I had to do some investigating to find out what
it did!
It returns a tuple of the spans of the groups.
Perhaps I might have used it if it d
Matthew Rahtz added the comment:
> 1. Finish writing docs
Done once https://github.com/python/cpython/pull/32103 is merged.
> 2. Implement support for pickling of unpacked native tuples
Done once https://github.com/python/cpython/pull/32159 is merged.
4. Resolve the issue of
Matthew Rahtz added the comment:
Apologies for the slow reply - coming back to this now that the docs and
pickling issues are mostly sorted.
[Serhiy]
> > Alias = C[T, *Ts]
> > Alias2 = Alias[*tuple[int, ...]]
> > # Alias2 should be C[int, *tuple[int, ...]]
>
> tuple
Matthew Rahtz added the comment:
[Guido]
> 1. Some edge case seems to be that if *tuple[...] is involved on either side
> we will never simplify.
Alright, let me think this through with some examples to get my head round it.
It would prohibit the following difficult case:
class C(G
Change by Matthew Rahtz :
--
keywords: +patch
pull_requests: +30396
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/32341
___
Python tracker
<https://bugs.python.org/issu
Matthew Rahtz added the comment:
Ok, https://github.com/python/cpython/pull/32341/files is a reference of how
the current implementation behaves. Fwiw, it *is* mostly correct - with a few
minor tweaks it might be alright for at least the 3.11 release.
In particular, instead of dealing with
Matthew Barnett added the comment:
You wrote "the u had already been removed by hand". By removing the u in the
_Python 2_ code, you changed that string from a Unicode string to a bytestring.
In a bytestring, \u is not an escape; b"\u" == b"\\u".
Matthew Barnett added the comment:
A numeric escape of 3 digits is an octal (base 8) escape; the octal escape
"\100" gives the same character as the hexadecimal escape "\x40".
In a replacement template, you can use "\g<100>" if you want group 100 becau
Matthew Barnett added the comment:
If we did decide to remove it, but there was still a demand for octal escapes,
then I'd suggest introducing \oXXX.
--
___
Python tracker
<https://bugs.python.org/is
Matthew Barnett added the comment:
Suppose you had a pattern:
.*
It would advance one character on each iteration of the * until the . failed to
match. The text is finite, so it would stop matching eventually.
Now suppose you had a pattern:
(?:)*
On each iteration of the * it
Matthew Barnett added the comment:
It's been many years since I looked at the code, and there have been changes
since then, so some of the details might not be correct.
As to have it should behave:
re.match('(?:()|(?(1)()|z)){1,2}(?(2)a|z)', 'a')
Iteration 1.
Match
New submission from Matthew Suozzo :
An unfortunately common pattern over large codebases of Python tests is for
spec'd Mock instances to be provided with Mock objects as their specs. This
gives the false sense that a spec constraint is being applied when, in fact,
nothing will be disal
Change by Matthew Hughes :
--
keywords: +patch
pull_requests: +23612
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24851
___
Python tracker
<https://bugs.python.org/issu
Matthew Suozzo added the comment:
I've fixed a bunch of these in our internal repo so I'd be happy to add that to
a patch implementing raising exceptions for these cases.
--
___
Python tracker
<https://bugs.python.o
Matthew Suozzo added the comment:
A few more things:
Assertions on Mock-autospec'ed Mocks will silently pass since e.g.
assert_called_once_with will now be mocked out. This may justify a more
stringent stance on the pattern since it risks hiding real test failures.
One complicating f
Matthew Suozzo added the comment:
And to give some context for the above autospec child bit, this is the relevant
code that determines the spec to use for each child:
https://github.com/python/cpython/blob/master/Lib/unittest/mock.py#L2671-L2696
Matthew Barnett added the comment:
I'm also -1, for the same reason as Serhiy gave. However, if it was opt-in,
then I'd be OK with it.
--
nosy: +mrabarnett
___
Python tracker
<https://bugs.python.o
Matthew Barnett added the comment:
Do any other regex implementations behave the way you want?
In my experience, there's no single "correct" way for a regex to behave;
different implementations might give slightly different results, so if the most
common ones behave a ce
New submission from Matthew Suozzo :
Given the increasing use of long `from typing import foo, bar, ...` import
sequences, it's becoming more desirable to address individual components of the
import node. Unfortunately, the ast.alias node doesn't contain source location
metadata (e
Change by Matthew Suozzo :
--
keywords: +patch
pull_requests: +24059
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25324
___
Python tracker
<https://bugs.python.org/issu
Matthew Suozzo added the comment:
Ah and one other question: Is this normally the sort of thing that would get
backported? It should be very straightforward to do so, at least for 3.9 given
the support for the new parser.
--
versions: -Python 3.6, Python 3.7, Python 3.8
Change by Matthew Suozzo :
--
keywords: +patch
nosy: +matthew.suozzo
nosy_count: 7.0 -> 8.0
pull_requests: +24061
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25326
___
Python tracker
<https://bugs.p
Matthew Suozzo added the comment:
I don't think this was actually fixed for the create_autospec case.
create_autospec still uses the only is_async_func check to enable use of
AsyncMock and that still does a __code__ check.
There was a test submitted to check this case but the test i
Change by Matthew Suozzo :
--
pull_requests: +24081
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/25347
___
Python tracker
<https://bugs.python.org/issu
Matthew Barnett added the comment:
The case:
' a b c '.split(maxsplit=1) == ['a', 'b c ']
suggests that empty strings don't count towards maxsplit, otherwise it would
return [' a b c '] (i.e. the split would give ['', ' a
Matthew Barnett added the comment:
The best way to think of it is that .split() is like .split(' '), except that
it's splitting on any whitespace character instead of just ' ', and keepempty
is defaulting to False instead of True.
Therefore:
' x y z
Matthew Barnett added the comment:
We have that already, although it's spelled:
' x y z'.split(maxsplit=1) == ['x', 'y z']
because the keepempty option doesn't exist yet.
--
___
Python trac
Matthew Barnett added the comment:
I've only just realised that the test cases don't cover all eventualities: none
of them test what happens with multiple spaces _between_ the letters, such as:
' a b c '.split(maxsplit=1) == ['a', 'b c ']
Com
New submission from Matthew Clapp :
The docs for the venv module, EnvBuilder class, ensure_directories method,
describe behavior that doesn't match what its actual behavior is, (and what the
code is). I propose to update the documentation of the API to match the actual
behavior.
Change by Matthew Clapp :
--
keywords: +patch
pull_requests: +25250
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26663
___
Python tracker
<https://bugs.python.org/issu
Matthew Clapp added the comment:
To clarify my intent: I'd really love a way to get the paths info from context
from an existing native venv without affecting the directories of the venv. It
seems like this is what ensure_directories *actually* does if clear==False.
I'm hoping
Matthew Barnett added the comment:
It's called "catastrophic backtracking". Think of the number of ways it could
match, say, 4 characters: 4, 3+1, 2+2, 2+1+1, 1+3, 1+2+1, 1+1+2, 1+1+1+1. Now
try 5 characters...
--
___
Python
New submission from Matthew Zielinski :
The Manual for python 3.9.6 always says there are no entries. I searched things
it definitely had, like modules, but it said there were no topics found.
--
components: Library (Lib)
files: Python Error.png
messages: 398261
nosy: matthman2019
Matthew Kenigsberg added the comment:
I think it would be nice to have a from str method that could reverse the
behavior of str(timedelta). I'm trying to parse files that contain the output
of str(timedelta), and there's no easy way to get them back to timedelta's
Matthew Barnett added the comment:
I'd probably say "In the face of ambiguity, refuse the temptation to guess".
As there's disagreement about the 'correct' default, make it None and require
either "big" or "little" if lengt
Matthew Barnett added the comment:
I wonder whether there should be a couple of other endianness values, namely,
"native" and "network", for those cases where you want to be explicit about it.
If you use "big" it's not clear whether that's because you
Matthew Barnett added the comment:
It can be shortened to this:
buffer = b"a" * 8191 + b"\\r\\n"
with open("bug_csv.csv", "wb") as f:
f.write(buffer)
with open("bug_csv.csv", encoding="unicode_escape", newline="") as
Matthew Barnett added the comment:
It's definitely a bug.
In order for the pattern to match, the negative lookaround must match, which
means that its subexpression mustn't match, so none of the groups in that
subexpression have captured.
--
versions: +P
Matthew Barnett added the comment:
For comparison, the regex module says that 0x1C..0x1F aren't whitespace, and
the Unicode property White_Space ("\p{White_Space}" in a pattern, where
supported) also says that they ar
Matthew Barnett added the comment:
It's not just in the 'if' clause:
>>> class Foo:
... a = ['a', 'b']
... b = ['b', 'c']
... c = [b for x in a]
...
Traceback (most recent call last):
File "", line 1, i
Matthew Barnett added the comment:
I could also add: would sorting be case-sensitive or case-insensitive? Windows
is case-insensitive, Linux is case-sensitive.
--
nosy: +mrabarnett
___
Python tracker
<https://bugs.python.org/issue38
Matthew Barnett added the comment:
I've just tried it on Windows 10 with Python 3.8 64-bit and Python 3.8 32-bit
without issue.
--
nosy: +mrabarnett
___
Python tracker
<https://bugs.python.org/is
Matthew Smith added the comment:
This issue also affects me, pyth. I tried it out with various combinations of
sleep, and durations of tasks, but what I noticed is that
threading_shutdown_locks continues to grow at each iteration.
for i in range(10):
for j in range(10
New submission from Matthew Newville :
We have a library (https://github.com/pyepics/pyepics) that wraps several C
structures for a communication protocol library that involves many C->Python
callbacks. One of the simpler structures we wrap with ctypes is defined with
typedef str
Matthew Newville added the comment:
Thanks for the reply and the fix -- I have not tried the master branch, but
will try to do that soon. If I understand correctly, we will have to stick with
our kludgy "workaround" version in order to work with Python 3.7.6 and 3.8.1.
Or is ther
Matthew Newville added the comment:
So, again, I'm trying to understand what the best workaround for this change
is. I asked "can this workaround be improved" twice and got no reply, while
getting plenty of responses to questions about the development process. I take
this t
Matthew Newville added the comment:
@eryksun Sorry for the imprecision -- I was mixing what we do on Linux and
Windows. A minimum verifiable example for Linux/MacOS would be
import ctypes
class bitstruct(ctypes.Structure):
_fields_ = [('addr', cty
Matthew Fernandez added the comment:
I'm trying to follow the history of this issue, as it does not seem fully
resolved to me. While trying to package something for Debian, one of the buildd
[0] logs for hurd-i386 points to this issue as the cause of a failure [1]. This
occurs with P
Matthew Barnett added the comment:
Python floats have 53 bits of precision, so ints larger than 2**53 will lose
their lower bits (assumed to be 0) when converted.
--
nosy: +mrabarnett
resolution: -> not a bug
___
Python tracker
<
Change by Matthew Barnett :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue39436>
___
___
Python-bugs-list
Matthew Barnett added the comment:
A smaller change to the regex would be to replace the "(?:.*,)*" with
"(?:[^,]*,)*".
I'd also suggest using a raw string instead:
rx = re.compile(r'''(?:[^,]*,)*[ \t]*([^ \t]+)[ \t]+realm=(["']?)(
Matthew Barnett added the comment:
Duplicate of Issue39687.
See https://docs.python.org/3/library/re.html#re.sub and
https://docs.python.org/3/whatsnew/3.7.html#changes-in-the-python-api.
--
resolution: -> duplicate
stage: -> resolved
status: open -&g
Matthew Barnett added the comment:
The documentation is talking about whether it'll match at the current position
in the string. It's not a bug.
--
resolution: -> not a bug
___
Python tracker
<https://bugs.pytho
Matthew Barnett added the comment:
That's what searching does!
Does the pattern match here? If not, advance by one character and try again.
Repeat until a match is found or you've reached the end.
--
___
Python tracker
<https://bu
New submission from Matthew Davis :
# Summary
When parsing emails with long attachment file names, part.get_filename() often
returns \n or \r\n.
It should strip those characters out.
# Steps to reproduce
I have attached a minimal working example.
The relevant part of the raw email is
Matthew Davis added the comment:
Ah woops, I mistyped the relevant ticket.
It's issue 36401
https://bugs.python.org/issue36041
--
___
Python tracker
<https://bugs.python.org/is
Matthew Davis added the comment:
36041
--
___
Python tracker
<https://bugs.python.org/issue40359>
___
___
Python-bugs-list mailing list
Unsubscribe:
Matthew Davis added the comment:
Ah, yes that workaround works. Thanks!
So what's the exact status of this policy? It's called the default policy, but
it's not used by default?
If I download the latest version of python, will this be parsed correctly
without explicitly set
New submission from Matthew Suozzo :
# Issue
When profiling a generator function, the initial call and all subsequent yields
are aggregated into the same "ncalls" metric by cProfile.
## Example
>>> cProfile.run("""
... def foo():
... yield 1
... yield
New submission from Matthew Walker :
It would be very useful if the documentation for Python's Wave module mentioned
that 8-bit samples must be unsigned while 16-bit samples must be signed.
See the Wikipedia article on the WAV format: "There are some inconsistencies in
the WAV f
Matthew Suozzo added the comment:
One of the problems with my proposed solution that I glossed over was how and
where to count the primitive call. If the primitive call is only registered on
RETURN (i.e. after all yields), a generator that is incompletely exhausted
would have 0 primitive
Matthew Barnett added the comment:
In a regex, putting a backslash before any character that's not an ASCII-range
letter or digit makes it a literal. re.escape doesn't special-case control
characters. Its purpose is to make a string that might contain metacharacters
into on
Matthew Barnett added the comment:
It's not a crash. It's complaining that you're referring to group 2 before
defining it. The re module doesn't support forward references to groups, but
only backward references to them.
--
__
Matthew Barnett added the comment:
Example 1:
((a)|b\2)*
^^^ Group 2
((a)|b\2)*
^^ Reference to group 2
The reference refers backwards to the group.
Example 2:
(b\2|(a))*
^^^ Group 2
(b\2|(a))*
^^ Reference to group 2
Matthew Barnett added the comment:
Sorry to bikeshed, but I think it would be clearer to keep the version next to
the "python" and the "setup" at the end:
python-3.10.0a5-win32-setup.exe
python-3.10.0a5-win64-setup.exe
Change by Matthew Rahtz :
--
components: Library (Lib)
nosy: mrahtz
priority: normal
severity: normal
status: open
title: Add support for PEP 646 (Variadic Generics) to typing.py
versions: Python 3.10
___
Python tracker
<https://bugs.python.
Change by Matthew Rahtz :
--
keywords: +patch
nosy: +matthew.rahtz
nosy_count: 1.0 -> 2.0
pull_requests: +23313
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/24527
___
Python tracker
<https://bugs.p
New submission from Matthew Hughes :
Just a small thing in these docs, there is a mix of "#include
", e.g.
https://github.com/python/cpython/blame/master/Doc/extending/newtypes_tutorial.rst#L243
and '#include "structmember.h"', mostly in the included samples e
New submission from Matthew Woodcraft :
The documentation for json.load() and json.loads() says:
« If the data being deserialized is not a valid JSON document, a
JSONDecodeError will be raised. »
But this is not currently entirely true: if the data is provided in bytes form
and is not
New submission from Matthew Francis <4576fran...@gmail.com>:
Currently, using await inside a coroutine will block inside the coroutine.
This behavior would usually be fine, but for some usecases a way to
nonblockingly run coroutines without creating a Task could be useful, because
Change by Matthew Lovell :
--
nosy: +mattblovell
___
Python tracker
<https://bugs.python.org/issue40827>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Matthew Hughes :
While investigating Python's SSL I noticed there was no interface for
interacting with OpenSSL's SSL_CTX_{get,set}_security_level
(https://www.openssl.org/docs/manmaster/man3/SSL_CTX_get_security_level.html)
so I thought I'd look into
Matthew Hughes added the comment:
> Applications should not change this setting
> A read-only getter for the policy sounds like a good idea, though.
Thanks for the feedback, sounds reasonable to me. I'll happily work on getting
a PR up for the read-
Change by Matthew Hughes :
--
pull_requests: +20431
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/21282
___
Python tracker
<https://bugs.python.org/issu
Matthew Hughes added the comment:
I noticed this test was still emitting a "ResourceWarning":
--
$ ./python -m test test_ssl -m TestPostHandshakeAuth
0:00:00 load avg: 0.74 Run tests sequentially
0:00:00 load avg:
Matthew Hughes added the comment:
Whoops, I realise the patch I shared contained a combination of two
(independent) approaches I tried:
1. Add sleep and perform cleanup
2. Naively patch catch_threading_exception to accept a cleanup routine to be
run upon exiting but before removing the
Change by Matthew Hughes :
--
pull_requests: +20541
pull_request: https://github.com/python/cpython/pull/21393
___
Python tracker
<https://bugs.python.org/issue37
New submission from Matthew Hughes :
>>> import argparse
>>> parser = argparse.ArgumentParser(exit_on_error=False)
>>> parser.parse_args(["--unknown"])
usage: [-h]
: error: unrecognized arguments: --unknown
The docs https://docs.python.o
Matthew Hughes added the comment:
> typo in the docs that it should have used enabled instead of enable
Well spotted, I'll happily fix this up.
> I guess the docs by manually mean that ArgumentError will be raised when
> exit_on_error is False that can be handled.
To be clear
Matthew Hughes added the comment:
I've attached a patch containing tests showing the current behavior, namely
that exit_on_error does not change the behavior of
argparse.ArgumentParser.parse_args in either case:
* An unrecognized option is given
* A required option is not given
Shoul
Matthew Davis added the comment:
The documentation says "you will have to clear the cached value"
What does that mean? How do I clear the cached value? Is there a flush function
somewhere? Do I `del` the attribute? Set the attribute to None?
The documentation as it stands toda
Matthew Barnett added the comment:
I think what's happening is that in 'compiler_dict' (Python/compile.c), it's
checking whether 'elements' has reached a maximum (0x). However, it's not
doing this after incrementing; instead, it's checking before i
Matthew Barnett added the comment:
The 4th argument of re.sub is 'count', not 'flags'.
re.IGNORECASE has the numeric value of 2, so:
re.sub(r'[aeiou]', '#', 'all is fair in love and war', re.IGNORECASE)
is equivalent to:
re.sub(r
Matthew Barnett added the comment:
The arguments are: re.sub(pattern, repl, string, count=0, flags=0).
Therefore:
re.sub("pattern","replace", txt, re.IGNORECASE | re.DOTALL)
is passing re.IGNORECASE | re.DOTALL as the count, not the flags.
It's in the document
New submission from Matthew Davis :
# Summary
I propose an additional unit test type for the unittest module.
TestCase.assertDuration(min=None, max=None), which is a context manager,
similar to assertRaises. It runs the code inside it, and then fails the test if
the duration of the code
Matthew Barnett added the comment:
Arguments are evaluated first and then the results are passed to the function.
That's true throughout the language.
In this instance, you can use \g<1> in the replacement string to refer to group
1:
re.sub(r'([a-z]+)', fr"\g<
Matthew Suozzo added the comment:
> It just won't work unless you add explicit ".*" or ".*?" at the start of the
> pattern
But think of when regexes are used for validating input. Getting it to "just
work" may be over-permissive validation that o
Matthew Barnett added the comment:
Not a bug.
Argument 4 of re.sub is the count:
sub(pattern, repl, string, count=0, flags=0)
not the flags.
--
nosy: +mrabarnett
resolution: -> not a bug
stage: -> resolved
status: open -> closed
_
Matthew Barnett added the comment:
That behaviour has nothing to do with re.
This line:
samples = filter(lambda sample: not pttn.match(sample), data)
creates a generator that, when evaluated, will use the value of 'pttn' _at that
time_.
However, you then bind 'pttn
Matthew Barnett added the comment:
This should answer that question:
>>> re.findall(r"[\A\C]", r"\AC")
['C']
>>> regex.findall(r"[\A\C]", r"\AC")
['A', 'C
Matthew Barnett added the comment:
In re, "\A" within a character set should be similar to "\C", but instead it's
still interpreted as meaning the start of the string. That's definitely a bug.
If it doesn't do what it's supposed to do, then it's a
New submission from Matthew Woodcraft :
The documentation for the sqlite3 module contains the following statement,
under 'Cursor.rowcount':
For DELETE statements, SQLite reports rowcount as 0 if you make a DELETE FROM
table without any condition.
This doesn't happen for
Matthew Barnett added the comment:
The documentation says of the 'pos' parameter "This is not completely
equivalent to slicing the string" and of the 'endpos' parameter "it will be as
if the string is endpos characters long".
In other words, it st
New submission from Matthew Miller :
I have a tarfile with relative paths. The tail of tar tvf looks like this:
-rw-r--r-T nobody/nobody 1356 2012-02-28 19:25 s/772
-rw-r--r-- nobody/nobody 1304 2012-02-28 19:25 s/773
-rw-r--r-- nobody/nobody 1304 2012-02-28 19:25 s/774
-rw-r--r-- nobody
Matthew Barnett added the comment:
Ideally, it should raise an exception (or a warning) because the behaviour is
unexpected.
--
___
Python tracker
<http://bugs.python.org/issue13
Matthew Johnson added the comment:
I think he's right to fix those "mistakes". Just see the first sentence @
http://docs.python.org/tutorial/floatingpoint.html#floating-point-arithmetic-issues-and-limitations
It reads: "Floating-point numbers are represented in [...]
Changes by Matthew Miller :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue14160>
___
___
Python-bugs-list mailing list
Unsubscri
301 - 400 of 828 matches
Mail list logo