Martijn Pieters added the comment:
> Private is a subset of special use. Should a "_special_use" constant be
> created. This would include multicast, link_local, private_use, and a few
> more.
There are already dedicated tests for those other special use networks in
i
Change by Martijn Pieters :
--
keywords: +patch
pull_requests: +24826
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26209
___
Python tracker
<https://bugs.python.org/issu
Martijn Pieters added the comment:
Oops, I got my issue numbers mixed up. This is related to #44167, I meant.
--
___
Python tracker
<https://bugs.python.org/issue42
Martijn Pieters added the comment:
This is related to #42937, the IPv4 private network list is not considering the
whole of 192.0.0.0/24 to be private.
RFC 5736 / 6890 reserved 192.0.0.0/24 for special purposes (private networks)
and to date a few subnets of that network have received
New submission from Martijn Pieters :
ipaddress.IPv6Address.is_private uses a hard-coded list of `IPv6Network`
objects that cover private networks to test against.
This list contains two networks that are subnets of a 3rd network in the list.
IP addresses that are not private are tested
Martijn Pieters added the comment:
Might it be better to just *drop* the AutoProxy object altogether?
All that it adds is a delayed call to MakeProxyType(f"AutoProxy[{typeid}]",
exposed) (with exposed defaulting to public_methods(instance)), per instance
per process.
It could b
Martijn Pieters added the comment:
Last but not least, this is essentially a duplicate of
https://bugs.python.org/issue4010
--
___
Python tracker
<https://bugs.python.org/issue40
Martijn Pieters added the comment:
Actually, this won't do it either, as `self.lib_dirs` already contains the
--prefix.
Clearly, I just need to add -R=${PREFIX}/lib to CPPFLAGS.
--
resolution: -> not a bug
___
Python tracker
<
New submission from Martijn Pieters :
This issue goes back a long time. The libreadline handling in the modules
setup.py doesn't add the location of the readline library to the runtime
library paths:
self.add(Extension('readline', ['readline.c'],
library_dirs
Martijn Pieters added the comment:
I've supported people hitting this issue before (see
https://stackoverflow.com/a/53085935/100297, where I used a series of mixin
classes to make use of the changing MRO when the mixins share base classes, to
enforce a field order from inherited classes
Martijn Pieters added the comment:
I found this issue after helping someone solve a Stack Overflow question at
https://stackoverflow.com/q/58767241/100297; they eventually figured out that
their prefix was a path, not a path element.
I'd be all in favour of making tempfile._sanitize_params
Change by Martijn Pieters :
--
keywords: +patch
pull_requests: +16188
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16600
___
Python tracker
<https://bugs.python.org/issu
New submission from Martijn Pieters :
The weakref documentation still mentions weakref.ReferenceError:
https://docs.python.org/3/library/weakref.html#weakref.ReferenceError
But this alias for the built-in ReferenceError exception was removed in the 3.0
development cycle
(https://github.com
New submission from Martijn Pieters :
This is a follow-up to #33261, which added general support for detecting
generator / coroutine / async generator functions wrapped in partials. It
appears that partialmethod objects were missed out.
While a partialmethod object will produce
New submission from Martijn Pieters :
The documentation doesn't make it explicit what happens if you use a bounded
queue together with logging.handlers.QueueHandler.
If the queue is bounded in size and attempts are made to add logrecords faster
than a queue listener removes them
New submission from Martijn Pieters :
The implementation of the logging.handler.QueueHandler and
logging.handler.QueueListener does not make use of the task tracking API of
queues (queue.task_done(), queue.join()) nor does it care if the queue is
unbounded (queue.full(), catching the Full
Change by Martijn Pieters :
--
pull_requests: +12168
___
Python tracker
<https://bugs.python.org/issue12169>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Martijn Pieters :
--
pull_requests: -12166
___
Python tracker
<https://bugs.python.org/issue12169>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Martijn Pieters :
--
keywords: +patch
pull_requests: +12167
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36188>
___
_
New submission from Martijn Pieters :
The implementation of method_hash, method_call and method_descr_get all still
contain assumptions that __self__ can be set to None, a holdover from Python 2
where methods could be *unbound*.
These vestiges can safely be removed, because method_new
Change by Martijn Pieters :
--
pull_requests: +12166
___
Python tracker
<https://bugs.python.org/issue12169>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martijn Pieters :
This is probably a automake bug.
When running CC=clang CXX=clang++ ./configure --enable-optimizations, configure
tests for a non-existing -llvm-profdata binary:
checking for --enable-optimizations... yes
checking for --with-lto... no
checking for -llvm
New submission from Martijn Pieters :
When encountering identifier headers such as Message-ID containing a msg-id
token longer than 77 characters (including the <...> angle brackets), the email
package folds that header using RFC 2047 encoded words, e.g.
Mess
Martijn Pieters added the comment:
(I have no opinion on this having to be a language feature however)
--
___
Python tracker
<https://bugs.python.org/issue35
Martijn Pieters added the comment:
Well, if this is indeed by design (and I missed the list.sort() reference) then
I agree the HOWTO should not be changed!
I'd be happy to change this to asking for more explicit mentions in the docs
for sorted, heapq and bisect that using only < (__l
New submission from Martijn Pieters :
Currently, the sorting HOWTO at
https://docs.python.org/3/howto/sorting.html#odd-and-ends contains the text:
> The sort routines are guaranteed to use __lt__() when making comparisons
> between two objects. So, it is easy to add a standard sort
Martijn Pieters added the comment:
While RFC2047 clearly states that an encoder MUST not split multi-byte
encodings in the middle of a character (section 5, "Each 'encoded-word' MUST
represent an integral number of characters. A multi-octet character may not be
split across adj
Martijn Pieters added the comment:
That regex is incorrect, I should not post untested code from a mobile phone.
Corrected workaround with more context:
import re
from email.policy import EmailPolicy
class UnfoldingEncodedStringHeaderPolicy(EmailPolicy):
def header_fetch_parse(self
Martijn Pieters added the comment:
Right, re-educating myself on the MIME RFCs, and found
https://bugs.python.org/issue1372770 where the same issue is being discussed
for previous incarnations of the email library.
Removing the FWS after CRLF is the wrong thing to do, **unless** RFC2047
Change by Martijn Pieters :
--
components: +email
nosy: +barry, r.david.murray
type: -> behavior
versions: +Python 3.7
___
Python tracker
<https://bugs.python.org/issu
New submission from Martijn Pieters :
The From header in the following email headers is not correctly decoded; both
the subject and from headers contain UTF-8 encoded data encoded with RFC2047
encoded-words, in both cases a multi-byte UTF-8 codepoint has been split
between the two encoded
Martijn Pieters added the comment:
This is a repeat of old-tracker issue 1700288, see
https://github.com/python/cpython/commit/08ccf202e606a08f4ef85df9a9c0d07e1ba1#diff-998bfefaefe2ab83d5f523e18f158fa4,
which fixed this for StructType_setattro but failed to do the same
Martijn Pieters added the comment:
I'm trying to figure out why Windows won't let us do this. I think the reason
is that sys.std(in|out) filehandles are not opened as pipes, and do not have
the required OVERLAPPED flag set (see the CreateIoCompletionPort documentation
at
https
New submission from Martijn Pieters <m...@python.org>:
float(bytesobject) treats the contents of the bytesobject as a sequence of
ASCII characters, and converts those to a float value as if you used
float(bytesobject.decode('ASCII')). The same support is extended to other
objects implem
New submission from Martijn Pieters <m...@python.org>:
I notice that __trunc__, __floor__ and __ceil__ are supported methods for
MagicMock, but __round__ (in the same grouping of numeric types emulation
methods, see
https://docs.python.org/3/reference/datamodel.html#object.__r
New submission from Martijn Pieters <m...@python.org>:
Can the *Evaluation order* (_evalorder) section in reference/expressions.rst
please be updated to cover this exception in a *call* primary (quoting from the
_calls section):
A consequence of this is that although the ``*expr
Martijn Pieters <m...@python.org> added the comment:
Thanks for the quick fix, sorry I didn't have a PR for this one!
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
Change by Martijn Pieters <m...@python.org>:
--
nosy: +Mariatta, rhettinger
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
New submission from Martijn Pieters <m...@python.org>:
Issue #29381 updated the tutorial to clarify #! use, but the 2.7 patch re-used
Python 3 material that doesn't apply. See r40ba60f6 at
https://github.com/python/cpython/commit/40ba60f6bf2f7192f86da395c71348d0fa24da09
It now
New submission from Martijn Pieters <m...@python.org>:
In Python 2.6, a list comprehension was implemented in the current scope using
a temporary _[1] variable to hold the list object:
>>> import dis
>>> dis.dis(compile('[x for x in y]', '?', 'exec'))
1 0 BU
New submission from Martijn Pieters <m...@python.org>:
When someone accidentally passes in an existing uuid.UUID() instance into
uuid.UUID(), an attribute error is thrown because it is not a hex string:
>>> import uuid
>>> value = uuid.uuid4()
>>> uuid.UUID(v
Changes by Martijn Pieters <m...@python.org>:
--
pull_requests: +3125
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31161>
___
_
Changes by Martijn Pieters <m...@python.org>:
--
pull_requests: +3124
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue31161>
___
_
Martijn Pieters added the comment:
Disregard my last message, I misread Serhiy's sentence (read 'correct' for
'incorrect').
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Martijn Pieters added the comment:
This does not increase clarity. It creates confusion.
There are two distinct syntax errors, and they should be reported separately,
just like `print "abc" 42` is two syntax errors; you'll hear about the second
one once the first on
Martijn Pieters added the comment:
It's confusing; a syntax error reports on the first error found, not two errors
at once. The TabError or IndentationError exception detail message itself is
lost (it should be "IndentationError: Improper mixture of spaces and tabs." or
"Tab
Martijn Pieters added the comment:
Credit for uncovering this gem:
https://stackoverflow.com/questions/45591883/why-is-an-indentionerror-being-raised-here-rather-than-a-syntaxerror
--
___
Python tracker <rep...@bugs.python.org>
New submission from Martijn Pieters:
SyntaxError.__init__() checks for the `print` and `exec` error cases where the
user forgot to use parentheses:
>>> exec 1
File "", line 1
exec 1
^
SyntaxError: Missing parentheses in call to 'exec'
>>> print 1
Martijn Pieters added the comment:
Forgot to addthis: this bug was found via
https://stackoverflow.com/questions/44283540/iter-not-working-with-datetime-now
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
New submission from Martijn Pieters:
I'm not sure where exactly the error lies, but issue 27128 broke iter() for
Argument Clinic class methods. The following works in Python 3.5, but not in
Python 3.6:
from datetime import datetime
from asyncio import Task
next(iter(datetime.now, None))
next
Martijn Pieters added the comment:
Thanks Raymond, for the response. I agree, we can't prevent all possible
misuse, and avoiding the memory issue would require overly costly checks as to
what is being multiplied or added.
--
___
Python tracker <
New submission from Martijn Pieters:
The following expression produces 127MB in constants in `co_consts` due to two
63.5MB integer objects produced when folding:
((200*200 - 2) & ((1 << 5) - 1)) + ((200*200 - 2) >> 5)
The optimizer already does not
Martijn Pieters added the comment:
Apologies, I copied the wrong sleep 10 demo. The correct demo is:
cat >test.sh< #!/bin/sh
> sleep 10
> EOF
time bin/python -c "import subprocess; subprocess.run(['./test.sh'],
stderr=subprocess.PIPE, timeout=3)"
Traceback (most rec
New submission from Martijn Pieters:
You can't time out a process tree that includes a never-ending process, *and*
which redirects stderr:
cat >test.sh< /dev/null # never-ending
EOF
chmod +x test.sh
python -c "import subprocess; subprocess.run(['./test.sh'],
stderr=subprocess.PIPE
Changes by Martijn Pieters <m...@python.org>:
--
pull_requests: +318
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28598>
___
_
Martijn Pieters added the comment:
> Is 2.7 free from this bug?
No, 2.7 is affected too:
>>> class SubclassedStr(str):
... def __rmod__(self, other):
... return 'Success, self.__rmod__({!r}) was called'.format(other)
...
>>> 'lhs %% %r' % SubclassedS
Changes by Martijn Pieters <m...@python.org>:
--
pull_requests: +299
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28598>
___
_
Changes by Martijn Pieters <m...@python.org>:
--
pull_requests: +294
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28598>
___
_
Changes by Martijn Pieters <m...@python.org>:
--
pull_requests: +57
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28598>
___
_
Martijn Pieters added the comment:
I'm not sure if issues are linked automatically yet. I put the patch up as a
pull request on GitHub: https://github.com/python/cpython/pull/51
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.p
Martijn Pieters added the comment:
Follow-up bug, readahead was missed: http://bugs.python.org/issue1633941
--
nosy: +mjpieters
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Martijn Pieters added the comment:
It looks like readahead was missed when http://bugs.python.org/issue12268 was
fixed.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/iss
Martijn Pieters added the comment:
The Python 2.7 issue (using fread without checking for interrupts) looks like a
duplicate of http://bugs.python.org/issue1633941
--
nosy: +mjpieters
___
Python tracker <rep...@bugs.python.org>
Martijn Pieters added the comment:
This bug affects all use of `file.__iter__` and interrupts (EINTR), not just
sys.stdin.
You can reproduce the issue by reading from a (slow) pipe in a terminal window
and resizing that window, for example; the interrupt is not handled and a
future call ends
Martijn Pieters added the comment:
Here's a proposed patch for tip; what versions would it be worth backporting
this to?
(Note, there's no NEWS update in this patch).
--
keywords: +patch
Added file: http://bugs.python.org/file45338/issue28598.patch
New submission from Martijn Pieters:
The `BINARY_MODULO` operator hardcodes a test for `PyUnicode`:
TARGET(BINARY_MODULO) {
PyObject *divisor = POP();
PyObject *dividend = TOP();
PyObject *res = PyUnicode_CheckExact(dividend
New submission from Martijn Pieters:
To reproduce, create an ASCII file with > io.DEFAULT_BUFFER_SIZE bytes (can be
blank lines) and *UNIX line endings*, with the first two lines reading:
#!/usr/bin/env python
# -*- coding: cp1252 -*-
Try to run this as a script on Windows:
Martijn Pieters added the comment:
The catalyst for this question was a Stack Overflow question I answered:
https://stackoverflow.com/questions/37365311/why-are-python-3-6-literal-formatted-strings-so-slow
Compared the `str.format()` the BUILD_LIST is the bottleneck here; dropping
Changes by Martijn Pieters <m...@python.org>:
--
nosy: +mjpieters
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27078>
___
__
New submission from Martijn Pieters:
For anything other than calendar.Calendar(0), many methods lead to
OverflowError exceptions:
>>> import calendar
>>> c = calendar.Calendar(0)
>>> list(c.itermonthdays(1, 1))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
Martijn Pieters added the comment:
> I wonder why they forward references are evaluated *at all* at this point.
The Union type tries to reduce the set of allowed types by removing any
subclasses (so Union[int, bool] becomes Union[int] only). That's all fine, but
it should not at that po
Martijn Pieters added the comment:
A temporary work-around is to use a function to raise a NameError exception
when the module attribute doesn't exist yet:
def _forward_A_reference():
try:
return a.A
except AttributeError:
# not yet..
raise NameError('A')
class
Martijn Pieters added the comment:
Sorry, that should have read "the forward references section of PEP 484".
The section uses this example:
# File models/a.py
from models import b
class A(Model):
def foo(self, b: 'b.B'): ...
# File models/b.py
from models import a
class B(Model
New submission from Martijn Pieters:
Forward references to a module can fail, if the module doesn't yet have the
required object. The "forward references" section names circular dependencies
as one use for forward references, but the following example fails:
$ cat test/__init
Martijn Pieters added the comment:
+1 for "... can only be read". read-only can too easily be construed to mean
that the variable cannot be set from *anywhere*, even the original scope.
Another alternative would be "... is effectively read-only", but "... can
Changes by Martijn Pieters <m...@python.org>:
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
New submission from Martijn Pieters:
>From the 9.2. Python Scopes and Namespace section:
> If a name is declared global, then all references and assignments go directly
> to the middle scope containing the module’s global names. To rebind variables
> found outside of the inn
New submission from Martijn Pieters:
The documentation states that `side_effect` can be set to an
[iterable](https://docs.python.org/3/glossary.html#term-iterable):
If you pass in an iterable, it is used to retrieve an iterator which must
yield a value on every call. This value can either
Martijn Pieters added the comment:
Bugger, that's the last time I take someone's word for it and not test
properly. Indeed, I missed the inheritance of NonCallableMock, so the property
is inherited from there.
Mea Culpa!
--
___
Python tracker rep
Martijn Pieters added the comment:
I don't understand why encoding with `surrogateescape` isn't supported still;
is it the fact that a surrogate would have to produce *single bytes* rather
than double? E.g. b'\x80' - '\udc80' - b'\x80' doesn't work because that
would mean the UTF-16 and UTF
Martijn Pieters added the comment:
I'd be happy to provide a patch for the DictWriter.writerows code; I was
naively counting on it accepting an iterable and that it would not pull the
whole sequence into memory (while feeding it gigabytes of CSV data).
--
nosy: +mjpieters
New submission from Martijn Pieters:
The collections.abc documentation implies that *any* of the container ABCs can
be used in an issubclass test against a class that implements all abstract
methods:
These ABCs allow us to ask classes or instances if they provide particular
functionality
Martijn Pieters added the comment:
I should have added the mixin methods for the Sequence implementation; the more
complete demonstration is:
from collections.abc import Sequence, Container, Sized
class MySequence(object):
... def __contains__(self, item): pass
... def __len__(self
New submission from Martijn Pieters:
The documentation for zipfile.ZipFile.extract() doesn't mention at all that it
returns the local path created, either for the directory that the member
represents, or the new file created from the zipped data.
*Returns the full local path created
Martijn Pieters added the comment:
I like the unicode.__getitem__(s, slice(None)) approach, it has the advantage
of not having to rely on len(s).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23583
Martijn Pieters added the comment:
This changes causes printing BeautifulSoup NavigableString objects to fail; the
code actually could never work as `unicode.__getslice__` insists on getting
passed in integers, not None.
To reproduce, create a new file in IDLE and paste in:
from bs4 import
Martijn Pieters added the comment:
Created a new issue: http://bugs.python.org/issue23583
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19481
New submission from Martijn Pieters:
This is a regression or recurrence of issue #19481.
To reproduce, create a subclass of unicode and try and print an instance of
that class:
class Foo(unicode): pass
print Foo()
results in a traceback:
Traceback (most recent call last):
File pyshell#4
Changes by Martijn Pieters m...@python.org:
--
components: +IDLE
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23583
___
___
Python-bugs-list
Martijn Pieters added the comment:
Proposed fix, replace line 1352-1353 in PseudoOutputFile.write():
if isinstance(s, unicode):
s = unicode.__getslice__(s, None, None)
with
if isinstance(s, unicode):
s = unicode.__getslice__(s, 0, len(s
hey
for a schoolproject we had to build a robot and control this robot with a gui
to follow a pathWe use multiprocessingand in our group 2 people can run the
codebut if i run the code, i got a pickle errorI have a windows 7 and use
python 2.7 just like the othersWe asked our prof, but he
Martijn Pieters added the comment:
Indeed, the 2.7 backport was not correctly applied for _elementtree.c, leaving
files open because the close_source flag is set to False *again* when opening a
filename.
Should a new issue be opened or should this ticket be re-opened?
--
nosy
Martijn Pieters added the comment:
I notice that the same issue still exists in the 3.5 documentation. Surely this
can at least be fixed in the development copy?
--
nosy: +mjpieters
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Martijn Pieters added the comment:
Ah! Mea Culpa, you are correct. The issue is then with Python 2.7 only for
which no doubt exists a separate ticket.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17876
New submission from Martijn Pieters:
urllib.request.urlopen() now always produces a context manager (either a
HTTPResponse or addinfourl object). The example for contextlib.closing still
uses urllib.request.urlopen as an example for the context manager wrapper, see
https://docs.python.org
Martijn Pieters added the comment:
I'd say this is a bug in the library, not the documentation. The library varies
the output type, making it impossible to use `json.dump()` with a `io.open()`
object as the library will *mix data type* when writing. That is *terrible*
behaviour
New submission from Martijn Pieters:
The Python 2 version of the bytearray() documentation appears to be copied
directly from its Python 3 counterpart and states that when passing in a string
an encoding is required:
* If it is a string, you must also give the encoding (and optionally, errors
Martijn Pieters added the comment:
Fixed by revision 3ae399c6ecf6
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22288
Martijn Pieters added the comment:
The documentation change in this patch introduced a bug in the Call grammar:
| * `expression` [, * `expression`] [, ** `expression`]
instead of
| * `expression` [, `keyword_arguments`] [, ** `expression`]
giving the impression that `*expression` is allowed
New submission from Martijn Pieters:
The changes for issue #3473 introduced a documentation bug. The Call expression
grammar implies that f(*[1, 2], *[3, 4]) is allowed:
| * `expression` [, * `expression`] [, ** `expression`]
I think Benjamin meant to use:
| * `expression
1 - 100 of 214 matches
Mail list logo