[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__')

simple = None

def run():
global simple
simple = Simple()

if __name__ == '__main__':
run()
==

C++
=

#include "stdafx.h"
#include 
#include 
#include 
#include 
#include 
#include 

using namespace std;

namespace {
wstring readfile(const wchar_t *filename)
{
wifstream wifs;

wifs.open(filename);
//wifs.imbue(locale(wifs.getloc(), new codecvt_utf8()));
wstring wstr((std::istreambuf_iterator(wifs)),
std::istreambuf_iterator());
return wstr;
}

string wstrtostr(const wstring& ws)
{
std::wstring_convert converter;
return converter.to_bytes(ws);
}
}

int main()
{
cout << "Input py file full path:" << endl;
wstring filePath;
wcin >> filePath;
//filePath = L"L:\\Dev\\PyTest\\SimpleTest.py";

string moduleName = "__main__";

string script = wstrtostr(readfile(filePath.c_str()));
if (script.empty())
{
cout << "Invalid python file path" << endl;
return 1;
}

string sfileName = wstrtostr(filePath);

// Initialize the Python Interpreter
Py_Initialize();

PyObject *py_module = PyImport_AddModule(moduleName.c_str());
PyObject *py_dict = PyModule_GetDict(py_module);

PyObject* res = nullptr;
auto arena = PyArena_New();
if (arena)
{
auto mod = PyParser_ASTFromString(script.c_str(), 
sfileName.c_str(), Py_file_input, nullptr, arena);
if (mod)
{
auto co = PyAST_Compile(mod, sfileName.c_str(), 
nullptr, arena);
if (co)
{
res = PyEval_EvalCode((PyObject*)(co), py_dict, 
py_dict);
Py_DECREF(co);
}
}
PyArena_Free(arena);
}
if (res)
{
Py_DECREF(res);
}

// Delete the module from sys.modules
PyObject* modules = PyImport_GetModuleDict();
cout << "PyDict_DelItemString" << endl;
PyDict_DelItemString(modules, moduleName.c_str());

// May run many scripts here

// Finish the Python Interpreter
cout << "Py_Finalize" << endl;
Py_Finalize();

return 0;
}
===

The expected output in console should be:
Simple__init__
PyDict_DelItemString
Simple__del__
Py_Finalize

I tested with Python 3.2.5, 3.3.5, 3.5.1 and 3.6.0 beta.
It worked as expected with Python 3.2.5 and 3.3.5, but did not work Python 
3.5.1 and 3.6.0 beta.

On Python 3.5.1 and 3.6.0 beta, the output is:
Simple__init__
PyDict_DelItemString
Py_Finalize
Simple__del__
That means the Simple object is not released at PyDict_DelItemString, it's 
released at Py_Finalize.

So it it a regression bug since Python 3.5? I wish there is a solution to 
resolve memory leak issue.

--
Added file: http://bugs.python.org/file44748/PyTest.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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():
check_output("true")
threading.Timer(1, test, ()).start()

test()

which will invoke subprocess always in a new thread. Using subprocess in a 
loop, or using the timer as above without subprocess will not increase memory 
usage.

I have changed the title accordingly

--
title: The 'subprocess' module leaks memory when called in certain ways -> The 
'subprocess' module leaks 4 kiB memory for each thread

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 method? No. As Josh said, then you're 
forking the API.

The correct way is probably to have a "normalized view" of a Counter. But I 
don't know the best way to calculate it fast. I mean, I know it mathematically 
(cache the sum of values and update it on every Counter update) but I don't 
know whether it's Pythonic enough.

--
nosy: +veky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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/647b37ab5fbc

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.   To "fix" this, we would need to alter all 
possible long running data consumers or alter all possible long running data 
producers.  This kind of change is hard to test, gums up the code, and hinders 
future maintainability for near zero benefit to ordinary users.

min(range(1000))# There a lots of places like this

The proposed patch is indelicate about the addition of signal checking.  It 
check on every single iteration right in the middle of most highly optimizied, 
tightest, most speed critical loops in Python, making every use pay a cost for 
something almost no one will ever benefit from.

--
priority: normal -> low
versions: +Python 3.7 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 said 
fromkeys accepting the factory would be a nice convenience rather than 
correcting a major oversight.

-

After thinking about the above, I'm disinclined to make the API modification.

The current way to do it is straight-forward and reads nicely:

>>> d = defaultdict.fromkeys('abcdefg', somedefault)
>>> d.default_factory = somefunc

Combining those into a single step is less readable and may incorrectly imply 
some sort of interaction between the factory function and initial population of 
keys with a constant default value.   Likewise, the possibility of implicitly 
guessing and assigning the factory function is contraindicated by the 
zen-of-python in at least two places.

Given the paucity of use cases, the potential for API confusion, and the ready 
availability of reasonable alternatives, I'm closing the feature request.  
Thank for the suggestion though, it certainly seemed like something that 
deserved a little more thought.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 in this module was not 
released with Python 3.5.1. Is that memory leak? As I said, it worked on python 
3.3. Is it a regression in python 3.5.1? Any workaround to resolve this 
problem? It's an urgency issue to me.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Tests result: SUCCESS

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 please don't do that.

--
nosy: +veky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 can ctrl-c out of 
all the above calls.

This is my first attempt at a patch, so I would appreciate any feedback on what 
I need to fix to allow it to be submitted :)

