[issue28182] Expose OpenSSL verification results in SSLError

2016-09-19 Thread Christian Heimes
Christian Heimes added the comment: What do we do about ssl.CertificateError? It's not a subclass of SSLError and raised by match_hostname(). -- ___ Python tracker ___ _

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Manish Goregaokar
New submission from Manish Goregaokar: When the second argument of complex() is not a number/string, the type error reports the error but prints the type of the first argument: > complex({1:2},1j) Traceback (most recent call last): File "", line 1, in TypeError: complex() argu

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +mark.dickinson, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue20657] OpenBSD: Merge patches

2016-09-19 Thread Christian Heimes
Christian Heimes added the comment: Except for the locale patch, all remaining patches at http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/lang/python/3.5/patches/ look specific to BSD. -- nosy: +christian.heimes type: -> behavior versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.

[issue23503] undefined behavior in Objects/obmalloc.c

2016-09-19 Thread Christian Heimes
Changes by Christian Heimes : -- assignee: -> haypo nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Soumya Sharma
Soumya Sharma added the comment: Contains changes made to Objects/complexobject.c Changed the error message returned when second argument of complex() is not number/string Originally: >complex(1j,{1:2}) Traceback (most recent call last): File "", line 1, in TypeError: complex() arg

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread SilentGhost
Changes by SilentGhost : -- stage: -> patch review type: enhancement -> behavior versions: +Python 3.6 ___ Python tracker ___ ___ Pyt

[issue23503] undefined behavior in Objects/obmalloc.c

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: It seems that line numbers are for Python 3.5: #define PTA(x) ((poolp )((uchar *)&(usedpools[2*(x)]) - 2*sizeof(block *))) #define PT(x) PTA(x), PTA(x) static poolp usedpools[2 * ((NB_SMALL_SIZE_CLASSES + 7) / 8) * 8] = { PT(0), PT(1), PT(2), PT(3), PT(4

[issue23503] undefined behavior in Objects/obmalloc.c

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: > As a result, this initializer causes this file to be undefined. Hum, in practice I'm not aware of any crash on any platform. Python is tested on various compilers (GCC, Clang, ICC, Microsoft Visual Studio, etc.), various operating systems (Mac OS X, Linux, W

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Berker Peksag
Berker Peksag added the comment: Please upload your patch from a Mercurial clone: * https://docs.python.org/devguide/setup.html#checkout * https://docs.python.org/devguide/patch.html Currently, if you pass a string as a second argument, you get: >>> complex(1, "1") Traceback (most recent call

[issue28200] Windows: path_converter() leaks memory for Unicode filenames

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: Steve Dower added the comment: > It's not clear to me that Py_UNICODE is guaranteed to be wchar_t for all > time, that's all. If it is, go ahead. Right now, it's the case and path_converter() leaks memory, so I proposed a simple and obvious fix :-) On Windows,

[issue28200] Windows: path_converter() leaks memory for Unicode filenames

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > The :c:type:`Py_UNICODE` has been deprecated by :pep:`393` and will be > removed in Python 4. All functions using this type are deprecated: Right... I tried to deprecate and remove all functions using Py_UNICODE but it's har

[issue27948] f-strings: allow backslashes only in the string parts, not in the expression parts

2016-09-19 Thread flying sheep
Changes by flying sheep : -- nosy: +flying sheep ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-19 Thread Jack Liu
Jack Liu added the comment: I have a app loading python35.dll. Use python API PyImport_AddModule to run a py file. And use PyDict_DelItemString to delete the module. There is a global vailable in the py file. The global variable is not destroyed when calling PyDict_DelItemString to delete the

[issue28198] heap-buffer-overflow in tok_nextc (Parser/tokenizer.c:954)

2016-09-19 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report. This looks like a duplicate of issue 24022. -- nosy: +berker.peksag resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Python heap corruption issue ___ Python tr

[issue28200] Windows: path_converter() leaks memory for Unicode filenames

