[issue30000] Inconsistency in the zlib module

2017-04-06 Thread Ellison Marks
Ellison Marks added the comment: I'm not sure I agree with that. The docs for compressobj just say "Returns a compression object, to be used for compressing data streams that won’t fit into memory at once." Which I don't think says much about the complexity aspect. Whether you're compressing

[issue30000] Inconsistency in the zlib module

2017-04-06 Thread Xiang Zhang
Xiang Zhang added the comment: Such a change in my mind is an enhancement and only could get into 3.7. IMHO zlib.compress() and zlib.decompress() are for simple usage, zlib.compressobj() and zlib.decompressobj() for advanced usage if you want more controls. Actually I would prefer simplifying

[issue30009] Integer conversion failure

2017-04-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: "%s" rounds float representation to 12 digits in Python 2.7. Replace "%s" with "%r" and you will get precise representation of floats. int(4.01)= 4 int(0.019574)= 0 int(0.03915) = 0 int(0.09787)

[issue30009] Integer conversion failure

2017-04-06 Thread Eryk Sun
Eryk Sun added the comment: Use %r instead of %s to show the repr. Hopefully that should clear things up for you. int() truncates toward 0. The float in this case is slightly less than 1. -- nosy: +eryksun resolution: -> not a bug stage: -> resolved status: open -> closed

[issue30009] Integer conversion failure

2017-04-06 Thread Tri Nguyen
New submission from Tri Nguyen: This code below shows a situation when Python int() library would return a value of int(1.0) -> 0.0 ---CODE CHANGES = [1.00, 0.50, 0.25, 0.10, 0.05, 0.01] # This code was originally to solve the least number of changes

[issue29996] Use terminal width by default in pprint

2017-04-06 Thread Xiang Zhang
Xiang Zhang added the comment: I use screens and usually like to open a terminal to fill the screen. One of my use case is changed by this patch from: 'manufacturers_specifications': '2U 2*Intel Xeon E5-2603 4核 8*8G ' 'DDR3-1333 ECC

[issue29353] Incorrect handling of HTTP response with "Content-Type: message/rfc822" header

2017-04-06 Thread Senthil Kumaran
Changes by Senthil Kumaran : -- nosy: +orsenthil ___ Python tracker ___ ___

[issue30000] Inconsistency in the zlib module

2017-04-06 Thread Ellison Marks
Ellison Marks added the comment: I made a try at a patch for this. My C is rudimentary at best, so I was hoping someone could look it over before I submitted a PR? https://github.com/gotyaoi/cpython/commit/2906fc9069ce6ec4888a547b5088ef9177a21c9a --

[issue30004] in regex-howto, improve example on grouping

2017-04-06 Thread Cristian Barbarosie
Cristian Barbarosie added the comment: Just discovered that a nearly identical example is presented in the end of section "Non-capturing and Named Groups". My proposal applies to this other example, too. And, by the way, reading this HOWTO has been very useful to me. --

[issue29955] logging decimal point should come from locale

2017-04-06 Thread Vinay Sajip
Vinay Sajip added the comment: > and provides no straightforward API for me to reconfigure its logger. As far as I know, you just need to do something which configures a Flask logger, then call logging.config.dictConfig() with a suitable configuration which doesn't disable existing loggers

[issue29996] Use terminal width by default in pprint

2017-04-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: Thus, you keep your default behavior of width=80, while I just add the following to my PYTHONSTARTUP file: from functools import partial from pprint import pprint, AUTOWIDTH pprint = partial(pprint, width=AUTOWIDTH) and we both get what we want. --

[issue29996] Use terminal width by default in pprint

2017-04-06 Thread Josh Rosenberg
Josh Rosenberg added the comment: If you want the dir listing output in a column, you're just relying on your listing to be wider than 80 characters, it still doesn't columnize unless you pass that point. Personally, I feel if I made the terminal wider, I'd like to actually use that width.

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-06 Thread Christoph Gohlke
Changes by Christoph Gohlke : -- nosy: +cgohlke ___ Python tracker ___ ___ Python-bugs-list