--
keywords: +patch
nosy: +gslavin
Added file: http://bugs.python.org/file44746/KeyboardInterrupt.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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()

def func(loops):
event = threading.Event()
for x in range(loops):
event.clear()
timer = threading.Timer(0, spawn, (event,))
timer.start()
event.wait()

func(100)

gc.collect();gc.collect();gc.collect();gc.collect()
a = tracemalloc.get_traced_memory()[1]
print("first", a, "B")

loops = 1000
func(loops)

gc.collect();gc.collect();gc.collect();gc.collect()
b = tracemalloc.get_traced_memory()[1]
print("after", loops, "loops, mem:", b, "B")

d = (b-a) / loops
print("diff: %.1f B/loop" % d)

loops = 1000
func(loops)

gc.collect();gc.collect();gc.collect();gc.collect()
c = tracemalloc.get_traced_memory()[1]
print("after", loops, "loops, mem:", c, "B")

d = (c-b) / loops
print("diff2: %.1f B/loop" % d)
---

Output:
---
first 1013738 B
after 1000 loops, mem: 1014266 B
diff: 0.5 B/loop
after 1000 loops, mem: 1014318 B
diff2: 0.1 B/loop
---

Sorry, 0.5 byte/loop is not a memory leak :-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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()

# warmup
func(10)

gc.collect();gc.collect();gc.collect()
print(tracemalloc.get_traced_memory()[1])

func(100)

gc.collect();gc.collect();gc.collect()
print(tracemalloc.get_traced_memory()[1])

gc.collect();gc.collect();gc.collect()
print(tracemalloc.get_traced_memory()[1])

func(100)

gc.collect();gc.collect();gc.collect()
print(tracemalloc.get_traced_memory()[1])
---

Output on Fedora 24 (Linux) and Python 3.5:
---
996450
996450
996450
996450
---

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 user mode to all 
users, same result.

--
components: Distutils
messages: 276988
nosy: dstufft, eric.araujo, jcrmatos
priority: normal
severity: normal
status: open
title: Exe or MSI unable to find Py3.5
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
severity: normal
status: open
title: update sqlite to 3.14.2
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 with bz2 library and OpenSSL, but not with SQLite.

--
components: Extension Modules
messages: 276983
nosy: Santiago Castro
priority: normal
severity: normal
status: open
title: SQLite headers are not
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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([])
  defaultdict(None, {})

The constructor signature differs between defaultdict and dict, and 
defaultdict.fromkeys is an alternate constructor, so it seems reasonable to 
also change its signature.