2016-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: path_converter.patch LGTM for 3.6 (and 3.7, 3.8), but we should find better solution for future versions. Could you please add a comment that PyUnicode_AsUnicodeAndSize is deprecated, but used because it is the simplest and the most efficient way for now? -

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-19 Thread Xiang Zhang
Changes by Xiang Zhang : -- nosy: +brett.cannon, eric.snow, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue27482] heap-buffer-overflow on address 0x6250000078ff

2016-09-19 Thread Berker Peksag
Berker Peksag added the comment: I think the problem described in msg270181 is now fixed in issue 24022. Adding Benjamin to nosy list for the other case. -- nosy: +benjamin.peterson, berker.peksag ___ Python tracker

[issue28204] very useful information

2016-09-19 Thread Xiang Zhang
Changes by Xiang Zhang : -- Removed message: http://bugs.python.org/msg276964 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue28204] very useful information

2016-09-19 Thread Xiang Zhang
Changes by Xiang Zhang : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue28200] Windows: path_converter() leaks memory for Unicode filenames

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > Could you please add a comment that PyUnicode_AsUnicodeAndSize is deprecated, > but used because it is the simplest and the most efficient way for now? See old issues #22271 and #22324. --

[issue28200] Windows: path_converter() leaks memory for Unicode filenames

2016-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6232e610e310 by Victor Stinner in branch '3.6': Fix memory leak in path_converter() https://hg.python.org/cpython/rev/6232e610e310 -- nosy: +python-dev ___ Python tracker

[issue28204] Spam

2016-09-19 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: -SH4Y4N title: very useful information -> Spam ___ Python tracker ___ ___ Python-bugs-list mailin

[issue28200] Windows: path_converter() leaks memory for Unicode filenames

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: > path_converter.patch LGTM for 3.6 (and 3.7, 3.8), Ok, I pushed my simple fix. Feel free to modify the code if you see a better way to encode paths on Windows ;-) But it's a much larger project, and I'm not really interested to jump again in this silly depre

[issue28195] test_huntrleaks_fd_leak fails on Windows

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: FYI there was a real memory leak and I just fixed it with the change 6232e610e310. -- resolution: -> fixed status: open -> closed ___ Python tracker _

[issue28195] test_huntrleaks_fd_leak fails on Windows

2016-09-19 Thread Berker Peksag
Berker Peksag added the comment: Thanks Victor! -- stage: needs patch -> resolved ___ Python tracker ___ ___ Python-bugs-list mailing

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Mark Dickinson
Mark Dickinson added the comment: @manishearth: Nice catch! Thanks for the report. @soummyaah: Thanks for the patch. Please could you sign a contributor agreement[1], so that we can commit the patch? As Berker says, tests would be good to have, too. [1] https://www.python.org/psf/contrib/cont

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steven D'Aprano
New submission from Steven D'Aprano: It is moderately common to want to join a sequence of substrings with a delimiter rather than a separator, e.g. when joining a sequence of lines into a single string, you usually want a trailing newline as well as newlines between the lines. E.g.: '\n'.joi

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Mark Dickinson
Mark Dickinson added the comment: This should be fixed in Python 3.5, too. -- versions: +Python 3.5 ___ Python tracker ___ ___ Python-

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Currently the most obvious way to do this is to use a temporary variable: Or more simply: lines = ''.join(substring + '\n' for substring in substrings) -- nosy: +mark.dickinson ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steve Holden
Steve Holden added the comment: If you are going to add such a keyword argument, wouldn't it make sense to maintain compatibility with print, and use end=terminator? -- nosy: +holdenweb ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm -1. The str interface is already overburdened. This is very special case and there are several ways to do this (Mark's one is the most obvious to me). -- nosy: +serhiy.storchaka ___ Python tracker

[issue1336] subprocess.Popen hangs when child writes to stderr

