[issue19993] Pool.imap doesn't work as advertised
New submission from Jurjen N.E. Bos: The pool.imap and pool.imap_unordered functions are documented as a lazy version of Pool.map. In fact, they aren't: they consume the iterator argument as a whole. This is almost certainly not what the user wants: it uses unnecessary memory and will be slower than expected if the output iterator isn't consumed in full. In fact, there isn't much use at all of imap over map at the moment. I tried to fixed the code myself, but due to the two-level queueing of the input arguments this is not trivial. Stackoverflow's Blckknght wrote a simplified solution that gives the idea how it should work. Since that wasn't posted here, I thought it would be useful to put it here, even if only for documentation purposes. -- components: Library (Lib) files: mypool.py messages: 206279 nosy: jneb priority: normal severity: normal status: open title: Pool.imap doesn't work as advertised type: behavior Added file: http://bugs.python.org/file33158/mypool.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Vajrasky Kok added the comment: How about this doc fix? -- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file33159/fix_doc_parse_non_valid_json_float.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19976] Argument Clinic: generate second arg for METH_NOARGS
STINNER Victor added the comment: The Visual Studio pragma disables for the rest of the file, which is undesirable. Maybe we could turn it on and off inline, but it's not clear to me that that would have the desired effect of turning off the warning for explicitly that parameter declaration. Oh, I didn't know that it is file-wide. There are __pragma(warning(push)) and __pragma(warning(pop)) commands to disable a pragma. I don't know it is can be used using Py_UNUSED(name) macro (is it possible to pop the pragma before the function body?). If a compiler does not provide a syntax to disable the warning just in one function, the warning should be disabled for the compilation of the whole project. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19976 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19983] Ctrl-C at startup can end in a Py_FatalError call
STINNER Victor added the comment: I modified initstdio() to add raise(SIGINT); at the beginning of the function. I get: $ ./python Fatal Python error: Py_Initialize: can't initialize sys standard streams Traceback (most recent call last): File frozen importlib._bootstrap, line 2157, in _find_and_load KeyboardInterrupt Abandon (core dumped) You can also inject SIGINT in gdb if you set a breakpoint on initstdio(): (gdb) b initstdio (gdb) run python stopped at initstdio enter (gdb) signal SIGINT I don't consider this as a bug, but I understand that you would prefer a different behaviour. The question is which behaviour do you want? You want to ignore CTRL+c during initialization? Do you prefer to quit without calling abort(), ex: exit with exit code 1? Maybe we should modify Py_FatalError() to call exit(1) in release mode, and only call abort() in debug mode? Dumping a core dump, opening a Windows fatal error popup, calling Fedora ABRT handler, etc. is maybe not very useful, especially for the KeyboardInterrupt case. What we could do is call initsigs() after initstdio() (but still before initsite(), since initsite() can call arbitrary Python code). initfsencoding() calls also Python code. It loads at least 3 Python scripts: encodings/__init__.py, encodings/aliases.py and encodings/NAME.py where NAME is your locale encoding. IMO signal handlers should be set up before any Python code is loaded, so initsigs() should be called before initfsencoding(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19983 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19994] re.match does not return or takes long time
New submission from Taesu Pyo: // code sampe: import re r = (r'(/.*)*X') s = '' print re.match(r, s) print list(re.finditer(r, s)) print re.findall(r, s) // it does not return or takes long time depends on length of 's' -- components: Regular Expressions messages: 206283 nosy: Taesu.Pyo, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.match does not return or takes long time type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19994 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19983] Ctrl-C at startup can end in a Py_FatalError call
Marc-Andre Lemburg added the comment: On 16.12.2013 10:02, STINNER Victor wrote: Maybe we should modify Py_FatalError() to call exit(1) in release mode, and only call abort() in debug mode? Dumping a core dump, opening a Windows fatal error popup, calling Fedora ABRT handler, etc. is maybe not very useful, especially for the KeyboardInterrupt case. I don't think changing Py_FatalError() is a good idea. However, its use in this particular case (streams not initializing) appears wrong. Python should simply exit with an error code in such a case; which then also allows the calling script or application to react to the error. The fatal error is reserved for cases where you cannot continue and can't even report back an error, not even as error code. Those are rare situations. You usually only use abort() if you need to debug the situation via a core dump, which is not needed in this case, since we know that the user caused a keyboard interrupt and in most other cases know that it's a config problem, not a problem in the C implementation of Python. -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19983 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19537] Fix misalignment in fastsearch_memchr_1char
STINNER Victor added the comment: If you compile Python with GCC, we can maybe try something with __attribute__ ((aligned (sizeof(void * attribute. The attribute can be used on a structure field. The problem is that we don't care of the alignment of header attributes, only of data, but data is not a field but the data just after the structure. Or is it possible to GCC to get a structure size aligned on 4 bytes? For the explicit padding: how do you compute the size of the padding? How about disabling the fast-path in FASTSEARCH if data is not aligned? (You might get non-aligned if even if structure is correctly aligned, it may happen if the memory allocator does not align memory blocks. I don't know if Python may get unaligned memory blocks.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19537 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17919] AIX POLLNVAL definition causes problems
STINNER Victor added the comment: I have fixed the issue in http://hg.python.org/cpython/rev/039306b45230 You forget 2.7 and 3.3 branches. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19983] Ctrl-C at startup can end in a Py_FatalError call
STINNER Victor added the comment: 2013/12/16 Marc-Andre Lemburg rep...@bugs.python.org: I don't think changing Py_FatalError() is a good idea. However, its use in this particular case (streams not initializing) appears wrong. Python should simply exit with an error code in such a case; which then also allows the calling script or application to react to the error. Before exiting, you need a message. If there is also an exception, you may want to display it. If there is no exception, you may want to display the Python traceback. All these tasks are already implemented in Py_FatalError. If the defaullt behaviour of Py_FatalError() cannot be modified, a new function should be be added, a function sharing its code with Py_FatalError(). Example: a new private function void initerror(const char *message) only used during Py_Initialize(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19983 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19983] Ctrl-C at startup can end in a Py_FatalError call
Marc-Andre Lemburg added the comment: On 16.12.2013 10:30, STINNER Victor wrote: STINNER Victor added the comment: 2013/12/16 Marc-Andre Lemburg rep...@bugs.python.org: I don't think changing Py_FatalError() is a good idea. However, its use in this particular case (streams not initializing) appears wrong. Python should simply exit with an error code in such a case; which then also allows the calling script or application to react to the error. Before exiting, you need a message. If there is also an exception, you may want to display it. If there is no exception, you may want to display the Python traceback. All these tasks are already implemented in Py_FatalError. If the defaullt behaviour of Py_FatalError() cannot be modified, a new function should be be added, a function sharing its code with Py_FatalError(). Example: a new private function void initerror(const char *message) only used during Py_Initialize(). Sounds reasonable. BTW: Why can't we make this an official API function, e.g. Py_Terminate() ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19983 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19983] Ctrl-C at startup can end in a Py_FatalError call
STINNER Victor added the comment: BTW: Why can't we make this an official API function, e.g. Py_Terminate() ? Exiting Python immediatly is bad practice, there is already Py_FatalError() for that. Instead of adding a second public function, I would prefer to remove most calls to Py_FatalError() and write nicer error handlers :-) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19983 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
New submission from Ethan Furman: Using Enum to illustrate: -- class Grade(enum.Enum): ... A = 4 ... B = 3 ... C = 2 ... D = 1 ... F = 0 ... def __index__(self): ... return self._value_ -- ['miserable'][Grade.F] 'miserable' -- '%x' % Grade.F Traceback (most recent call last): File stdin, line 1, in module TypeError: %x format: a number is required, not Grade -- hex(Grade.F) '0x0' I suggest that hex() and oct() have the same check that %x and %o do so that non-numbers are not representable as hex and octal. While we're at it, we should do the same for bin(). Are there any others? I'll create a patch once we have a decision on which way to solve this issue. -- assignee: ethan.furman messages: 206290 nosy: ethan.furman, gvanrossum, mark.dickinson, pitrou, rhettinger, serhiy.storchaka, skrah priority: normal severity: normal status: open title: hex() and %x, oct() and %o do not behave the same versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19988] hex() and oct() use __index__ instead of __int__
Ethan Furman added the comment: Guido van Rossum opined: I still think the problem is with your class design. You shouldn't want a hex representation for a value that's not an integer. Well, in fairness I only supported it because bool does, and I was trying to have Logical match bool as closely as possible. Which is also why, in Py2, attempting such operations on an Unknown value raises exceptions. As an example: # bool -- True + True 2 # Logical -- Truth + Truth 2 -- Truth + Unknown Logical('?') I can do that because I was able to override __add__ and __raddd__; however, if I _do not_ overide index: # bool -- ['no', 'yes'][True] 'yes' # Logical -- ['no', 'yes', 'maybe'][Truth] Traceback (most recent call last): File stdin, line 1, in module TypeError: list indices must be integers, not Logical So either I break compatibility with bools in a rather fundamental way, or I live with the eyesore of being able to use %x and %o on Unknown values. Incidentally, bool is still not subclassable, and using int as a base class for Logical blew up over half my tests. Perhaps not quite so incidentally, if __index__ is added to an Enum (not IntEnum) subclass, it will have the same wierdness. Guido van Rossum stated: For the difference between %x and hex() please open another issue (you might want to track down the cause in the source first so you can add a patch or at least a suggested fix to the issue). Issue19995 is created, current participants nosied. I'll track it down as soon as I can (may be a few days). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19988 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19871] json module won't parse a float that starts with a decimal point
Vajrasky Kok added the comment: Okay, I added unit test for this edge case. -- Added file: http://bugs.python.org/file33160/parse_non_valid_json_float_with_unit_test.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19871 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
STINNER Victor added the comment: Calls: * hex()/oct() = PyNumber_ToBase() = PyNumber_Index(). * PyUnicode_Format() = mainformatlong() = PyNumber_Long() I never understood the difference between long (__int__ method) and index (__index__ method). Is the difference on the behaviour of floating point numbers? -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Changes by Cory Benfield c...@lukasa.co.uk: -- components: Library (Lib) nosy: Lukasa priority: normal severity: normal status: open title: httplib infinite read on invalid header type: behavior versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
New submission from Cory Benfield: Initially spotted on Requests GitHub bugtracker: https://github.com/kennethreitz/requests/issues/1804 On receiving an HTTP response with an invalid header, httplib stops parsing the headers and attempts to receive the rest of the message as body content. Normally that would be fine, but problems occur if later on in the headers Transfer-Encoding: chunked is declared. This leads to a hang while reading the body content until the remote end forcibly closes the connection. This bug certainly affects versions 2.7 through 3.3. To reproduce (note that we need to request gzip to get the server to send the bad header): import http.client h = http.client.HTTPConnection('www.sainsburysbank.co.uk') h.request('GET', '/', headers={'Accept-Encoding': 'gzip'}) r = h.getresponse() hdrs = r.getheaders() body = r.read() # Hang here. cURL configured equivalently doesn't exhibit this problem, that is the following works fine: curl --compressed http://www.sainsburysbank.co.uk/ It's not clear to me that this behaviour is wrong. The server is definitely violating RFC 2616 which expressly forbids empty header names. I'm open to consultation about what the correct fix should be here (which may be nothing at all). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17919] AIX POLLNVAL definition causes problems
Roundup Robot added the comment: New changeset c42647d76bd1 by Christian Heimes in branch '3.3': Issue #17919: add missing import of USHRT_MAX http://hg.python.org/cpython/rev/c42647d76bd1 New changeset 1f3f4147c35e by Christian Heimes in branch 'default': Issue #17919: add missing import of USHRT_MAX http://hg.python.org/cpython/rev/1f3f4147c35e -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19946] Handle a non-importable __main__ in multiprocessing
Nick Coghlan added the comment: I created a test suite to ensure that all the various cases were handled correctly by the eventual patch (it doesn't test some of the namespace package related edge cases, but they devolve to normal module execution in terms of the final state of __main__, and that's covered by these tests). -- Added file: http://bugs.python.org/file33161/test_multiprocessing_main_handling.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19946 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19946] Handle a non-importable __main__ in multiprocessing
Nick Coghlan added the comment: Current work in progress patch. The existing multiprocessing tests all pass, but the new main handling tests fail. The fork start_method passes all the tests The forkserver and spawn start methods fail the directory, zipfile and package tests. -- Added file: http://bugs.python.org/file33162/issue19946_pep_451_multiprocessing_v2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19946 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19946] Handle a non-importable __main__ in multiprocessing
Nick Coghlan added the comment: Updated test that handles timeouts better. I also realised the current test failures are due to an error in the test design - the failing cases are ones where we deliberately *don't* rerun __main__ because the entire __main__.py file is assumed to be inside an implicit __main__-only guard. So the code changes should be complete, I just need to figure out a way to tweak the tests appropriately. -- Added file: http://bugs.python.org/file33163/test_multiprocessing_main_handling.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19946 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19946] Handle a non-importable __main__ in multiprocessing
Changes by Nick Coghlan ncogh...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19946 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19997] imghdr.what doesn't accept bytes paths
New submission from Claudiu.Popa: imghdr.what check explicitly for string path, while `open` happily accepts bytes paths, as seen below: x b'\xc2\xba' imghdr.what(x) Traceback (most recent call last): File stdin, line 1, in module File /tank/libs/cpython/Lib/imghdr.py, line 15, in what location = file.tell() AttributeError: 'bytes' object has no attribute 'tell' open(x) _io.TextIOWrapper name=b'\xc2\xba' mode='r' encoding='UTF-8' A reason why this should be supported can be found in this message: http://bugs.python.org/msg191691. The following patch fixes this. Also, it depends on issue19990 (where test_imghdr.py was added). -- components: Library (Lib) files: imghdr_bytes.patch keywords: patch messages: 206299 nosy: Claudiu.Popa priority: normal severity: normal status: open title: imghdr.what doesn't accept bytes paths type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file33164/imghdr_bytes.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19997 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19965] Non-atomic generation of Include/Python-ast.h and Python/Python-ast.c
Roundup Robot added the comment: New changeset 874813a3523d by Charles-François Natali in branch '2.7': Issue #19965: Make sure that Python-ast.h is properly taken into account in the http://hg.python.org/cpython/rev/874813a3523d New changeset cfe0a293551f by Charles-François Natali in branch '3.3': Issue #19965: Make sure that Python-ast.h is properly taken into account in the http://hg.python.org/cpython/rev/cfe0a293551f New changeset ad42ea70668e by Charles-François Natali in branch 'default': Issue #19965: Make sure that Python-ast.h is properly taken into account in the http://hg.python.org/cpython/rev/ad42ea70668e -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19965 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19946] Handle a non-importable __main__ in multiprocessing
Olivier Grisel added the comment: I applied issue19946_pep_451_multiprocessing_v2.diff and I confirm that it fixes the problem that I reported initially. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19946 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19901] tests fail due to unsupported SO_REUSEPORT when building Python 3.3.2-r2
Reuben Garrett added the comment: On Sat, Dec 14, 2013 at 2:38 PM, Gregory P. Smith rep...@bugs.python.org wrote: ask the gentoo python portage ebuild maintainer and point them at the commit with the additional patch to apply if you want it fixed there. (or file a bug on gentoo's bug tracking system and point it at this one) … try checking out and compiling the latest source tree from hg.python.orgas described in http://docs.python.org/devguide/ (on the 3.3 branch in your case) when reporting an issue. That's actually really good advice (applicable to other projects beyond Python) — thank you so much, Gregory! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19901 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Eric V. Smith added the comment: It seems to me that by giving it an __index__ method, you're saying it can be used as an integer. It's not surprising to me that hex(), oct(), and bin() would work with a Grade.F object. If anything, I'd say that more places should use __index__ than currently do. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19912] ntpath.splitunc() is broken and not tested
Roundup Robot added the comment: New changeset 129105f8457d by Serhiy Storchaka in branch '3.3': Issue #19912: Fixed numerous bugs in ntpath.splitunc(). http://hg.python.org/cpython/rev/129105f8457d New changeset 5e39c69bad21 by Serhiy Storchaka in branch 'default': Issue #19912: Fixed numerous bugs in ntpath.splitunc(). http://hg.python.org/cpython/rev/5e39c69bad21 New changeset e4beb183a674 by Serhiy Storchaka in branch '2.7': Issue #19912: Fixed numerous bugs in ntpath.splitunc(). http://hg.python.org/cpython/rev/e4beb183a674 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19912 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19911] ntpath.splitdrive() fails when UNC part contains \u0130
Roundup Robot added the comment: New changeset 7b0d083082ea by Serhiy Storchaka in branch '3.3': Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character http://hg.python.org/cpython/rev/7b0d083082ea New changeset 63d769dfa4ef by Serhiy Storchaka in branch 'default': Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character http://hg.python.org/cpython/rev/63d769dfa4ef -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19911 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19911] ntpath.splitdrive() fails when UNC part contains \u0130
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19911 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19911] ntpath.splitdrive() fails when UNC part contains \u0130
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: -Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19911 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19912] ntpath.splitunc() is broken and not tested
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19912 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
R. David Murray added the comment: Well, having it hang forever is a potential DOS attack, so something needs to be fixed, I think. -- nosy: +christian.heimes, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19998] Python 2.7.6 fails to build _ctypes on GCC 2.x toolchain
New submission from Jim Carroll: When building Python 2.7.6 on older GCC 2.x, the _ctypes module fails to build. The failure is caused due to a header file reference to __builtin_expect (the author expected this to be available when the module was built with gcc, but did not take into account that this was not available in all versions of gcc). The solution is a simple modification to the test in ffi_common.h --- Modules/_ctypes/libffi/include/ffi_common.h Sun Nov 10 02:36:41 2013 +++ Modules/_ctypes/libffi/include/ffi_common.h.fix Mon Dec 16 08:23:56 2013 @@ -115,7 +115,7 @@ typedef float FLOAT32; -#ifndef __GNUC__ +#if !defined(__GNUC__) || __GNUC__==2 #define __builtin_expect(x, expected_value) (x) #endif #define LIKELY(x)__builtin_expect(!!(x),1) -- components: Build files: ffi_common.h.patch keywords: patch messages: 206307 nosy: jamercee priority: normal severity: normal status: open title: Python 2.7.6 fails to build _ctypes on GCC 2.x toolchain type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file33165/ffi_common.h.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19998 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17919] AIX POLLNVAL definition causes problems
Serhiy Storchaka added the comment: Thank you Christian. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18215] Script to test multiple versions of OpenSSL
Roundup Robot added the comment: New changeset 7719efb182e3 by Christian Heimes in branch 'default': Issue #18215: Add script Tools/ssl/test_multiple_versions.py to compile and http://hg.python.org/cpython/rev/7719efb182e3 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18215 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18215] Script to test multiple versions of OpenSSL
Changes by Christian Heimes li...@cheimes.de: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18215 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19887] Path.resolve() fails on complex symlinks
Serhiy Storchaka added the comment: I suppose that was some kind of joke, but what I meant was that we don't need to test with 100 levels of symlinks. 2 or 3 are enough... Yes, sorry for this joke. Your tests LGTM, but why you repeat similar code 3-4 times instead using loops? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19537] Fix misalignment in fastsearch_memchr_1char
Serhiy Storchaka added the comment: I think that adding __attribute__ ((aligned (sizeof(void * to the PyObject type (or to the ob_base field) is enough. If first byte of structure is aligned, then first byte past the structure should be aligned too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19537 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Roundup Robot added the comment: New changeset 1824fa874f08 by Christian Heimes in branch 'default': Issue #19987: disable test_winsound's test_alias_fallback test when no sound card http://hg.python.org/cpython/rev/1824fa874f08 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19887] Path.resolve() fails on complex symlinks
Vajrasky Kok added the comment: The patch passed on Windows Vista. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Zachary Ware added the comment: This is a little odd, since it seems that that buildbot doesn't have a sound card (according to _have_soundcard), but succeeded in playing a sound...although without an ear in the room, we have no way to tell if a sound was played or not. I'm thinking it may be most sane to rewrite the test to call PlaySound in a `try: ... except RuntimeError:` block, and add a comment saying that either outcome is acceptable; a failure would be any other error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Cory Benfield added the comment: The easiest way to 'fix' the DoS problem is to throw an exception if an invalid header is parsed. That's a backwards-compatibility problem though: things that previously 'worked' now won't. That presumably limits the ability to back-apply this fix to 2.7.7. An alternative option is to speculatively attempt to parse the next line for headers or the end of the header block. I'm not sure this is a great idea: at this stage all we know is that the header block is malformed, so it's not clear that 'doing our best' is a good idea either, especially since that attitude got us here to begin with. The best 'middle of the road' option is to abort message parsing at this stage without throwing an exception. This leads to truncated headers and no body, where previously we'd have got truncated headers and a body that potentially included the missing headers. We could also potentially add a warning about the problem. Are there any preferences for a fix here, or a better solution than the above (none of which I'm wild about)? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Christian Heimes added the comment: Zach, that sounds like a really good plan. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Zachary Ware added the comment: I'll get it committed shortly, thanks Christian. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Changes by Zachary Ware zachary.w...@gmail.com: -- assignee: - zach.ware ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
R. David Murray added the comment: I haven't looked at the code, but could we preserve the existing behavior but apply a timeout to mitigate the DOS? On the other hand, the fact that curl manages to return something indicates there is probably an error recovery strategy that would work. I'm not sure if we have an error reporting mechanism in httplib if we do error recovery. We do in the email module, and httplib uses the email code for headers, I think, so there might be a way to leverage that if there is no existing mechanism. But of course even deciding to do that requires some discussion :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Roundup Robot added the comment: New changeset f590e9aeb990 by Zachary Ware in branch '2.7': Issue #19987: Re-write test_alias_fallback in test_winsound to have two http://hg.python.org/cpython/rev/f590e9aeb990 New changeset 5455456945d4 by Zachary Ware in branch '3.3': Issue #19987: Re-write test_alias_fallback in test_winsound to have two http://hg.python.org/cpython/rev/5455456945d4 New changeset 1aa6751b298f by Zachary Ware in branch 'default': Issue #19987: Merge with 3.3 http://hg.python.org/cpython/rev/1aa6751b298f -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Cory Benfield added the comment: Maybe. If we do it we have to apply that timeout to all the socket actions on that HTTP connection. This would have the effect of changing the default value of the timeout parameter on the HTTPConnection object from socket._GLOBAL_DEFAULT_TIMEOUT to whatever value was chosen. We could do this for reads only, and avoid applying the timeout to connect() calls, but that's kind of weird. We hit the same problem though: by default, HTTPConnections block indefinitely on all socket calls: we'd be changing that default to some finite timeout instead. Does that sound like a good way to go? As for curl's error recovery strategy, I'm pretty sure it just keeps parsing the header block. That can definitely be done here. We do have an error reporting mechanism as well (sort of): we set the HTTPMessage.status field to some error string. We could do that, and continue to parse the header block: that's probably the least destructive way to fix this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Ethan Furman added the comment: Victor Stinner commented: - I never understood the difference between long (__int__ method) and index (__index__ method). Is the difference on the behaviour of floating point numbers? __index__ was originally added so that non-int integers, such as NumPy's int16, int32, etc, integer types could be used as indices and slices. Now it means if your type can produce a lossless integer, use __index__, which is why float and similar types don't define it. The current meaning is unfortunate in that it is possible to want a type that can be used as an index or slice but that is still not a number, and in fact won't be used as a number in any scenario _except_ bin(), hex(), and oct(). It seems to me that by having those three functions check that the argument is a number, and bailing if it is not, is a decent way to ensure consistency. One question I do have, since I don't have NumPy installed, is what happens with: -- NumPy's int's work here? %x % uint16(7) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
STINNER Victor added the comment: $ python Python 2.7.5 (default, Nov 12 2013, 16:18:42) import numpy hex(numpy.uint16(257)) '0x101' %x % numpy.uint16(257) '101' x=numpy.uint16(257) x.__int__() 257 x.__index__() 257 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Stefan Krah added the comment: Ethan Furman rep...@bugs.python.org wrote: The current meaning is unfortunate in that it is possible to want a type that can be used as an index or slice but that is still not a number, and in fact won't be used as a number in any scenario _except_ bin(), hex(), and oct(). memoryview, struct and probably also array.array accept __index__. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Ethan Furman added the comment: Did I mention __index__ is an unfortunate name for the current trend for this method? Stefan Krah commented: -- memoryview, struct and probably also array.array accept __index__. When you say accept __index__ do you mean for use as indices, or for use as values in the data structure itself? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Stefan Krah added the comment: Did I mention __index__ is an unfortunate name for the current trend for this method? Yes, but it's probably too late to change that now. Also, a fully precise name would be something like: __to_int_exact_iff_object_has_integer_nature__ :) When you say accept __index__ do you mean for use as indices, or for use as values in the data structure itself? The latter, see Lib/test/test_buffer.py:2489 . -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19912] ntpath.splitunc() is broken and not tested
Berker Peksag added the comment: Hi Serhiy, there are commented-out lines in changeset http://hg.python.org/cpython/rev/e4beb183a674. Are they intentionally there? +#if p[1:2] == ':': +#return '', p # Drive letter present +#firstTwo = p[0:2] +#if firstTwo == '//' or firstTwo == '': +## is a UNC path: +## equivalent to drive letter +## \\machine\mountpoint\directories... +## directory ^^^ +#normp = normcase(p) +#index = normp.find('\\', 2) +#if index == -1: +###raise RuntimeError, 'illegal UNC path: ' + p + '' +#return (, p) +#index = normp.find('\\', index + 1) +#if index == -1: +#index = len(p) +#return p[:index], p[index:] +#return '', p -- nosy: +berker.peksag ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19912 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19912] ntpath.splitunc() is broken and not tested
Roundup Robot added the comment: New changeset 4de09cbd3b97 by Serhiy Storchaka in branch '2.7': Removed old implementation of ntpath.splitunc() (issue #19912). http://hg.python.org/cpython/rev/4de09cbd3b97 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19912 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19994] re.match does not return or takes long time
Tim Peters added the comment: It will always complete, but may take a very long time - this is one of many ways to write a regexp that can't match requiring time exponential in the length of the string. It's not a bug - it's the way Python's kind of regexp engine works. For detailed explanation, see Jeffrey Friedl's book Mastering Regular Expressions: http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124 -- nosy: +tim.peters resolution: - invalid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19994 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19912] ntpath.splitunc() is broken and not tested
Serhiy Storchaka added the comment: Oh, my fault. Thank you Berker. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19912 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Ethan Furman added the comment: Hmmm... Well, much as I hate to say it, it's sounding like the correct solution here is to have %o and %x work when __index__ is available, instead of the other way around. :( .format is not an issue because one must specify one's own if inheriting from object. So the complete list of spcecifiers then is d, i, o, u, U, and c [1], and they should work if __index__ works. Are we in agreement? [1] http://docs.python.org/dev/library/stdtypes.html#printf-style-string-formatting -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
STINNER Victor added the comment: Are we in agreement? Start maybe on writing unit tests :-) IMO all int-like objects should behave the same. I don't see any good reason why hex(value) would succeed whereas %x % value fails. Both should succeed (or both should fail). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Serhiy Storchaka added the comment: Did I mention __index__ is an unfortunate name for the current trend for this method? Yes, but it's probably too late to change that now. Also, a fully precise name would be something like: __to_int_exact_iff_object_has_integer_nature__ :) Perhaps in future (may be in 4.0) __index__ should be renamed to __int__ and __int__ to __trunc__. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19993] Pool.imap doesn't work as advertised
Tim Peters added the comment: Nice to see you, Jurjen! Been a long time :-) I'd like to see changes here too. It's unclear what a lazy version is intended to mean, exactly, but I agree the actual behavior is surprising, and that mpool.py is a lot less surprising in several ways. I got bitten by this just last week, when running a parallelized search over a massive space _expected_ to succeed after exploring a tiny fraction of the search space. Ran out of system resources because imap_unordered() tried to queue up countless millions of work descriptions. I had hoped/expected that it would interleave generating and queue'ing a few inputs with retrieving outputs, much as mpool.py behaves. In that case I switched to using apply_async() instead, interposing my own bounded queue (a collections.deque used only in the main program) to throttle the main program. I'm still surprised it was necessary ;-) -- nosy: +tim.peters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Zachary Ware added the comment: The revised test passes on that buildbot on 3.3 and 3.x; the 2.7 build is having permissions issues (and seems to have been for some time). Closing the issue. Thanks for pointing it out and approving the rewrite, Christian! -- resolution: - fixed stage: test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Eric V. Smith added the comment: Yes, I think adding __index__ to d, i, o, u, U, and c is the correct thing to do here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19987] Winsound: test_alias_fallback fails on WS 2008
Christian Heimes added the comment: Awesome! Thanks a lot! :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19987 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Guido van Rossum added the comment: Not so fast. Currently, even in Python 3, '%d' % 3.14 returns '3'. Fixing this will likely break a huge amount of code. -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Guido van Rossum added the comment: Also (the tracker email interface swallowed this): it is possible to want a type that can be used as an index or slice but that is still not a number I'm sorry, but this requirement is absurd. An index *is* a number. You have to make up your mind. (I know, in the context of the example that started this, this is funny, but I still stand by it.) --- Finally, the correct name should perhaps have been __integer__ but I don't see enough reason to change it now. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7980] time.strptime not thread safe
David Palms added the comment: I am still seeing this in 2.7.5, has a patch been created yet? -- nosy: +dpalms2011 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7980 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Eric V. Smith added the comment: If you were going to make this change, I'd think you'd have to look for __index__ and then __int__. But I'll admit I haven't thought through all of the ramifications. It would be interesting to see what tests would break. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19045] Make on Solaris 11 x64 with OracleStudio12.3 failed
Christian Heimes added the comment: Thanks for the report. This is a duplicate of issue #16733. I'm closing this bug as duplicated. -- nosy: +christian.heimes resolution: - duplicate stage: - committed/rejected status: open - closed versions: +Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19045 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16733] Solaris ctypes_test failures
Christian Heimes added the comment: The ctypes issue also affects test_uuid. #19045 is a duplicate of this bug, too. == FAIL: test_ints (ctypes.test.test_bitfields.C_Test) -- Traceback (most recent call last): File /home/cpython/buildslave/cc-32/3.x.snakebite-solaris11-amd64/build/Lib/ctypes/test/test_bitfields.py, line 40, in test_ints self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii'))) AssertionError: -1 != 1 == FAIL: test_shorts (ctypes.test.test_bitfields.C_Test) -- Traceback (most recent call last): File /home/cpython/buildslave/cc-32/3.x.snakebite-solaris11-amd64/build/Lib/ctypes/test/test_bitfields.py, line 47, in test_shorts self.assertEqual(getattr(b, name), func(byref(b), name.encode('ascii'))) AssertionError: -32 != 32 == FAIL: test_uuid4 (test.test_uuid.TestUUID) -- Traceback (most recent call last): File /home/cpython/buildslave/cc-32/3.x.snakebite-solaris11-amd64/build/Lib/test/test_uuid.py, line 441, in test_uuid4 equal(u.variant, uuid.RFC_4122) AssertionError: 'reserved for Microsoft compatibility' != 'specified in RFC 4122' - reserved for Microsoft compatibility + specified in RFC 4122 -- nosy: +christian.heimes versions: +Python 3.4 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16733 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19999] test_monotonic fails on x86 OpenIndiana
New submission from Christian Heimes: I have seen this failure multiple times. http://buildbot.python.org/all/builders/x86%20OpenIndiana%203.x/builds/7353/steps/test/logs/stdio == FAIL: test_monotonic (test.test_time.TimeTestCase) -- Traceback (most recent call last): File /export/home/buildbot/32bits/3.x.cea-indiana-x86/build/Lib/test/test_time.py, line 387, in test_monotonic self.assertAlmostEqual(dt, 0.5, delta=0.2) AssertionError: 0.8012567944824696 != 0.5 within 0.2 delta -- -- assignee: haypo components: Tests keywords: buildbot messages: 206344 nosy: christian.heimes, haypo priority: low severity: normal stage: test needed status: open title: test_monotonic fails on x86 OpenIndiana type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19887] Path.resolve() fails on complex symlinks
Antoine Pitrou added the comment: why you repeat similar code 3-4 times instead using loops? For no real reason :) I'll try with a loop. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19887] Path.resolve() fails on complex symlinks
Antoine Pitrou added the comment: Ah, I remember. Using subtests would make it more annoying to backport to 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20000] SSLContext.get_ca_certs() and self-signed certs
New submission from Christian Heimes: The new method SSLContext.get_ca_certs() returns all certificates in the context's trusted X509_STORE. I recently found out that it is possible to put a self-signed certificate into the store and use it successfully with verify_mode CERT_REQUIRED. get_ca_certs() doesn't return the cert although it is used to successfully validate a remote cert. I propose to modify and rename the function and to add a check_ca to the dict that is returned by getpeercert(). -- components: Extension Modules messages: 206347 nosy: christian.heimes priority: normal severity: normal stage: test needed status: open title: SSLContext.get_ca_certs() and self-signed certs type: behavior versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19887] Path.resolve() fails on complex symlinks
Roundup Robot added the comment: New changeset 12a52186b4fd by Antoine Pitrou in branch 'default': Issue #19887: Improve the Path.resolve() algorithm to support certain symlink chains. http://hg.python.org/cpython/rev/12a52186b4fd -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19887] Path.resolve() fails on complex symlinks
Antoine Pitrou added the comment: Thanks a lot for the patch! -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19887 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Cory Benfield added the comment: An update: in Python 2.7 through 3.3, fixing this should only affect http.client/httplib, because they do most of their header parsing themselves. Fixing this in later versions of Python is more interesting, as http.client got rewritten to use email.parser (which uses email.feedparser). This means any change to fix this problem in HTTP will also affect anything else that uses this module. Not sure how problematic that is yet. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20000] SSLContext.get_ca_certs() and self-signed certs
Christian Heimes added the comment: Example: $ openssl s_server -cert Lib/test/ssl_cert.pem -key Lib/test/ssl_key.pem $ ./python import ssl ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv3) ctx.verify_mode = ssl.CERT_REQUIRED ctx.check_hostname = True ctx.load_verify_locations(Lib/test/ssl_cert.pem) s = ssl.create_connection((localhost, 4433)) with ctx.wrap_socket(s, server_hostname=localhost) as ssock: ... peer = ssock.getpeercert() ... peer {'notAfter': 'Oct 5 23:01:56 2020 GMT', 'version': 3, 'serialNumber': 'D7C7381919AFC24E', 'subjectAltName': (('DNS', 'localhost'),), 'issuer': ((('countryName', 'XY'),), (('localityName', 'Castle Anthrax'),), (('organizationName', 'Python Software Foundation'),), (('commonName', 'localhost'),)), 'subject': ((('countryName', 'XY'),), (('localityName', 'Castle Anthrax'),), (('organizationName', 'Python Software Foundation'),), (('commonName', 'localhost'),)), 'notBefore': 'Oct 8 23:01:56 2010 GMT'} ctx.get_ca_certs() [] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19921] Path.mkdir(0, True) always fails
Antoine Pitrou added the comment: Note that the description of the POSIX mkdir utility (*) has something a bit more complex to say about the `-p` option. Instead of simply applying the default umask, it computes (S_IWUSR|S_IXUSR|~filemask)0777 as the mode argument, where filemask is the file mode creation mask of the process (see XSH umask). But unless the umask has a pathological value (such as 0o333), it doesn't really matter. The main point is that the original mode argument is ignored. (*) http://pubs.opengroup.org/onlinepubs/9699919799/utilities/mkdir.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19921 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Cory Benfield added the comment: Actually, that might be OK. I don't know the email package at all, but I suspect being able to handle empty header keys (by ignoring them) is a reasonable thing to do in the email case as well. Thoughts? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20001] pathlib inheritance diagram too large
New submission from Antoine Pitrou: The inheritance diagram at http://docs.python.org/dev/library/pathlib.html is too large, it can easily take up half the vertical space (or perhaps all of it on a smaller screen). The font size looks fine, it's just that there's a lot of spacing around. (of course, the style could perhaps also be changed or improved) -- assignee: docs@python components: Documentation messages: 206354 nosy: docs@python, eli.bendersky, georg.brandl, pitrou priority: low severity: normal status: open title: pathlib inheritance diagram too large versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20001 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19921] Path.mkdir(0, True) always fails
Roundup Robot added the comment: New changeset 87b81b7df7f0 by Antoine Pitrou in branch 'default': Issue #19921: When Path.mkdir() is called with parents=True, any missing parent is created with the default permissions, ignoring the mode argument (mimicking the POSIX mkdir -p command). http://hg.python.org/cpython/rev/87b81b7df7f0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19921 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19921] Path.mkdir(0, True) always fails
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19921 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19930] os.makedirs('dir1/dir2', 0) always fails
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19930 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19993] Pool.imap doesn't work as advertised
Tim Peters added the comment: Just for interest, I'll attach the worm-around I mentioned (imu.py). At this level it's a very simple implementation, but now that I look at it, it's actually a lazy implementation of imap() (or of an unimaginative ;-) imap_unordered()). -- Added file: http://bugs.python.org/file33166/imu.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19993 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20002] Cleanup and microoptimize pathlib
New submission from Serhiy Storchaka: Here is a patch which contains many small cleanups and optimizations for the pathlib module. Not all of them can be backported to 2.7 version. -- assignee: pitrou components: Library (Lib) files: pathlib_cleanup.patch keywords: patch messages: 206357 nosy: pitrou, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Cleanup and microoptimize pathlib type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file33167/pathlib_cleanup.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20002 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19919] SSL: test_connect_ex_error fails with EWOULDBLOCK
Christian Heimes added the comment: Here is a patch. -- keywords: +patch Added file: http://bugs.python.org/file33168/issue19919.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19919] SSL: test_connect_ex_error fails with EWOULDBLOCK
Antoine Pitrou added the comment: Looks fine to me. -- stage: - patch review versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19996] httplib infinite read on invalid header
Cory Benfield added the comment: Alright, here's a patch for the current tip. I'll need to prepare a different patch for earlier versions of Python, which will take me a little while longer to do (maybe not today). I've also signed a contributor agreement, but it doesn't look like that's propagated here yet. -- keywords: +patch Added file: http://bugs.python.org/file33169/hdrs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19996 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19919] SSL: test_connect_ex_error fails with EWOULDBLOCK
Roundup Robot added the comment: New changeset 40955ae17472 by Christian Heimes in branch '3.3': Issue #19919: Fix flacky SSL test. connect_ex() sometimes returns http://hg.python.org/cpython/rev/40955ae17472 New changeset 593c3fa7aa2c by Christian Heimes in branch 'default': Issue #19919: Fix flacky SSL test. connect_ex() sometimes returns http://hg.python.org/cpython/rev/593c3fa7aa2c -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19919] SSL: test_connect_ex_error fails with EWOULDBLOCK
Christian Heimes added the comment: Thanks! -- resolution: - fixed stage: patch review - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19919 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Ethan Furman added the comment: Eric V. Smith commented: If you were going to make this change, I'd think you'd have to look for __index__ and then __int__. Does the order matter? Are there any types (and should there be) that would have both and return different answers for each? If not, pick an order, try one and, if that one fails, try the other. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Antoine Pitrou added the comment: I'm with Guido: it doesn't really make sense to allow __index__ but not __int__ on a type. So trying __index__ in str.format() sounds like a distraction. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20002] Cleanup and microoptimize pathlib
Antoine Pitrou added the comment: Ok, since it makes backporting more tedious, I'd rather keep this for post-3.4. -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20002 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20000] SSLContext.get_ca_certs() and self-signed certs
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19998] Python 2.7.6 fails to build _ctypes on GCC 2.x toolchain
Arfrever Frehtes Taifersar Arahesis added the comment: Modules/_ctypes/libffi directory contains a copy of externally maintained libffi library. Please report problem to libffi maintainers: https://github.com/atgreen/libffi -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19998 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19995] hex() and %x, oct() and %o do not behave the same
Ethan Furman added the comment: Antoine Pitrou opined: -- I'm with Guido: it doesn't really make sense to allow __index__ but not __int__ on a type. So trying __index__ in str.format() sounds like a distraction. -- hex(3.14) # calls __index__ Traceback (most recent call last): File stdin, line 1, in module TypeError: 'float' object cannot be interpreted as an integer -- '%x' % 3.14 # calls __int__ '3' One of those behaviours is wrong. Which? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19995 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com