Martin Panter added the comment:
It looks like ctypes uses ffi_closure_alloc() to allocate an executable
function on demand. So it should be possible for readline to also call libffi
and do this, but certainly not trivial.
>>> from ctypes import *
>>> @CFUNCTYPE(c_int, c_i
Martin Panter added the comment:
The patch (with Berker’s fix) looks okay. Personally, I don’t see a big problem
with the first argument also having a keyword name, but I don’t mind if it
doesn’t either.
--
___
Python tracker
<h
Martin Panter added the comment:
The t vs x mixup was introduced by my sloppy backport in Issue 16701. The other
problem here is x is generally defined as any arbitrary object, but redefined
as an iterable in the footnote. I think we should use t instead, as in the
other two slice assignment
Martin Panter added the comment:
According to strace, Python 3 is calling send(-1, ...):
sendto(-1, "x", 1, 0, NULL, 0) = -1 EBADF (Bad file descriptor)
A related discrepancy between Python 2 and 3 is how the socket.makefile()
objects affect the original socket. In Python
Martin Panter added the comment:
Maybe if the patch was regenerated with Mercurial off a public revision, it
would work with Rietveld. I have seen non-Mercurial patches work too though.
Perhaps this one doesn’t because the line numbers are off compared to the
default branch?
See also Issue
Martin Panter added the comment:
See also Issue 26896. Apparently some of the terms you are linking are used
wrongly.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue20
New submission from Martin Panter:
In the documentation for Python 2 and 3, socket.SocketType is defined as:
This is a Python type object that represents the socket object type. It is the
same as “type(socket(...))”.
In Python 2 it is a standalone “socket._socketobject” class, which holds a
Martin Panter added the comment:
FWIW I had a quick look at ways to detect if you are running on Ubuntu. But
platform.linux_distribution() seems to be deprecated and looks like it might
have trouble differentiating Debian and Ubuntu. So it may be easier to just go
with the current patch on
Martin Panter added the comment:
SO_PASSCRED was added to Python 3.3 as part of Issue 6560; it is just missing
documentation.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue26
Martin Panter added the comment:
Okay, I guess the fdtype() API could be useful if we don’t alter fromfd(), i.e.
as a workaround for Issue 18391.
IMO the specific SO_* constants should at least be listed in the documentation,
so users know which versions of Python have which constants
Martin Panter added the comment:
I see that “compat32” and “default” are actually different things (Compat32 vs
EmailPolicy classes). IMO “default” was a bad choice of name, but I guess that
ship has already sailed.
This patch adds a test_defect_handling.TestCompat32 subclass, so the test
Martin Panter added the comment:
Oren: If you have extra changes to make on the same topic, it is probably best
to make a new patch that combines both the original changes plus the new
changes.
Brett: Since you were responsible for the two dead assignments, your input
would be helpful
Martin Panter added the comment:
I’m not sure what the best solution is. I am just pointing out the problem. It
seems an “importer” as mentioned in PEP 302 is more general than the current
glossary definition. E.g. ImpImporter() returns an object that has a
find_module() method (which
Martin Panter added the comment:
Have a look at Issue 2786. I think it might be the same thing.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue27
Martin Panter added the comment:
Hello Emanual, I think I have fixed your problem with -Werror, by handling the
exception returned by PyErr_WarnFormat() (see my patch). Thanks for separating
the actual change from the escape violation fixes; it made it easier to spot
the real problem :)
Also
Martin Panter added the comment:
Hah, we posted the same fix almost at the same time :)
--
___
Python tracker
<http://bugs.python.org/issue27364>
___
___
Pytho
Martin Panter added the comment:
Code samples in the documentation should also be fixed, like at
<https://docs.python.org/3.6/library/re.html#re.split>. I think you can run
“make -C Doc doctest” or something similar, which may help find some of these.
Also, playing with your current pat
Martin Panter added the comment:
This was not fixed properly. The first symptom is that recv(0) etc still blocks
if the other end sends no data. The second symptom is that it does not work
with suppress_ragged_eofs=False. The problem is SSL is still called to do a
read, which returns zero
Martin Panter added the comment:
FWIW adding a blank fourth argument in configure.ac silences this warning (and
speeds up the configure run by 7%, or 4 s). But I don’t want to become an
Autoconf nerd and I don’t know if this change could have negative consequences
on other platforms (e.g
Martin Panter added the comment:
Forgot to say I reviewed invalid_stdlib_escapes_1.patch the other day and can’t
see any problems.
--
___
Python tracker
<http://bugs.python.org/issue27
Martin Panter added the comment:
Regarding the files getting messed up in Lib/test/cjkencodings, IMO the
solution is to not configure Git to mess with newlines in files. ;) But perhaps
a reasonable workaround might be to rename the relevant files to something like
*.txt.bin. Perhaps that will
Martin Panter added the comment:
test_distutils: Is the failure the same as before, or changed? Are you testing
with new code that includes the Issue 27048 fix? It looks like test_distutils
doesn’t support running directly via “unittest”. Perhaps try “python -m test -W
test_distutils” or
Martin Panter added the comment:
The s.detach() thing isn’t a big deal, but I thought it would simplify the code
(eliminate the need for the “finally” clause).
I will try to propose a minor documentation update for SO_PASSCRED as a
starting point for adding the others
Changes by Martin Panter :
--
versions: +Python 3.4 -Python 3.5
___
Python tracker
<http://bugs.python.org/issue19802>
___
___
Python-bugs-list mailing list
Unsub
Martin Panter added the comment:
Reopening because the consensus seems to be to update and apply this sort of
change.
--
nosy: +martin.panter
stage: -> needs patch
status: closed -> open
___
Python tracker
<http://bugs.python.org/iss
New submission from Martin Panter:
The documentation just says that SO_* etc constants are defined. However when
people add new ones, they add them as new features to a specific version (not
backported as bug fixes), but do not alter the documentation at all. IMO it is
silly adding
Martin Panter added the comment:
I traced this back to revision 73afda5a4e4c (Issue 17911), which includes this
change to traceback._format_final_exc_line():
-if value is None or not valuestr:
+if value == 'None' or value is None or not valuestr:
--
components: +Library (Lib
Martin Panter added the comment:
Robert: in issue17911-2.patch (and the eventual commit) you added a check for
value == 'None' in _format_final_exc_line(). Why was this necessary? I think it
is the cause of my Issue 27348 regression:
>>> traceback.format_exception(Except
Martin Panter added the comment:
If I remove the value == 'None' check, there are two failures in the test suite:
1. test_decimal fails, but only because the test was changed in revision
5f3dd0a2b1ab to accommodate the very bug I am complaining about. IMO this was a
case of “fixing
Martin Panter added the comment:
Yeah sure I can give you a chance to consider this (I assume you meant “chance”
:). But neither of the tests I mentioned were added by you as far as I know.
Maybe you are thinking of some other test.
--
___
Python
Martin Panter added the comment:
Committed for 3.6.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Martin Panter added the comment:
Revision 4fc0154ec84a links here, but actually seems to be discussed in Issue
26348 and Issue 26664 instead.
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue26
Martin Panter added the comment:
If it were me, I might try to use a version of Git that doesn’t mess with the
files. But if this becomes a common problem (esp with the move from Mercurial
to Git), maybe we can add a “.gitattributes” file
<https://git-scm.com/docs/gitattributes>. We
Martin Panter added the comment:
The patch looks correct to me.
Issue 1621 is open about the general problem of overflows.
--
nosy: +martin.panter
stage: needs patch -> commit review
versions: +Python 2.7, Python 3.5
___
Python tracker
&l
Changes by Martin Panter :
--
dependencies: +bytes_concat seems to check overflow using undefined behaviour
___
Python tracker
<http://bugs.python.org/issue1
Martin Panter added the comment:
I changed the versions without checking first. Long story short:
Objects/stringobject.c (Python 2 equivalent of Objects/bytesobject.c) is
already fixed, but in all versions, Objects/bytearrayobject.c is apparently
unfixed.
Python 2 was fixed as part of r65335
Martin Panter added the comment:
Jonathon: Do you have a use case for __rmod__(), or did you find this bug by
code analysis?
UserString.__rmod__() was added as part of Issue 22189. The main reason seems
to be so that UserString has all the methods listed by dir(str). The result was
that
Martin Panter added the comment:
Buildbot has errors and warnings:
http://buildbot.python.org/all/builders/Docs%203.x/builds/1729/steps/suspicious/logs/stdio
make -C Doc/ suspicious
. . .
writing output... [ 83%] library/venv
WARNING: [library/venv:353] ":param" found in "
Changes by Martin Panter :
--
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue10697>
___
___
Python-bugs-list mailing list
Unsubscrib
Martin Panter added the comment:
I agree, SplitResult._replace() would probably have been very useful to me in
the past if it were available (and guaranteed by the documentation).
The namedtuple implementation was added in revision 79579fa8d752 (in 2.6 and
3.0), with a comment mentioning
Martin Panter added the comment:
Left some minor code review nitpicks.
I opened Issue 27409 with an attempt at documenting exactly which SO_* etc
symbols may be available. But so far I haven’t got any positive or negative
feedback. If it were up to me, I would either commit everything except
Martin Panter added the comment:
Victor: Gnu Make has a special “.DELETE_ON_ERROR” target that will cause
Objects/typeslots.inc to be removed if the “python” command fails, which is
slightly better than truncating it. See delete-on-error.patch. It looks like
you were not using Gnu Make, but
Changes by Martin Panter :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue23804>
___
___
Pyth
Martin Panter added the comment:
Survey of different mechanisms for running Python to generate files:
Tools/scripts/generate_opcode_h.py and Parser/asdl_c.py: configure.ac tries
python3.6, python3, python, etc commands. It either runs the scripts with what
it finds, or substitutes an “echo
Martin Panter added the comment:
Oops, that last merge is not related to this
--
___
Python tracker
<http://bugs.python.org/issue23804>
___
___
Python-bugs-list m
Changes by Martin Panter :
--
versions: +Python 2.7
___
Python tracker
<http://bugs.python.org/issue25523>
___
___
Python-bugs-list mailing list
Unsubscribe:
Martin Panter added the comment:
Previous discussion: Issue 1722, Issue 11009.
In Python 2, most of the split- functions _have_ been in urllib.__all__ since
revision 5d68afc5227c (2.1). Also, since revision c3656dca65e7 (Issue 1722,
2.7.4), the RST documentation does mention that at least
Changes by Martin Panter :
--
Removed message: http://bugs.python.org/msg265966
___
Python tracker
<http://bugs.python.org/issue16858>
___
___
Python-bugs-list m
Martin Panter added the comment:
In trying to understand this, I built a package with two simple files:
$ cat package/*.py
# package/__init__.py:
from . import module
# package/module.py:
import sys
sys.modules[__name__] = object()
With this I can reproduce your __spec__ error, and I see it
Martin Panter added the comment:
Since 2.7.12 and 3.5.2, pgen should not be executed when in cross-compilation
mode, thanks to Issue 22359 and Issue 22625. So I suspect the main problem is
basically solved now.
Even though it should no longer be used, pgen is still cross-compiled depending
Martin Panter added the comment:
The same $(GRAMMAR_H) dependency and touch command still exists today, so I
suspect this is still valid (though I didn’t try to reproduce it). I think we
need to figure out if you can write a proper makefile rule that handles a
single command that updates two
Martin Panter added the comment:
I don’t know the details of how Python uses CFLAGS etc, but according to
<https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html#index-CFLAGS>
and
<https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#index-
Martin Panter added the comment:
Why do you set CFLAGS=-m32? When I cross-compile a 32-bit Python on a 64-bit
host, I set CC="gcc -m32" instead. (Otherwise, I would have to specify
LDFLAGS="-m32" as well.)
--
components: +Build
Martin Panter added the comment:
In the original report you mentioned a linker error caused by not using “-m64”
from CFLAGS. Perhaps would it make more sense to add LDFLAGS=“-m64”, or use
CC=“cc -m64” instead? There is also Issue 27490 and Issue 22981, both
apparently about setting the ABI
Martin Panter added the comment:
Instead of allowing delete=None (which is not in the RST documentation),
perhaps it is possible to change the doc string. I can’t remember the details,
but I think Argument Clinic allows a virtual Python-level default, something
like “object(py_default=b
Martin Panter added the comment:
It is possible to make an infinite iterable, e.g. iter(int, 1), so it is
definitely worth checking for overflow. The patch looks okay to me. An
alternative would be to raise the error without trying to allocate
Py_SSIZE_T_MAX first, but I am okay with either
Martin Panter added the comment:
If you enable GCC’s -ftrapv option, the subtraction overflow triggers an abort.
Alexander’s patch works around the problem for asctime(), but the problem still
exists in other cases, such as:
>>> time.mktime((-2**31 + 1899, *(0,) * 8))
Aborted (co
Martin Panter added the comment:
I can try to add the RuntimeWarning soon. Obviously we want the warning when
executing a submodule like “package.module”. It also seems reasonable to warn
when executing a top-level module that has already been imported. I presume we
want these to go into the
Martin Panter added the comment:
This is on my list of things to look at, just that I have been away and am a
bit backlogged atm.
--
___
Python tracker
<http://bugs.python.org/issue27
Martin Panter added the comment:
Inspired by Issue 27473, I did a quick and dirty scan for obvious places that
expect overflow to wrap, and found the following, which I think should be fixed:
Modules/_ctypes/_ctypes.c:1388, in PyCArrayType_new()
Objects/listobject.c:492, in list_concat
Martin Panter added the comment:
I added Issue 13312 as a dependency, there is currently a test for a negative
year that relies on overflow handling.
Here is a patch where I tried to fix overflow detection for huge set objects.
--
Added file: http://bugs.python.org/file43729/set
Martin Panter added the comment:
This appears to have broken the tests on Windows:
http://buildbot.python.org/all/builders/x86%20Windows7%203.5/builds/1030/steps/test/logs/stdio
==
FAIL: test_insensitive
New submission from Martin Panter:
I assumed that the “message” parameter could be used to match any substring of
a warning message, but it turns out it calls regex.match(), which is anchored
at the beginning of the search string (but is not anchored at the end). I
propose this patch to
Martin Panter added the comment:
Here is a patch with the proposed warning. I think “Error finding module
specification” might be a bit better than the current “finding spec”, so I
included that change. With the patch, this is what the messages look like:
$ ./python -m package.module
/media
Martin Panter added the comment:
I still think the links are too dense. Three links to the same term in two
short paragraphs is too much. Do you think it would be okay to just link the
first occurrence for pkgutil.ImpImporter?
Also, there is still a problem at least the definition of “finder
Changes by Martin Panter :
--
Removed message: http://bugs.python.org/msg270561
___
Python tracker
<http://bugs.python.org/issue27130>
___
___
Python-bugs-list m
Martin Panter added the comment:
I added one comment, but I think this might almost be ready
--
___
Python tracker
<http://bugs.python.org/issue27130>
___
___
Martin Panter added the comment:
I tried the newer -fsanitize=undefined mode, and it is better than -ftrapv. It
adds instrumentation that by default nicely reports the errors and continues
running.
My problem with the large slice step is not restricted to Element Tree; it
affects list
Martin Panter added the comment:
Not particularly related, but the special fast case in
Objects/listobject.c:811, listextend(), also seems to lack an overflow check.
“An alternative would be to raise the error without trying to allocate
Py_SSIZE_T_MAX first”: what I meant was removing the
Martin Panter added the comment:
Yeah I see your point. Anyway I think the current patch is fine.
--
___
Python tracker
<http://bugs.python.org/issue27
Martin Panter added the comment:
The PYTHON_FOR_GEN scheme seems reasonable to me, as is changing the way
typeslots script is run.
I do wonder about the advice in the message. If I ran into the problem, I would
probably either override PYTHON_FOR_GEN when running Make, or try something
like
Martin Panter added the comment:
The Windows problem, error 10022 = WSAEINVAL from getsockname(), seems to be
documented at
<https://msdn.microsoft.com/en-us/library/windows/desktop/ms738543%28v=vs.85%29.aspx>:
“The socket has not been bound”.
Regarding the SCTP problem, raising an
Changes by Martin Panter :
--
resolution: -> out of date
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue19142>
___
___
Python-bugs-
Martin Panter added the comment:
I am happy to repurpose this bug to improve how code generators like pgen work
if you want. Or open a separate report if you think that is best.
My problem with the proposal involving PGEN_DEPS0 is that it relies on makefile
syntax intended for changing
Martin Panter added the comment:
If this is still a problem, you should narrow down what is causing the
slowdown. If you interrupt it, what is the stack trace?
My best guess is perhaps there is a bypass hostname setting and a slow or
failing DNS lookup. A call to urllib.proxy_bypass() was
Martin Panter added the comment:
Here is an updated patch. Since the message no longer applies to top-level
modules, I went back to a version closer to Wolfgang’s suggestion, which should
eliminate the problem with “any parent packages”.
Now the messages look like this:
/media/disk/home/proj
Martin Panter added the comment:
bytearray(n) needs to allocate n bytes. Unless your computer has 1024 GiB of
memory, this is not going to be possible. If you are using an OS like Linux, it
may pretend to allocate that much memory, and then kill the process when it
realizes it has
Martin Panter added the comment:
There is a good chance crashes and related 2 GiB and 4 GiB limits in zlib will
be solved by Issue 27130. Do you want to see if the patch improves the
situation? (I cannot test it directly because I don’t have enough memory.)
--
nosy: +martin.panter
Martin Panter added the comment:
Committed without any macro for the time being
--
resolution: not a bug -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Martin Panter added the comment:
Perhaps this is the same as Issue 5614, i.e. the problem lies with OS X rather
than Python?
--
nosy: +martin.panter
___
Python tracker
<http://bugs.python.org/issue27
Martin Panter added the comment:
Yes you are probably right Antti. The input to compress would need 31 TB of
memory, and is a text string, while Python 3’s zlib.compress() requires bytes.
In other words, this will be the same problem of overallocating memory as Issue
27559.
Pablo: I suggest
Martin Panter added the comment:
Some responses to the issues raised by Terry would be helpful, especially the
incompatibility by adding the RuntimeError. It looks like it forces a race on
the normal usage of shutdown(). See also Issue 12463: it seems different people
have different ideas
Martin Panter added the comment:
I suspect this won’t help on OSes like Windows where environment variable names
are case-insensitive (correct me if I am wrong).
Regardless, it may be worth making the change. It would be nice to also add
test case(s). And I wonder if it would be appropriate
New submission from Martin Panter:
This patch fixes errors reported by GCC’s undefined behaviour sanitizer about
calling functions with a null pointer:
./configure CC="gcc -fsanitize=undefined"
Using Issue 22605 as a precedent, I propose to avoid calling memcpy() and
memmove(
Changes by Martin Panter :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Martin Panter added the comment:
I committed the fix for negation in audioop.
slice-step.patch includes a better fix for the remaining part of trapv.patch,
with Element Tree slicing. I think this fix is much less intrusive, and I have
copied it to other places that handle slicing, and added
Martin Panter added the comment:
Here is a possible patch for 2.7. To fix everything on 2.7 I changed the module
to accept input buffers over 2 GiB by enabling PY_SSIZE_T_CLEAN. As a
consequence, the patch also includes ports of Nadeem Vawda’s adler32(), crc32()
changes from Issue 10276, and
Martin Panter added the comment:
Serhiy: slice-step.patch seems to be fine with negative slice steps. The actual
indexes are still positive, and “unsigned” arithmetic is really modular
arithmetic, so when you add the negative “unsigned” step value, it decrements
the index properly.
Antti: if
Martin Panter added the comment:
Serhiy’s patch does fix about half the errors (1 whole screenful reduces to a
bit over 1/2 a screenful). I do find it a bit ugly though (four casts in the
one term of a macro!).
--
___
Python tracker
<h
Martin Panter added the comment:
Mathieu: Maybe you haven’t seen some of the comments on your older patches.
E.g. my comment on fromisoformat4.patch about improper use of “with
self.assertRaises(...)” still stands.
Also, adding some documentation to the patch might help the likes of Anders
Martin Panter added the comment:
I think I misunderstood the Windows situation. Now I understand Windows has no
lower-case variable names, so this patch would stop accepting any HTTP_PROXY
variable there (in CGI mode). But that is okay by me.
I agree the mixed-case scenario is not worth
Martin Panter added the comment:
The new patch looks good enough.
The main reason I complained about the error message is that it sounds like you
need Python in order to build Python. Obviously you need Python to run a
modified file like typeslots.py, but there is supposed to be an
Martin Panter added the comment:
I think that error message would be okay.
--
___
Python tracker
<http://bugs.python.org/issue26662>
___
___
Python-bugs-list m
Martin Panter added the comment:
Sorry nobody acted on your patch earlier. This is the same as Issue 26662,
which has a more general patch that does the same sort of thing.
--
nosy: +martin.panter
resolution: -> duplicate
status: open ->
Martin Panter added the comment:
Here is a new patch for 2.7 that should avoid the problem with
ChecksumBigBufferTestCase. I tested a hacked version of the test, so I am more
confident in it now :)
--
Added file:
http://bugs.python.org/file43823/64bit_support_for_zlib_v11-2.7.patch
Martin Panter added the comment:
I am torn on this. On one hand, it would be good to be consistent with the
single-argument behaviour. But on the other hand, APIs normally accept
arbitrary bytes-like objects (like memoryview) to minimise unnecessary copying,
whereas this case has to make a
Martin Panter added the comment:
Thanks for the report. You seem to have identified some code from Open SSL as
being from Python (e.g. ASN1_PRINTABLE_type() function in a_print.c).
Here’s a quick copy of the details relevant to Python:
V547 Expression 's->sock_fd < 0'
Martin Panter added the comment:
This patch looks okay to me. I will commit it in a few days, unless anyone
comes up with a better option.
--
stage: -> patch review
versions: +Python 3.5
___
Python tracker
<http://bugs.python.org/issu
Martin Panter added the comment:
Christian Heimes posted a patch for _PyState_AddModule() on Python-dev:
https://marc.info/?l=python-dev&m=146922730716425&w=2
--
___
Python tracker
<http://bugs.python.org
Martin Panter added the comment:
Also on python-dev, Chris Angelico pointed out that the _elementtree.c case is
a false positive. So that would leave the binascii one, which I think is worth
simpifying, but is probably not very serious
1201 - 1300 of 4320 matches
Mail list logo