2016-09-19 Thread Torsten Landschoff
Torsten Landschoff added the comment: Just got bitten by this problem again. If anybody else still runs into this, the solution on python2.7 is to install the subprocess32 module from pypi.python.org and use that instead of subprocess. -- ___ Python

[issue20657] OpenBSD: Merge patches

2016-09-19 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue26868] Document PyModule_AddObject's behavior on error

2016-09-19 Thread Berker Peksag
Berker Peksag added the comment: Serhiy, do you have further comments about issue26868_v2.diff? -- versions: +Python 3.7 ___ Python tracker ___ __

[issue24416] Return a namedtuple from date.isocalendar()

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: C code should generally use structseq instead of collections.namedtuple. See the code for time.localtime() in Modules/timemodule.c. Also, in the docs use "named tuple" as two words and link to the glossary: https://docs.python.org/3/glossary.html#term-name

[issue28206] signal.Signals not documented

2016-09-19 Thread Samuel Colvin
New submission from Samuel Colvin: As per discussion on typeshed pull request discussion (https://github.com/python/typeshed/pull/555) the "signal.Signals" enum is not documented but should be. See https://docs.python.org/3.5/library/signal.html. -- assignee: docs@python components: D

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-19 Thread Eric Snow
Eric Snow added the comment: To make sure I'm understanding: * you are using PyDict_DelItemString() on sys.modules * a module-level variable in the module is not getting cleaned up when the module is deleted from sys.modules * this worked in Python 3.3 but not in 3.5 It may help to have a more

[issue23372] defaultdict.fromkeys should accept a callable factory

2016-09-19 Thread Gavin Panella
Gavin Panella added the comment: It's inconsistent that defaultdict([]) should be rejected: >>> defaultdict([]) Traceback (most recent call last): File "", line 1, in TypeError: first argument must be callable or None but defaultdict.fromkeys([]) is okay: >>> defaultdict.fromkeys(

[issue27761] Private _nth_root function loses accuracy

2016-09-19 Thread Mark Dickinson
Mark Dickinson added the comment: > Good enough for me ;-) Me too. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue28207] SQLite headers are not

2016-09-19 Thread Santiago Castro
New submission from Santiago Castro: When installing Python (for example, version 3.5.2), if SQLite library and headers are not installed in a default location (like $HOME/.local/include instead of /usr/include), it should take it from there, and not fail to find it. This behavior does work wi

[issue28207] SQLite headers are not searched in custom locations

2016-09-19 Thread Santiago Castro
Changes by Santiago Castro : -- title: SQLite headers are not -> SQLite headers are not searched in custom locations ___ Python tracker ___ _

[issue28208] update sqlite to 3.14.2

2016-09-19 Thread Big Stone
New submission from Big Stone: sqlite 3.14.2 released September 12th is said to correct 3 bugs. (https://www.sqlite.org/releaselog/3_14_2.html) I would suggest to upgrade from Sqlite 3.14.1 to sqlite 3.14.2 for beta2 -- messages: 276984 nosy: Big Stone, zach.ware priority: normal sever

[issue28208] update sqlite to 3.14.2

2016-09-19 Thread Ned Deily
Changes by Ned Deily : -- components: +Macintosh, Windows nosy: +ned.deily, paul.moore, ronaldoussoren, steve.dower, tim.golden priority: normal -> release blocker stage: -> needs patch versions: +Python 3.6, Python 3.7 ___ Python tracker

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm -1 also, mostly on the grounds that it's not (IME) a very common need and it does clutter up the API. -- nosy: +barry ___ Python tracker _

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread Xavion
Xavion added the comment: Wow, that is surprising (given how simple it is)! Did you try both tests? Remember that only the second one produces the bug here. Let's leave this sit for a while. If no-one else can reproduce it on their OSs/distributions, I'll seek advice from the Arch community

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread R. David Murray
R. David Murray added the comment: I only ran the second one. I didn't bother with the first one :) -- ___ Python tracker ___ ___ Pyt

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue28209] Exe or MSI unable to find Py3.5