Also confusing is that I can call fromkeys on an instance of defaultdict:

  >>> dd = defaultdict(list)
  >>> dd.fromkeys([1])
  defaultdict(None, {1: None})

Instinctively I expect the default_factory to be carried over, even though I 
realise that would be odd behaviour for Python. If defaultdict.fromkeys were to 
expect a mandatory default_factory argument there wouldn't be this moment of 
confusion.

--
nosy: +allenap

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 complete test case, perhaps uploaded to this issue 
with the multiple files zipped up.

Also, does 3.2 have the same behavior as 3.3 or 3.5?  What about 3.6 (currently 
in beta)?

Note that deleting the module from sys.modules only reduces the refcount by 
one.  Other objects may still hold a reference to the module or any of its 
variables.  So nothing in the module would be cleaned up until the refcount 
hits zero.  For example, if the module was imported in another module and that 
second module still has a variable bound to the imported module (or the 
not-destroyed variable) then you would not see your printed message.

The fact that the behavior is different between 3.3 and 3.5 is concerning 
though.  I'd expect 3.3 to behave like 3.5 is.  It could be that a change in 
Lib/importlib (or Python/import.c) since 3.3 is leaking module references, 
though it's unlikely.

--
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: Documentation
messages: 276979
nosy: Samuel Colvin, docs@python
priority: normal
severity: normal
status: open
title: signal.Signals not documented
versions: Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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-named-tuple

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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'.join(['first', 'second', 'third'])


returns 'first\nsecond\nthird' but we usually want a trailing newline as well, 
but only if the iterable being joined is not empty. If there are no substrings, 
we don't want to append the delimiter.

Currently the most obvious way to do this is to use a temporary variable:

lines = '\n'.join(substrings)
if lines:
lines += '\n'
process(lines)

I propose adding a keyword-only argument to str.join(), "suffix", to specify an 
optional trailing substring added only if the iterable is non-empty. To join 
lines as above, you would write:

process('\n'.join(substrings, suffix='\n'))

eliminating the unnecessary temporary variable.

Here's a proof of concept:

def join(iterable, sep, *, suffix=None):
s = sep.join(iterable)
if s and suffix is not None:
s += suffix
return s

--
messages: 276971
nosy: steven.daprano
priority: normal
severity: normal
status: open
title: Add optional suffix to str.join
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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/contrib-form/

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 deprecated APIs :-) It seems like the status quo is that 
Py_UNICODE is going to stay longer than expected and since it "just works", 
nobody really cares :-)

I close this issue since the initial bug (memory leak) is now fixed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28204] Spam

2016-09-19 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy:  -SH4Y4N
title: very useful information -> Spam

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 module. The global variable is destroyed 
when calling Py_Finalize. It's too late. That cause the memory leak. Because 
the Py_Initialize is called at the app startup, the Py_Finalize is called at 
the app shutdown. 

But it is ok with python33.dll, the global variable can be destroyed when 
calling PyDict_DelItemString to delete the module.

How to resolve the problem? Is there a workaround? I need to use python35.dll 
and wish the global variable in a module can be released automatically when 
call PyDict_DelItemString to delete the module.

Here is the python test code:

class Simple:  
 def __init__( self ):  
 print('Simple__init__')
 def __del__( self ):  
 print('Simple__del__') 

simple = Simple()

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 hard to change all this code. I gave up :-)

>   :c:func:`PyUnicode_AsUnicodeAndSize`: use 
> :c:func:`PyUnicode_AsWideCharString`

Sadly, it's not exactly the same: PyUnicode_AsWideCharString returns a
new fresh buffer at each call. I'm not sure that it caches the result
neither.

Victor

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, it makes sense to continue to use the UTF-16 encoded
string cached in Unicode objects, because this conversion is common,
and it's convenient to not have to release the memory explicitly. The
side effect is that we may waste memory in some cases.