[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-04-06 Thread Brett Cannon
Brett Cannon added the comment: There's also what changes might occur in the coverage results when we start using fullcoverage: https://github.com/python/core-workflow/issues/18 -- ___ Python tracker

[issue29999] repr() of ImportError misses keyword arguments name and path

2017-04-06 Thread Brett Cannon
Brett Cannon added the comment: I consider it an enhancement, especially if someone was slopping with their tests and explicitly checks the repr of ImportError. -- type: -> enhancement ___ Python tracker

[issue29996] Use terminal width by default in pprint

2017-04-06 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I wouldn't go so far as to say it's never come up; it's something I've thought about a number of times, and I've waffled on it a few times. It's not fundamentally unreasonable to want it to adapt to the current terminal window, though I think it would be

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-06 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.r ___ Python tracker ___ ___

[issue29996] Use terminal width by default in pprint

2017-04-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: One other thought: This module has a very long history. It is widely used, has had many feature requests and bug reports, but this particular feature has never been requested. That should tell us something about whether there is an actual need. To me,

[issue29996] Use terminal width by default in pprint

2017-04-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: After more thought, put me down for -1 on this proposal. I use pprint() quite a bit when teaching Python courses. I expect that 100% of the time that users are following the live examples, I will get stopped and asked why their output is different from

[issue30001] CPython contribution docs reference missing /issuetracker page

2017-04-06 Thread Alex Jordan
Alex Jordan added the comment: Filed https://github.com/python/devguide/issues/156. Sorry for the noise! I just assumed everything went through bpo. Guess not :) -- ___ Python tracker

[issue30008] OpenSSL 1.1.0 deprecated functions

2017-04-06 Thread Mike Gilbert
New submission from Mike Gilbert: Some effort was made to port Python to OpenSSL 1.1.0 (see issue 26470). However, the code still uses several deprecated functions, and fails to compile against OpenSSL 1.1.0 if these functions are disabled. This may be replicated by building OpenSSL with

[issue29955] logging decimal point should come from locale

2017-04-06 Thread Skip Montanaro
Skip Montanaro added the comment: Vinay> I would like to close this issue now... Go for it. As I indicated in a previous comment, the exercise was as much to try and come to grips with the process as to actually make the change. There certainly appear to be good reasons to leave well enough

[issue29939] Compiler warning in _ctypes_test.c

2017-04-06 Thread Vinay Sajip
Vinay Sajip added the comment: Added relevant "needs backport" tags to PR, will get to it soon. Reopening till then. -- status: closed -> open ___ Python tracker

[issue29939] Compiler warning in _ctypes_test.c

2017-04-06 Thread STINNER Victor
STINNER Victor added the comment: IHMO it's worth it to backport the fix, since Benjamin showed that GCC optimizer removes the function body and so defeat the purpose of the test. -- nosy: +haypo ___ Python tracker

[issue29939] Compiler warning in _ctypes_test.c

2017-04-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks Vinay! -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue29939] Compiler warning in _ctypes_test.c

2017-04-06 Thread Vinay Sajip
Vinay Sajip added the comment: Should be fixed by 164d30e. -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue26789] Please do not log during shutdown

2017-04-06 Thread Vinay Sajip
Vinay Sajip added the comment: In the OP, the error is caused by `open` being unavailable, which is a builtin. According to what Serhiy says, this error would be after step 6 in his list, so `sys` wouldn't be available either, and nor perhaps would any other builtins. As some termination

[issue19225] lack of PyExc_BufferError doc

2017-04-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Sorry, but I just found that warning categories are enumerated near the documentation of PyErr_WarnEx(). I think that that enumeration is no longer needed and can be removed. -- ___ Python tracker

[issue19225] lack of PyExc_BufferError doc