2016-09-19 Thread jcrmatos
New submission from jcrmatos: Exe or MSI created by python setup.py bdist_wininst and python setup.py bdist_msi on a Py3.5 are unable to find Py3.5 installed. The build machine is not the same as the installation machine (destination). Tried changing Py3.5 installation on the destination from use

[issue28209] Exe or MSI unable to find Py3.5

2016-09-19 Thread Ned Deily
Changes by Ned Deily : -- nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: I'm unable to reproduce any memory leak on subprocess itself: --- import tracemalloc; tracemalloc.start() import subprocess, gc def func(loops) : for x in range(loops): proc = subprocess.Popen(['true']) with proc: proc.wait() # w

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: No memory leak if subprocess is spawned in a thread neither: --- import tracemalloc; tracemalloc.start() import subprocess, threading, time, gc def spawn(event) : subprocess.check_output("true") gc.collect(), gc.collect(), gc.collect() event.set() d

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: > lines = ''.join(substring + '\n' for substring in substrings) Huh. There were three of us looking at this at work yesterday, and none of us thought of that. -- ___ Python tracker

[issue28209] Exe or MSI unable to find Py3.5

2016-09-19 Thread Steve Dower
Steve Dower added the comment: Looks like we forgot to update PC/bdist_wininst/install.c for the "3.5-32" sys.winver format. Guessing it'll find a 64-bit install just fine. -- components: +Windows keywords: +3.5regression stage: -> test needed ___ P

[issue28205] Add optional suffix to str.join

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: > '\n'.join(['first', 'second', 'third']) Hum, the workaround is simple: lines = ['first', 'second', 'third'] lines.append('') assert '\n'.join(lines) == 'first\nsecond\nthird\n' -- nosy: +haypo ___ Python tracker

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread Xavion
Xavion added the comment: What about when you test it using the files I provided? I didn't want you guys to have to write your own code. Note that I was monitoring the memory externally (via good old 'ps'). This could make a difference to the outcome. -- ___

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-09-19 Thread George Slavin
George Slavin added the comment: I have a patch that checks for KeyboardInterrupt during builtin operations. This allows sum, max, min, list, dict, set, and tuple calls to be interrupted when they are working on infinite iterators. I've attached the patch, and a test I wrote to show that you

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-09-19 Thread George Slavin
George Slavin added the comment: I've attached the test for this patch (I couldn't figure out how to upload two files with one comment). -- Added file: http://bugs.python.org/file44747/test_sig_int_builtins.py ___ Python tracker

[issue23372] defaultdict.fromkeys should accept a callable factory

2016-09-19 Thread Vedran Čačić
Vedran Čačić added the comment: That's usual behavior for any class method. You can call them on an instance, but they don't have the access to it, only to its class. So transferring of factory would in fact not be possible. Of course,it's possible to make fromkeys an instance method, but plea

[issue6087] distutils.sysconfig.get_python_lib gives surprising result when used with a Python build

2016-09-19 Thread Kesara Rathnayake
Kesara Rathnayake added the comment: fix-6087.diff passes on OSX (Python 3.6) $ ./python.exe -m test test_distutils test_sysconfig -j3 Run tests in parallel using 3 child processes 0:00:01 [1/2] test_sysconfig passed 0:00:13 [2/2] test_distutils passed All 2 tests OK. Total duration: 14 sec Tes

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-19 Thread Jack Liu
Jack Liu added the comment: @eric.snow, Thank you for the replay. You understood right. I run this module as __main__ module, so there is no other modules to reference this module. And as I debugged, the ref count of this module became 0 after calling PyDict_DelItemString, but global variable

[issue23372] defaultdict.fromkeys should accept a callable factory

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Serhiy] I'm inclined to reject this proposition. It serves very special use case. [Silent Ghost] Correct me if I'm wrong but this seem as a very unlikely use case [Alec Nikolas Reiter] Implicitly assigning the factory is a pretty good compromise, like I sai

