[issue22228] Adapt bash readline operate-and-get-next function

2016-06-22 Thread Martin Panter
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

[issue26243] zlib.compress level as keyword argument

2016-06-22 Thread Martin Panter
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

[issue27370] Inconsistency in docs for list.extend

2016-06-22 Thread Martin Panter
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

[issue13344] closed sockets don't raise EBADF anymore

2016-06-23 Thread Martin Panter
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

[issue27377] Add smarter socket.fromfd()

2016-06-23 Thread Martin Panter
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

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-23 Thread Martin Panter
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

[issue27379] SocketType changed in Python 3

2016-06-23 Thread Martin Panter
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

[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-24 Thread Martin Panter
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

[issue26907] Add missing getsockopt constants

2016-06-24 Thread Martin Panter
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

[issue27377] Add smarter socket.fromfd()

2016-06-24 Thread Martin Panter
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

[issue24364] Not all defects pass through email policy

2016-06-25 Thread Martin Panter
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

[issue26896] mix-up with the terms 'importer', 'finder', 'loader' in the import system and related code

2016-06-25 Thread Martin Panter
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

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-25 Thread Martin Panter
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

[issue27389] When a TypeError is raised due to invalid arguments to a method, it should use __qualname__ to identify the class the method is in

2016-06-26 Thread Martin Panter
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

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Martin Panter
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

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Martin Panter
Martin Panter added the comment: Hah, we posted the same fix almost at the same time :) -- ___ Python tracker <http://bugs.python.org/issue27364> ___ ___ Pytho

[issue27364] Deprecate invalid unicode escape sequences

2016-06-26 Thread Martin Panter
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

[issue23804] SSLSocket.recv(0) receives up to 1024 bytes

2016-06-26 Thread Martin Panter
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

[issue27398] configure warning for Python 3.5.2 during compilation

2016-06-27 Thread Martin Panter
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

[issue27364] Deprecate invalid unicode escape sequences

2016-06-27 Thread Martin Panter
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

[issue26226] Various test suite failures on Windows

2016-06-28 Thread Martin Panter
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

[issue26226] Various test suite failures on Windows

2016-06-28 Thread Martin Panter
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

[issue27377] Add smarter socket.fromfd()

2016-06-28 Thread Martin Panter
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

[issue19802] socket.SO_PRIORITY is missing

2016-06-28 Thread Martin Panter
Changes by Martin Panter : -- versions: +Python 3.4 -Python 3.5 ___ Python tracker <http://bugs.python.org/issue19802> ___ ___ Python-bugs-list mailing list Unsub

[issue1732367] Document the constants in the socket module

2016-06-28 Thread Martin Panter
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

[issue27409] List socket.SO_*, SCM_*, MSG_*, IPPROTO_* symbols

2016-06-28 Thread Martin Panter
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

[issue27348] traceback (and threading) drops exception message

2016-06-28 Thread Martin Panter
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

[issue17911] traceback: add a new thin class storing a traceback without storing local variables

2016-06-28 Thread Martin Panter
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

[issue27348] traceback (and threading) drops exception message

2016-06-29 Thread Martin Panter
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

[issue27348] traceback (and threading) drops exception message

2016-06-29 Thread Martin Panter
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

[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-06-29 Thread Martin Panter
Martin Panter added the comment: Committed for 3.6. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue26665] pip is not bootstrapped by default on 2.7

2016-06-30 Thread Martin Panter
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

[issue27425] Tests fail because of git's newline preferences on Windows

2016-06-30 Thread Martin Panter
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

[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-10 Thread Martin Panter
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

[issue1621] Do not assume signed integer overflow behavior

2016-07-10 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +bytes_concat seems to check overflow using undefined behaviour ___ Python tracker <http://bugs.python.org/issue1

[issue27473] bytes_concat seems to check overflow using undefined behaviour

2016-07-10 Thread Martin Panter
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

[issue25652] collections.UserString.__rmod__() raises NameError

2016-07-10 Thread Martin Panter
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

[issue27285] Document the deprecation of pyvenv in favor of `python3 -m venv`

2016-07-10 Thread Martin Panter
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 "

[issue10697] host and port attributes not documented well in function urllib.parse.urlparse and urlsplit

2016-07-10 Thread Martin Panter
Changes by Martin Panter : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue10697> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue27464] Document that SplitResult & friends are namedtuples

2016-07-10 Thread Martin Panter
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

[issue27377] Add smarter socket.fromfd()

2016-07-10 Thread Martin Panter
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