2017-04-06 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 2cfe583ac8d3eaa98e3d2aca597577ce4787ca20 by Serhiy Storchaka (cocoatomo) in branch '3.5': [3.5] bpo-19225: Lack of c api exceptions doc (#965) https://github.com/python/cpython/commit/2cfe583ac8d3eaa98e3d2aca597577ce4787ca20 --

[issue29955] logging decimal point should come from locale

2017-04-06 Thread Vinay Sajip
Vinay Sajip added the comment: I would like to close this issue now, without making changes. Will do in one day, unless someone pipes up. -- resolution: -> not a bug status: open -> pending ___ Python tracker

[issue30007] report bug

2017-04-06 Thread Xiang Zhang
Xiang Zhang added the comment: This tracker is for CPython developing. Your problem is in the third party module. You could refer Google or stackoverflow. -- nosy: +xiang.zhang resolution: -> third party stage: -> resolved status: open -> closed

[issue30007] report bug

2017-04-06 Thread Yared Gebre
New submission from Yared Gebre: Hello, I am using python 3.6 could you look at this bug. Thanks. /home/yared/anaconda3/lib/python3.6/site-packages/mlimages/util/file_api.py in add_ext_name(cls, path, ext_name) 63 @classmethod 64 def add_ext_name(cls, path, ext_name):---> 65

[issue30006] Deadlocks in `concurrent.futures.ProcessPoolExecutor`

2017-04-06 Thread Thomas Moreau
New submission from Thomas Moreau: The design of ProcessPoolExecutor contains some possible race conditions that may freeze the interpreter due to deadlocks. This is notably the case with pickling and unpickling errors for a submitted job and returned results. This makes it hard to reuse a

[issue29533] urllib2 works slowly with proxy on windows

2017-04-06 Thread Marc Schlaich
Marc Schlaich added the comment: This could be even a security issue. People might rely on a proxy as a privacy feature. In this case the proxy should do forward/reverse DNS requests and not the client. Doing DNS lookups to check for proxy bypass doesn't seem right. I don't think that major

[issue29533] urllib2 works slowly with proxy on windows

2017-04-06 Thread Julia Dolgova
Julia Dolgova added the comment: Steve, do you mean that there should be no address to IE configuration from urllib? I could undertake it if I understand the task. gethostbyaddr() is ok. It just makes a reverse lookup, that some dns-servers work up too slow. The command "nslookup" also works

[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-04-06 Thread Nick Coghlan
Nick Coghlan added the comment: To be more specific regarding `sitecustomize.py`: $ echo "print('Hello from sitecustomize.py')" > Lib/sitecustomize.py $ ./python -c "print('Hello from command line')" Hello from sitecustomize.py Hello from command line Since we only need these

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-06 Thread Raphael Gaschignard
Raphael Gaschignard added the comment: the subprocess module has code to handle file objects that don't use file descriptors. It's not that file descriptors are necessary for the parameter, but that the way POpen is trying to detect "no file descriptor support" is through "fileno returns -1"

[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-04-06 Thread Nick Coghlan
Nick Coghlan added the comment: As a starting point, I'd suggest looking at what can be achieved without making any changes to CPython or its test suite: 1. Set COVERAGE_PROCESS_START in the environment where the tests are being run 2. Inject a sitecustomize.py file into Lib (and add

[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-04-06 Thread Jaysinh shukla
Jaysinh shukla added the comment: I found the regrtest wasn't displaying correct coverage for when the code is executed from call `Lib.test.support.script_helper.assert_python_ok`. I found `assert_python_ok` is using `subprocess` under the hood. It seems this problem is unobserved from a long

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-06 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, what do you mean by 'the raised exception is not handled properly'? Currently the exception is just propagated to the user to signal the argument seems to be wrong, right? -- nosy: +xiang.zhang ___ Python tracker

[issue30003] Remove hz codec

2017-04-06 Thread Ma Lin
Ma Lin added the comment: I tried to fix this two years ago, here is the patch (not merged): http://bugs.python.org/review/24117/diff/14803/Modules/cjkcodecs/_codecs_cn.c But later, I thought it's a good opportunity to remove this codec, this serious bug indicates that almost no one is using

[issue29990] Range checking in GB18030 decoder

2017-04-06 Thread Ma Lin
Ma Lin added the comment: This is a very trivial bug, it's hard to imagine a scene that someone trying to decode those 8630 illegal 4-byte sequences with GB18030 decoder. And I think this bug can't lead to security vulnerabilities. As far as I can see, GB2312/GBK/GB18030 codecs are bugfree

[issue30003] Remove hz codec

2017-04-06 Thread STINNER Victor
STINNER Victor added the comment: Can't we fix the bug instead of removing the whole codec? Or do you know other bugs? The bug is only on the encoder part, right? I see unit test for '~' on the hz decoder. -- ___ Python tracker

[issue29990] Range checking in GB18030 decoder

2017-04-06 Thread STINNER Victor
STINNER Victor added the comment: An incorrect implementation of a decoder might lead to security vulnerabilities: http://unicodebook.readthedocs.io/issues.html#security-vulnerabilities *But* UTF-8 decoder of Python 2 is *not* strict and nobody complained. I suggest that, once the changed is

[issue30005] Pickling and copying exceptions doesn't preserve non-__dict__ attributes

2017-04-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Pickling and copying ImportError doesn't preserve name and path ___ Python tracker

[issue30005] Pickling and copying exceptions doesn't preserve non-__dict__ attributes

2017-04-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Pickling and copying exceptions preserves only __dict__ attributes. This includes writeable internal fields initialized in constructor: >>> import pickle, copy >>> e = StopIteration(12) >>> e.value = 34 >>> e.value 34 >>> e2 = pickle.loads(pickle.dumps(e,