[issue28207] SQLite headers are not searched in custom locations

2016-09-19 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Version 3.5.2 works for me: sqlite: found /home/yen/usr/include/sqlite3.h /home/yen/usr/include/sqlite3.h: version 3.14.2 How did you compile CPython? Could you paste commands you use? -- nosy: +Chi Hsuan Yen ___ Pyt

[issue26351] Occasionally check for Ctrl-C in long-running operations like sum

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think this needs more discussion on python-dev before going down this path. In reality, we have many places that have "long running" C code when fed extreme arguments. In practice, we almost never have a problem with these except for cute toy bug reports

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Soumya Sharma
Soumya Sharma added the comment: I've signed the contributor agreement form. I think it said that it'll take a few days to process? I've made the changes requested and am currently working on the tests. Will submit a new patch file containing all required changes soon. --

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 for this API expansion. It would be better to have a separate method than to change the root notion of what join() is all about. -- nosy: +rhettinger ___ Python tracker ___

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg277004 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue28205] Add optional suffix to str.join

2016-09-19 Thread Raymond Hettinger
Raymond Hettinger added the comment: > There were three of us looking at this at work yesterday, > and none of us thought of that. How about adding an example to the docs and calling it a day. -- ___ Python tracker

[issue27482] heap-buffer-overflow on address 0x6250000078ff

2016-09-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: ASan is quiet on the POC now. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue28184] Trailing whitespace in C source code

2016-09-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset f604bc6bb526 by Benjamin Peterson in branch '3.6': merge 3.5 (#28184) https://hg.python.org/cpython/rev/f604bc6bb526 New changeset 647b37ab5fbc by Benjamin Peterson in branch 'default': merge 3.6 (closes #28184) https://hg.python.org/cpython/rev/647

[issue25478] Consider adding a normalize() method to collections.Counter()

2016-09-19 Thread Vedran Čačić
Vedran Čačić added the comment: Operator seems OK. After all, we can currently do c+c, which is kinda like c*2 (sequences behave this way generally, and it is a usual convention in mathematics too). And division by a number is just a multiplication by its reciprocal. But a dedicated normalize

[issue28165] The 'subprocess' module leaks memory when called in certain ways

2016-09-19 Thread STINNER Victor
STINNER Victor added the comment: If tracemalloc doesn't show any leak but the RSS memory increases, it can be memory fragmentation or memory alloctions not traced by tracemalloc. -- ___ Python tracker

[issue28165] The 'subprocess' module leaks 4 kiB memory for each thread

2016-09-19 Thread Antti Haapala
Antti Haapala added the comment: The title of the issue is still wrong. As I noted before the problem is not with subprocess leaking 4K memory *always*. The issue comes from the fact that subprocess seems to leak 4K memory per individual thread. The test code to use is thus def test():

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-19 Thread Jack Liu
Jack Liu added the comment: I wrote the test code as below. I also attached the files in attachment. Python = class Simple: def __init__( self ): print('Simple__init__') def __del__( self ): print('Simple__del__'

[issue28165] The 'subprocess' module leaks 4 kiB memory for each thread

2016-09-19 Thread Xavion
Xavion added the comment: haypo: So, what is the result when you run "Test-2.py" and monitor the memory usage with "Test.sh"? ztane: The code you've provided is the same as "Test-1.py". You need to run "Test-2.py" in order to see the bug! -- ___ P

[issue28203] complex() gives wrong error when the second argument has an invalid type

2016-09-19 Thread Mark Dickinson
Mark Dickinson added the comment: Thank you! I look forward to the new patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue28202] Python 3.5.1 C API, the global variable is not destroyed when delete the module

2016-09-19 Thread Jack Liu
Jack Liu added the comment: I know there is a workaround to set the global variables to None at last in Python scripts. But my app just provide a framework for my customers to run python scripts. That means the workaround requires my customers to update their python scripts. That may make them