[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-10 Thread Martin Panter
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

[issue23804] SSLSocket.recv(0) receives up to 1024 bytes

2016-07-10 Thread Martin Panter
Changes by Martin Panter : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue23804> ___ ___ Pyth

[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-11 Thread Martin Panter
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

[issue23804] SSLSocket.recv(0) receives up to 1024 bytes

2016-07-11 Thread Martin Panter
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

[issue25523] Correct "a" article to "an" article

2016-07-11 Thread Martin Panter
Changes by Martin Panter : -- versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue25523> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27485] urllib.splitport -- is it official or not?

2016-07-11 Thread Martin Panter
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

[issue16858] tarfile silently hides errors

2016-07-11 Thread Martin Panter
Changes by Martin Panter : -- Removed message: http://bugs.python.org/msg265966 ___ Python tracker <http://bugs.python.org/issue16858> ___ ___ Python-bugs-list m

[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-12 Thread Martin Panter
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

[issue19142] Cross-compile fails trying to execute foreign pgen on build host

2016-07-12 Thread Martin Panter
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

[issue19027] undefined symbol: _PyParser_Grammar

2016-07-12 Thread Martin Panter
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

[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-12 Thread Martin Panter
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-

[issue22981] Use CFLAGS when extracting multiarch

2016-07-12 Thread Martin Panter
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

[issue27133] python 3.5.1 will not compile because libffi module uses wrong CFLAGS

2016-07-12 Thread Martin Panter
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

[issue27506] make bytes/bytearray delete a keyword argument

2016-07-13 Thread Martin Panter
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

[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-13 Thread Martin Panter
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

[issue13312] test_time fails: strftime('%Y', y) for negative year

2016-07-13 Thread Martin Panter
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

[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-14 Thread Martin Panter
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

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-14 Thread Martin Panter
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

[issue1621] Do not assume signed integer overflow behavior

2016-07-14 Thread Martin Panter
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

[issue1621] Do not assume signed integer overflow behavior

2016-07-14 Thread Martin Panter
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

[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-16 Thread Martin Panter
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

[issue27528] Document that filterwarnings(message=...) matches the start of a message

2016-07-16 Thread Martin Panter
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

[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-16 Thread Martin Panter
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

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-07-16 Thread Martin Panter
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

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-16 Thread Martin Panter
Changes by Martin Panter : -- Removed message: http://bugs.python.org/msg270561 ___ Python tracker <http://bugs.python.org/issue27130> ___ ___ Python-bugs-list m

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-16 Thread Martin Panter
Martin Panter added the comment: I added one comment, but I think this might almost be ready -- ___ Python tracker <http://bugs.python.org/issue27130> ___ ___

[issue1621] Do not assume signed integer overflow behavior

2016-07-16 Thread Martin Panter
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

[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-16 Thread Martin Panter
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

[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-16 Thread Martin Panter
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

[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-17 Thread Martin Panter
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

[issue27377] Add smarter socket.fromfd()

2016-07-17 Thread Martin Panter
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

[issue19142] Cross-compile fails trying to execute foreign pgen on build host

2016-07-17 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> out of date status: open -> closed ___ Python tracker <http://bugs.python.org/issue19142> ___ ___ Python-bugs-

[issue27490] ARM cross-compile: pgen built without $(CFLAGS) as $(LIBRARY) dependency

2016-07-17 Thread Martin Panter
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

[issue8238] Proxy handling very slow

2016-07-17 Thread Martin Panter
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

[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-18 Thread Martin Panter
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

[issue27559] Crash On bytearray()

2016-07-18 Thread Martin Panter
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

[issue27560] zlib.compress() crash and keyboard interrupt stops working

2016-07-18 Thread Martin Panter
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

[issue27507] bytearray.extend lacks overflow check when increasing buffer

2016-07-18 Thread 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

[issue27547] Integer Overflow Crash On float(array.array())

2016-07-18 Thread Martin Panter
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

[issue27560] Memory overallocation crash and keyboard interrupt stops working

2016-07-18 Thread Martin Panter
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

[issue14375] Add socketserver running property

2016-07-18 Thread Martin Panter
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

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-18 Thread Martin Panter
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

[issue27570] Avoid memcpy(. . ., NULL, 0) etc calls

2016-07-18 Thread Martin Panter
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(

[issue27528] Document that filterwarnings(message=...) matches the start of a message

2016-07-18 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue1621] Do not assume signed integer overflow behavior

2016-07-18 Thread Martin Panter
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

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-20 Thread Martin Panter
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

[issue1621] Do not assume signed integer overflow behavior

2016-07-20 Thread Martin Panter
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

[issue20932] Undefined behavior flagged by Clang 3.4 (Python 3.5 from hg)

2016-07-20 Thread Martin Panter
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

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-20 Thread Martin Panter
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

[issue27568] "HTTPoxy", use of HTTP_PROXY flag supplied by attacker in CGI scripts

2016-07-20 Thread Martin Panter
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

[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-20 Thread Martin Panter
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

[issue26662] configure/Makefile doesn't check if "python" command works, needed to build Objects/typeslots.inc

2016-07-21 Thread Martin Panter
Martin Panter added the comment: I think that error message would be okay. -- ___ Python tracker <http://bugs.python.org/issue26662> ___ ___ Python-bugs-list m

[issue24034] Make fails Objects/typeslots.inc

2016-07-21 Thread Martin Panter
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 ->

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-07-21 Thread Martin Panter
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

[issue27572] Support bytes-like objects when base is given to int()

2016-07-22 Thread Martin Panter
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

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-22 Thread Martin Panter
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'

[issue27490] Do not run pgen when it is not going to be used (cross-compiling)

2016-07-22 Thread Martin Panter
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

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-22 Thread Martin Panter
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

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-22 Thread Martin Panter
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

<    8   9   10   11   12   13   14   15   16   17   >