Martijn Pieters <[EMAIL PROTECTED]> added the comment:
I've created a python 2.4 compatible distribution of the python 2.5
urllib2 and httplib modules with the patch attached to this issue. This
has proven especially useful in zc.buildout or other setuptools
environmen
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 a
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
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 :
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:
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
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
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:
> 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
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_p
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 cl
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'],
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
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:
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
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
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, the
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'
>>>
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
<http://bugs.python.org/issue31
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
&quo
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 fir
Martijn Pieters added the comment:
Disregard my last message, I misread Serhiy's sentence (read 'correct' for
'incorrect').
--
___
Python tracker
<http:
Changes by Martijn Pieters :
--
pull_requests: +3124
___
Python tracker
<http://bugs.python.org/issue31161>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martijn Pieters :
--
pull_requests: +3125
___
Python tracker
<http://bugs.python.org/issue31161>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 for
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
Change by Martijn Pieters :
--
components: +email
nosy: +barry, r.david.murray
type: -> behavior
versions: +Python 3.7
___
Python tracker
<https://bugs.python.org/issu
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
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:
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
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 or
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 < (__
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
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
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:
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=
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
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:
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 tr
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))
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
<http://bugs.python.org/issue30
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 :
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() and
Change by Martijn Pieters :
--
keywords: +patch
pull_requests: +12167
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36188>
___
_
Change by Martijn Pieters :
--
pull_requests: -12166
___
Python tracker
<https://bugs.python.org/issue12169>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Martijn Pieters :
--
pull_requests: +12168
___
Python tracker
<https://bugs.python.org/issue12169>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Martijn Pieters :
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
New submission from Martijn Pieters :
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 reads:
"By defau
Change by Martijn Pieters :
--
nosy: +Mariatta, rhettinger
___
Python tracker
<https://bugs.python.org/issue32963>
___
___
Python-bugs-list mailing list
Unsub
Martijn Pieters added the comment:
Thanks for the quick fix, sorry I didn't have a PR for this one!
--
___
Python tracker
<https://bugs.python.org/is
New submission from Martijn Pieters :
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 ``*expression`` syntax may appear
New submission from Martijn Pieters :
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.__round__), is not.
Please add this
New submission from Martijn Pieters :
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(value)
Traceback (mos
New submission from Martijn Pieters :
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 implementing
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
Martijn Pieters added the comment:
Why is the `formatter` module still part of Python 3? This was a dependency for
the `htmllib` module in Python 2 only, and that module was deprecated and
removed from Python 3.
--
nosy: +mjpieters
___
Python
Martijn Pieters added the comment:
> The formatter module was deprecated? When?
It wasn't, that's the point I am raising. The `formatter` module was
exclusively used by the `htmllib` module, I am surprised the `formatter` module
wasn't part o
Martijn Pieters added the comment:
I note that the documentation still states a dictionary is required for
globals. Should that not be updated as well?
See http://docs.python.org/py3k/library/functions.html#exec
--
nosy: +mjpieters
___
Python
Martijn Pieters added the comment:
Apologies, I meant to link to the dev docs:
http://docs.python.org/dev/library/functions.html#exec
--
___
Python tracker
<http://bugs.python.org/issue14
Martijn Pieters added the comment:
Note that the Python 3 docs also need updating, but need a more extensive patch:
https://docs.python.org/3/library/urllib.parse.html#structured-parse-results
--
nosy: +mjpieters
___
Python tracker
<h
New submission from Martijn Pieters:
Run `python3.3 -h` and the `-u` option is documented as:
> -u : unbuffered binary stdout and stderr; also PYTHONUNBUFFERED=x
> see man page for details on internal buffering relating to '-u'
Note that only `stdout`
Martijn Pieters added the comment:
Note: there is a comment explaining the point of _RouteClassAttributeToGetattr
right above the Enum.name and Enum.value methods you changed (now at line 474).
You may want to update that comment now.
--
nosy: +mjpieters
Martijn Pieters added the comment:
The *redirect* should be corrected here too!
http://www.python.org/peps/pep-0263.html is still going to be in use for some
time to come, a simple redirect *on Python.org* to the correct location would
be helpful.
--
nosy: +mjpieters
Martijn Pieters added the comment:
Yeah, I should have thought of that in the first place. Done, and thanks, Ned!
--
___
Python tracker
<http://bugs.python.org/issue21
Martijn Pieters added the comment:
The documentation change in this patch introduced a bug in the Call grammar:
| "*" `expression` ["," "*" `expression`] ["," "**" `expression`]
instead of
| "*" `expression` ["," `k
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`]
Martijn Pieters added the comment:
Proposed fix added in my fork.
--
hgrepos: +270
___
Python tracker
<http://bugs.python.org/issue22288>
___
___
Python-bug
Changes by Martijn Pieters :
--
keywords: +patch
Added file: http://bugs.python.org/file36487/ffe77dc2979a.diff
___
Python tracker
<http://bugs.python.org/issue22
Changes by Martijn Pieters :
Removed file: http://bugs.python.org/file36487/ffe77dc2979a.diff
___
Python tracker
<http://bugs.python.org/issue22288>
___
___
Python-bug
Martijn Pieters added the comment:
Sigh, patch creation fails against a remove repository; I guess this only works
for the default branch.
Attached as a patch file instead.
--
Added file: http://bugs.python.org/file36488/issue22288.patch
___
Python
Changes by Martijn Pieters :
--
hgrepos: -270
___
Python tracker
<http://bugs.python.org/issue22288>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martijn Pieters added the comment:
Fixed by revision 3ae399c6ecf6
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
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:
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
<http://bugs.python.org/is
Changes by Martijn Pieters :
--
pull_requests: +57
___
Python tracker
<http://bugs.python.org/issue28598>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martijn Pieters :
--
pull_requests: +294
___
Python tracker
<http://bugs.python.org/issue28598>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Martijn Pieters :
--
pull_requests: +299
___
Python tracker
<http://bugs.python.org/issue28598>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
Changes by Martijn Pieters :
--
pull_requests: +318
___
Python tracker
<http://bugs.python.org/issue28598>
___
___
Python-bugs-list mailing list
Unsubscribe:
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:
New submission from Martijn Pieters:
Rev 83684 (http://hg.python.org/cpython/rev/5885c02120f0) managed to move the
`attrgetter()` `versionadded` and `versionchanged` notes down to the
`itemgetter()` documentation instead, by moving the `itemgetter()` signature
*up* above these lines.
Now the
Martijn Pieters added the comment:
The 2.7 patch shifted the `itemgetter()` signature to above the `attrgetter()`
change and new notes.
New patch to fix that in issue #17949: http://bugs.python.org/issue17949
--
nosy: +mjpieters
___
Python tracker
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*
beha
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 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
<http://bugs.python.org/issue17
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
<http://bugs.python.org/issue17
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 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'
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
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!
--
___
Pyth
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 innermos
Changes by Martijn Pieters :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
___
Python tracker
<http://bugs.python.org/issu
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
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/__in
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
cla
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('
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 th
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,
Changes by Martijn Pieters :
--
nosy: +mjpieters
___
Python tracker
<http://bugs.python.org/issue27078>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 the
1 - 100 of 116 matches
Mail list logo