> Otherwise the path_t object has the ability to clean up after itself, so 
> perhaps it should be used here?

Maybe, but I'm not interested to write a more complex patch for
Windows :-) Try to just call PyMem_Free(path->wide) (do nothing it's
NULL).

The advantage of the old code (and my patch) is to only convert a
filename once to UTF-16 and then use the cached result.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 last):
  File "", line 1, in 
TypeError: complex() second arg can't be a string

So the exception message should probably be changed to include "second arg" or 
"second argument":

>>> complex(1j, {1: 2})
Traceback (most recent call last):
  File "", line 1, in 
TypeError: complex() second arg must be a number, not 'dict'

Also, there is already a check for second argument in line 952 so the "must be 
a string" part is probably not needed. We probably need to check whether these 
two cases can be combined.

You also need to add some tests to Lib/test/test_complex.py.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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, Windows, FreeBSD, OpenBSD, Solaris, etc.), 
various architectures (x86, x86-64, PPC, etc.).

The memory allocator is probably the first instruction when starting Python.

Anyway, do you see a way to avoid the undefined behaviour?

Python has a _PyMem_SetupAllocators() function called very early in main() 
(before the first Python memory allocation), but calling this function is 
optional. So we have to prepare everything during the compilation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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), PT(5), PT(6), PT(7) < HERE

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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() argument must be a string or a number, not 'complex'

After patch:
>complex(1j,{1:2})
Traceback (most recent call last):
 File "", line 1, in 
TypeError: complex() argument must be a string or a number, not 'dict'

--
hgrepos: +356
keywords: +patch
nosy: +soummyaah
Added file: http://bugs.python.org/file44745/Issue28203.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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() argument must be a string or a number, not 'dict'
>complex(1j,{1:2})
Traceback (most recent call last):
 File "", line 1, in 
TypeError: complex() argument must be a string or a number, not 'complex'
>>> complex(1, {1:2})
Traceback (most recent call last):
  File "", line 1, in 
TypeError: complex() argument must be a string or a number, not 'int'

--
components: Library (Lib)
messages: 276952
nosy: Manish Goregaokar
priority: normal
severity: normal
status: open
title: complex() gives wrong error when the second argument has an invalid type
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 can't reproduce this with either python3.4.3 or 3.5 or 3.6 tip running it on 
gentoo linux.  For me it bumps up initially but then remains constant even if I 
let it run for many more probes than in your example.

I'm not sure what to suggest to you for further debugging this.  It is 
surprising that Arch would have a different behavior than Gentoo in this 
context.  If we are lucky maybe someone else will be able to reproduce it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2016-09-19 Thread Jack Liu

Changes by Jack Liu :


--
components: +Extension Modules -Library (Lib)
title: Python 3.5.1 C API, the global available available is not destroyed when 
delete the module -> Python 3.5.1 C API, the global variable is not destroyed 
when delete the module

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24022] Python heap corruption issue

2016-09-19 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ccfea26e6582 by Benjamin Peterson in branch '3.4':
properly handle the single null-byte file (closes #24022)
https://hg.python.org/cpython/rev/ccfea26e6582

New changeset c6438a3df7a4 by Benjamin Peterson in branch '2.7':
properly handle the single null-byte file (closes #24022)
https://hg.python.org/cpython/rev/c6438a3df7a4

New changeset d2f86d9c53b9 by Benjamin Peterson in branch '3.6':
merge 3.5 (#24022)
https://hg.python.org/cpython/rev/d2f86d9c53b9

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2016-09-19 Thread Christian Heimes

Christian Heimes added the comment:

In C programming common names for both ends are reader and writer. We could go 
with the pipes analogy and call the ends inlet and outlet.

--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18617] TLS and Intermediate Certificates

2016-09-19 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11664] Add patch method to unittest.TestCase

2016-09-19 Thread Christian Heimes

Changes by Christian Heimes :


--
versions: +Python 3.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com