[issue17076] shutil.copytree failing on xattr-less filesystems (like NFS)

2013-02-05 Thread Hynek Schlawack

Hynek Schlawack added the comment:

The buildbots look happy, thank you for spotting  the patch Thomas!

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17076
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17131] subprocess.Popen.terminate can raise exception on Posix

2013-02-05 Thread S Arrowsmith

New submission from S Arrowsmith:

Compare this with the script in #14252:

p = Popen(['/bin/sleep', '1'])
time.sleep(1)
p.terminate()
print p.poll()
p.terminate()

Output is:

0
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.6/subprocess.py, line 1269, in terminate
self.send_signal(signal.SIGTERM)
  File /usr/lib/python2.6/subprocess.py, line 1264, in send_signal
os.kill(self.pid, sig)
OSError: [Errno 3] No such process

The 0 return from poll() indicates that the subprocess ran to completion, 
rather than being terminated by the first terminate. So the first terminate 
does nothing, but the second terminate raises an exception. In 
http://bugs.python.org/issue14252#msg155396 :

Raising an exception on terminate is a bug.

--
components: Library (Lib)
messages: 181425
nosy: siona
priority: normal
severity: normal
status: open
title: subprocess.Popen.terminate can raise exception on Posix
type: behavior
versions: Python 2.6, Python 2.7, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17131
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13829] exception error in _scproxy.so

2013-02-05 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I've once again reviewed the _scproxy code and that code seems correct 
(although that doesn't say too much for subtle bugs because I wrote the initial 
version of the module).

Dan: is it possible to tell moviegrabber to use another python installation (in 
particular /Library/Frameworks/Python.framework)? If so, is the problem 
reproducable with the latest binaries on www.python.org?

The crash report says that the actual crash occurs inside a function called by 
SCDynamicStoreCopyProxies and I wouldn't know how Python's use of that function 
is wrong. 

The crash could still be caused by the way the moviegrabber application uses 
python, but I'd consider that a bug in moviegrabber unless there is a clear 
indication of a bug in python itself.

BTW. Is Moviegrabber this software? : 
http://sourceforge.net/projects/moviegrabber/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13829
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13829] exception error in _scproxy.so

2013-02-05 Thread Ronald Oussoren

Ronald Oussoren added the comment:

If it is the moviegrabber I linked to: that's a 100% python script using some 
other opensource libraries.

It does use multiprocessing, and that might mean this is the same problem as 
issue9405. That issue should be fixed in the repository (for a long time, the 
issue is not yet closed because I wanted to write a test case).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13829
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15730] Silence unused value warnings under Mac OS X 10.8/clang

2013-02-05 Thread Ronald Oussoren

Ronald Oussoren added the comment:

This is an alternate patch, it replaces the PyObject_INIT and PyObject_INIT_VAR 
macros by inline functions with macro wrappers for compatibility (the macros 
are used to suppress type warnings).

I don't particularly like my patch, but it might be a better way to ensure that 
the warning stays away and also fixes the warning in 3th-party code.

BTW. I wouldn't mind feedback of other core developers on either patch.

--
Added file: http://bugs.python.org/file28957/redefine-init-macros.txt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15730
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 'Mon Jan  1 -01:00:00 2011\n'

This is obviously wrong because trailing '\n' was not dropped.

The issue is not about what is more wrong. The issue is about Python crash. At 
least we should add a warning in the documentation that incorrect data may 
crash Python on some platforms.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

A new patch uses asctime_s() on Windows (this crash was observed only on 
Windows). This should prevent a crash. In additional it drops '\n' from a 
result even if the result is longer than usually (this happened on Linux when 
an invalid time is used).

Please run test_time on Windows.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file28958/asctime_s.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12983] byte string literals with invalid hex escape codes raise ValueError instead of SyntaxError

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12983
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-02-05 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


--
nosy: +christian.heimes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17128
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread STINNER Victor

STINNER Victor added the comment:

asctime_s.patch: you should catch ValueError on each call to
self.assertNotIn(). You can use PyString_FromStringAndSize() instead
of writing the NUL character, it may be safer (to not modify the
output of asctime).

2013/2/5 Serhiy Storchaka rep...@bugs.python.org:

 Changes by Serhiy Storchaka storch...@gmail.com:


 Added file: http://bugs.python.org/file28958/asctime_s.patch

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue16137
 ___

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-02-05 Thread Christian Heimes

Christian Heimes added the comment:

On Windows urllib.request.urlopen(http://www.google.com;, cadefault=True) 
fails with certificate verify failed. (tested with Python 3.3 64bit)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17128
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I missed existing test_tcl. Patches updated, now they add new tests into 
test_tcl.

--
Added file: http://bugs.python.org/file28959/tkinter_test_passing_values_2.patch
Added file: 
http://bugs.python.org/file28960/tkinter_test_passing_values-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___diff -r 7ccdbd1cd213 Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py  Tue Feb 05 08:25:24 2013 +0100
+++ b/Lib/test/test_tcl.py  Tue Feb 05 15:10:21 2013 +0200
@@ -151,6 +151,26 @@
 # exit code must be zero
 self.assertEqual(f.close(), None)
 
+def test_passing_values(self):
+def passValue(value):
+return self.interp.call('set', '_', value)
+
+self.assertEqual(passValue(True), True)
+self.assertEqual(passValue(False), False)
+self.assertEqual(passValue('string'), 'string')
+self.assertEqual(passValue('string\u20ac'), 'string\u20ac')
+for i in (0, 1, -1, 2**31-1, -2**31):
+self.assertEqual(passValue(i), i)
+for f in (0.0, 1.0, -1.0, 1/3,
+  sys.float_info.min, sys.float_info.max,
+  -sys.float_info.min, -sys.float_info.max):
+self.assertEqual(passValue(f), f)
+for f in float('nan'), float('inf'), -float('inf'):
+if f != f: # NaN
+self.assertNotEqual(passValue(f), f)
+else:
+self.assertEqual(passValue(f), f)
+self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,)))
 
 
 def test_main():
diff -r 7ccdbd1cd213 Lib/tkinter/test/test_tkinter/test_nogui.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/Lib/tkinter/test/test_tkinter/test_nogui.py   Tue Feb 05 15:10:21 
2013 +0200
@@ -0,0 +1,36 @@
+import unittest
+import sys
+import tkinter
+from test import support
+
+class NoguiTest(unittest.TestCase):
+
+def setUp(self):
+self.call = tkinter.Tcl().tk.call
+
+def test_passing_values(self):
+def passValue(value):
+return self.call('set', '_', value)
+#self.assertEqual(passValue(()), True)
+self.assertEqual(passValue(True), True)
+self.assertEqual(passValue(False), False)
+self.assertEqual(passValue('string'), 'string')
+self.assertEqual(passValue('string\u20ac'), 'string\u20ac')
+for i in (0, 1, -1, 2**31-1, -2**31):
+self.assertEqual(passValue(i), i)
+for f in (0.0, 1.0, -1.0, 1/3,
+  sys.float_info.min, sys.float_info.max,
+  -sys.float_info.min, -sys.float_info.max):
+self.assertEqual(passValue(f), f)
+for f in float('nan'), float('inf'), -float('inf'):
+if f != f: # NaN
+self.assertNotEqual(passValue(f), f)
+else:
+self.assertEqual(passValue(f), f)
+self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,)))
+
+
+tests_gui = (NoguiTest,)
+
+if __name__ == __main__:
+support.run_unittest(*tests_gui)
diff -r 20f0c5398e97 Lib/lib-tk/test/test_tkinter/test_nogui.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/Lib/lib-tk/test/test_tkinter/test_nogui.pyTue Feb 05 15:14:22 
2013 +0200
@@ -0,0 +1,37 @@
+import unittest
+import sys
+import Tkinter as tkinter
+import test.test_support as support
+
+class NoguiTest(unittest.TestCase):
+
+def setUp(self):
+self.call = tkinter.Tcl().tk.call
+
+def test_passing_values(self):
+def passValue(value):
+return self.call('set', '_', value)
+self.assertEqual(passValue(True), True)
+self.assertEqual(passValue(False), False)
+self.assertEqual(passValue('string'), 'string')
+self.assertEqual(passValue('string\u20ac'), 'string\u20ac')
+self.assertEqual(passValue(u'string'), u'string')
+self.assertEqual(passValue(u'string\u20ac'), u'string\u20ac')
+for i in (0, 1, -1, int(2**31-1), int(-2**31)):
+self.assertEqual(passValue(i), i)
+for f in (0.0, 1.0, -1.0, 1/3,
+  sys.float_info.min, sys.float_info.max,
+  -sys.float_info.min, -sys.float_info.max):
+self.assertEqual(passValue(f), f)
+for f in float('nan'), float('inf'), -float('inf'):
+if f != f: # NaN
+self.assertNotEqual(passValue(f), f)
+else:
+self.assertEqual(passValue(f), f)
+self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,)))
+
+
+tests_gui = (NoguiTest,)
+
+if __name__ == __main__:
+support.run_unittest(*tests_gui)
diff -r 20f0c5398e97 Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py  Mon Feb 04 10:29:38 2013 -0500
+++ b/Lib/test/test_tcl.py  Tue Feb 05 15:14:22 2013 +0200
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 
 import unittest
+import sys
 import os
 from 

[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28946/tkinter_test_passing_values.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file28946/tkinter_test_passing_values.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: 
http://bugs.python.org/file28947/tkinter_test_passing_values-2.7.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: 
http://bugs.python.org/file28959/tkinter_test_passing_values_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: 
http://bugs.python.org/file28960/tkinter_test_passing_values-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17128] OS X system openssl deprecated - installer should build local libssl

2013-02-05 Thread Ronald Oussoren

Ronald Oussoren added the comment:

It doesn't raise an exception on OSX (close to the tip of the default branch), 
both for http://www.google.com/ and https://www.google.com/

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17128
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17118] Add tests for testing Python-Tcl interaction

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file28961/tkinter_test_passing_values_2.patch
Added file: 
http://bugs.python.org/file28962/tkinter_test_passing_values-2.7_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17118
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6696] Profile objects should be documented

2013-02-05 Thread Tom Pinckney

Tom Pinckney added the comment:

Thanks for the feedback!

I'll incorporate it this weekend and make a new patch, though also feel free to 
just go ahead and make the changes yourself if you'd rather not wait for me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17043] Invalid read in test_codecs

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17043
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Senthil, Antoine, anyone, what you think about this patch?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16723
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16137] Using time.asctime() with an array with negative tm_hour causes Python Crash.

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for comments, Victor. Here is an updated patch.

--
Added file: http://bugs.python.org/file28963/asctime_s_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16137
___diff -r 20f0c5398e97 Lib/test/test_time.py
--- a/Lib/test/test_time.py Mon Feb 04 10:29:38 2013 -0500
+++ b/Lib/test/test_time.py Tue Feb 05 16:04:32 2013 +0200
@@ -128,10 +128,15 @@
 # self.assertRaises(ValueError, time.asctime,
 #  (12345, 1, 0, 0, 0, 0, 0, 0, 0))
 # XXX: For now, just make sure we don't have a crash:
-try:
-time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0))
-except ValueError:
-pass
+def check(tm):
+try:
+self.assertNotIn('\n', time.asctime(tm))
+except ValueError:
+pass
+check((12345, 1, 1, 0, 0, 0, 0, 1, 0))
+# Issue #16137
+check((2013, 2, 5, -1, 0, 0, 0, 0, 0))
+check((2013, 2, 5, 101, 0, 0, 0, 0, 0))
 
 @unittest.skipIf(not hasattr(time, tzset),
 time module has no attribute tzset)
diff -r 20f0c5398e97 Misc/NEWS
--- a/Misc/NEWS Mon Feb 04 10:29:38 2013 -0500
+++ b/Misc/NEWS Tue Feb 05 16:04:32 2013 +0200
@@ -199,6 +199,10 @@
 Library
 ---
 
+- Issue #16137: Fix a segmentation fault when time.asctime() called with an
+  illegal time (i.e. with a negative hour) on Windows.  On other platforms a
+  result of such call no more contains a trailing '\n'.
+
 - Issue #6083: Fix multiple segmentation faults occured when PyArg_ParseTuple
   parses nested mutating sequence.
 
diff -r 20f0c5398e97 Modules/timemodule.c
--- a/Modules/timemodule.c  Mon Feb 04 10:29:38 2013 -0500
+++ b/Modules/timemodule.c  Tue Feb 05 16:04:32 2013 +0200
@@ -563,7 +563,10 @@
 {
 PyObject *tup = NULL;
 struct tm buf;
-char *p;
+char *p, *q;
+#ifdef MS_WINDOWS
+char sbuf[100];
+#endif
 if (!PyArg_UnpackTuple(args, asctime, 0, 1, tup))
 return NULL;
 if (tup == NULL) {
@@ -571,14 +574,24 @@
 buf = *localtime(tt);
 } else if (!gettmarg(tup, buf))
 return NULL;
+#ifdef MS_WINDOWS
+if (asctime_s(sbuf, sizeof(sbuf) - 1, buf) != 0)
+p = NULL;
+else {
+p = sbuf;
+sbuf[sizeof(sbuf) - 1] = '\0';
+}
+#else
 p = asctime(buf);
+#endif
 if (p == NULL) {
 PyErr_SetString(PyExc_ValueError, invalid time);
 return NULL;
 }
-if (p[24] == '\n')
-p[24] = '\0';
-return PyString_FromString(p);
+q = strchr(p, '\n');
+if (q == NULL)
+q = strchr(p, '\0'); /* end of string */
+return PyString_FromStringAndSize(p, q - p);
 }
 
 PyDoc_STRVAR(asctime_doc,
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10557] Malformed error message from float()

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17132] yield_arg missing from symbol.sym_name

2013-02-05 Thread Josh Lee

New submission from Josh Lee:

 symbol.sym_name[337]
Traceback (most recent call last):
  File stdin, line 1, in module
KeyError: 337

It should be 'yield_arg'.

--
components: Library (Lib)
messages: 181440
nosy: Josh.Lee
priority: normal
severity: normal
status: open
title: yield_arg missing from symbol.sym_name
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17132
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14910] argparse: disable abbreviation

2013-02-05 Thread Ugra Dániel

Changes by Ugra Dániel daniel.u...@gmail.com:


--
nosy: +daniel.ugra

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14910
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17132] yield_arg missing from symbol.sym_name

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23850c3899e8 by Benjamin Peterson in branch '3.3':
update symbol.py for yield from grammar changes (closes #17132)
http://hg.python.org/cpython/rev/23850c3899e8

New changeset 0fcd975765a7 by Benjamin Peterson in branch 'default':
merge 3.3 (#17132)
http://hg.python.org/cpython/rev/0fcd975765a7

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17132
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17133] ssl.wrap_socket doesn't take server_hostname as a kwarg

2013-02-05 Thread Vinay Sajip

New submission from Vinay Sajip:

The wrap_socket function in ssl.py (unlike the method of the same name in 
SSLContext) doesn't accept a server_hostname argument, despite the fact that 
it's a one-liner calling SSLSocket, which does take that argument. It it like 
this for a reason, or just an oversight?

Unless there is some reason not to do so, I think a server_hostname kwarg 
should be added to the wrap_socket function.

--
messages: 181442
nosy: pitrou, vinay.sajip
priority: normal
severity: normal
status: open
title: ssl.wrap_socket doesn't take server_hostname as a kwarg
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17133
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16811] email.message.Message flatten dies of list index out of range

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4553dfcafac7 by R David Murray in branch '3.3':
News item for issue #16811 fix.
http://hg.python.org/cpython/rev/4553dfcafac7

New changeset 68be406e76e1 by R David Murray in branch 'default':
Merge: News item for issue #16811 fix.
http://hg.python.org/cpython/rev/68be406e76e1

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16811
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17129] Include CA bundle and provide access to system's CA

2013-02-05 Thread Christian Heimes

Christian Heimes added the comment:

Yes, it's a duplicate of #13665. Sorry, I didn't make a proper search. Although 
this is a new feature it's a fundament for cert validation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17129
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17134] Use Windows' certificate store for CA certs

2013-02-05 Thread Christian Heimes

New submission from Christian Heimes:

I found a recipe how to access the Windows certificate store and dump its 
content as PEM. The code doesn't look complicated and could be added to _ssl.c

http://fixunix.com/openssl/254866-re-can-openssl-use-windows-certificate-store.html

--
components: Extension Modules
messages: 181445
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: Use Windows' certificate store for CA certs
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17134] Use Windows' certificate store for CA certs

2013-02-05 Thread Christian Heimes

Changes by Christian Heimes li...@cheimes.de:


Added file: http://bugs.python.org/file28964/certstore.cpp

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17129] Include CA bundle and provide access to system's CA

2013-02-05 Thread Christian Heimes

Christian Heimes added the comment:

I found a recipe to retrieve CA certs from Window's cert store, see #17134.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17129
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3754] cross-compilation support for python build

2013-02-05 Thread Greg Hellings

Greg Hellings added the comment:

I'm trying to cross-compile the latest default out of Mercurial based on the 
status of this. Currently it fails with the following invocation:

$ ../configure --host=i686-w64-mingw32 --build=x86_64-redhat-linux-gnu 
--target=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/sys-root/mingw 
--exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw 
--bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin 
--sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin 
--sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc 
--datadir=/usr/i686-w64-mingw32/sys-root/mingw/share 
--includedir=/usr/i686-w64-mingw32/sys-root/mingw/include 
--libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib 
--libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec 
--localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var 
--sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com 
--mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man 
--infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info --enable-ipv6 
--enable-shared --with-computed-gotos=yes --with-dbmliborder=gdbm:ndbm:bdb 
--with-system-expat --with-system-ffi --with-pydebug --with-tsc
checking for hg... found
checking build system type... x86_64-redhat-linux-gnu
checking host system type... i686-w64-mingw32
checking for python interpreter for cross build... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... configure: error: cross build not supported for 
i686-w64-mingw32
error: Bad exit status from /var/tmp/rpm-tmp.sZjjCl (%build)

This is in a Fedora 18 environment using its included MinGW packages to do the 
cross compile. I have applied no patches and just did the hg clone this morning 
from the official repository. Are any of these attached patches still 
necessary? Is there any documentation about what the process is now for doing 
the cross-compile build?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3754
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17073] Integer overflow in sqlite module

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are tests for some bugs.

--
assignee:  - serhiy.storchaka
Added file: http://bugs.python.org/file28965/sqlite_int_overflow_tests.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17073
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3754] cross-compilation support for python build

2013-02-05 Thread Ray Donnelly

Ray Donnelly added the comment:

Yes, patches are still required.

Mainly Roumen's big patch [1] and then a load more too. Matthias Klose has 
merged a few cross compilation patches.

Here my project with patches for 3.3.0 and an emphasis on cross:
https://github.com/mingwandroid/crucifixion-freedom

...and here's mingwbuilds with the exact same patches (but likely tidier build 
scripts) without the cross focus:
https://github.com/niXman/mingw-builds/tree/master/patches/Python-3.3.0

Next time there's a release of Python 3, I'll rebase my patches against that.

[1] http://bugs.python.org/issue3871

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3754
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17135] imp doc should direct to importlib

2013-02-05 Thread Éric Araujo

New submission from Éric Araujo:

Title says it all.

--
assignee: docs@python
components: Documentation
messages: 181450
nosy: docs@python, eric.araujo
priority: normal
severity: normal
status: open
title: imp doc should direct to importlib
versions: Python 3.1, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17135
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16203] Proposal: add re.fullmatch() method

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I did not analyze the patch deeply, only left on Rietveld comments on first 
sight. Need to update the documentation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16203
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6696] Profile objects should be documented

2013-02-05 Thread Éric Araujo

Éric Araujo added the comment:

There is no rush, even if this doesn’t get into the docs distributed with the 
releases that are due next week-end, people will see it in the online docs a 
day after it’s committed.

--
assignee: docs@python - eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6696
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17133] ssl.wrap_socket doesn't take server_hostname as a kwarg

2013-02-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The reason is that wrap_socket() is there only for compatibility reasons, and 
I'd like people to switch to SSLContext instead. 12-argument functions are only 
good for LISPers ;-)

As for SSLSocket, its constructor isn't a public API.

--
resolution:  - wont fix
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17133
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17134] Use Windows' certificate store for CA certs

2013-02-05 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +pitrou

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17136] ctypes tests fail with clang on non-OS X

2013-02-05 Thread Dirkjan Ochtman

New submission from Dirkjan Ochtman:

I recently filed http://llvm.org/bugs/show_bug.cgi?id=15153, prompted by 
https://bugs.gentoo.org/show_bug.cgi?id=427338 (for 2.7, and 
https://bugs.gentoo.org/show_bug.cgi?id=427330 for 3.2), for which I found 
http://bugs.python.org/issue9852. Similar issues have subsequently been found 
in http://bugs.python.org/issue13370. The latter has been fixed in 
http://hg.python.org/cpython/rev/a425f2697273 (for 2.7 -- other branches were 
affected as well), but that fix is incorrectly scoped to just OS X.

It looks like clang is actually right here, and gcc is wrong; see their bug at 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942 (clang has a bug for this at 
http://llvm.org/bugs/show_bug.cgi?id=15153).

--
components: ctypes
messages: 181454
nosy: djc
priority: normal
severity: normal
status: open
title: ctypes tests fail with clang on non-OS X
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10557] Malformed error message from float()

2013-02-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Sure, this can be closed as far as I'm concerned.

--
status: pending - open

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10557] Malformed error message from float()

2013-02-05 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10557
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16948] email.mime.text.MIMEText: QP encoding broken with charset!=ISO-8859-1

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 801cb3918212 by R David Murray in branch '3.2':
#16948: Fix quopri encoding of non-latin1 character sets.
http://hg.python.org/cpython/rev/801cb3918212

New changeset e644058e8e7b by R David Murray in branch '3.3':
Merge: #16948: Fix quopri encoding of non-latin1 character sets.
http://hg.python.org/cpython/rev/e644058e8e7b

New changeset 009dc81e8bc9 by R David Murray in branch 'default':
Merge: #16948: Fix quopri encoding of non-latin1 character sets.
http://hg.python.org/cpython/rev/009dc81e8bc9

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16948
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3754] cross-compilation support for python build

2013-02-05 Thread Greg Hellings

Greg Hellings added the comment:

Bummer, the patches in that issue do not apply cleanly to either the 3.3.0 
released tarball nor to the 3.3 branch from hg.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3754
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16948] email.mime.text.MIMEText: QP encoding broken with charset!=ISO-8859-1

2013-02-05 Thread R. David Murray

R. David Murray added the comment:

Fixed.  I'm glad you caught this before the final release of 3.2.  This is a 
bit of an embarrassing bug :(.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16948
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17129] Include CA bundle and provide access to system's CA

2013-02-05 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Python SSL stack doesn't have a default CA Store

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17129
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17134] Use Windows' certificate store for CA certs

2013-02-05 Thread Éric Araujo

Éric Araujo added the comment:

Isn’t this part of #13655?  One feature is usually discussed for all platforms 
in one bug report.  (Sorry for all the bureaucracy in your recent reports, but 
it helps keep things manageable :)

--
nosy: +eric.araujo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13655] Python SSL stack doesn't have a default CA Store

2013-02-05 Thread Éric Araujo

Éric Araujo added the comment:

Copy of a message by Christian Heimes on a duplicate report:
  
For effective SSL server cert validation a bundle of trustworthy CA certs is 
required. Most system ship such a bundle but it's not always possible to access 
the bundle from Python / OpenSSL. Windows and Mac OS X come into my mind. wget 
and curl ship a copy of Mozilla's CA cert bundle.

The site http://curl.haxx.se/docs/caextract.html explains how to extract the CA 
certs in PEM format. I suggest that we ship the CA bundle with Python and use a 
lookup chain:

- user defined path to a cacert directory or cacert.pem file

- cacert directory or PEM file in the user's home directory: 
  cacertdir = os.path.join(site.USER_SITE, os.pardir, cacert)
  cacertfile = os.path.join(site.USER_SITE, os.pardir, cacert.pem)

- system's ca cert directory (/etc/ssl/certs on Linux)

- CA cert bundle shipped with the Python installation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13655
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17136] ctypes tests fail with clang on non-OS X

2013-02-05 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +meador.inge, ronaldoussoren

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14263] switch_index_if_fails fails on py2

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Should it be closed?

--
nosy: +serhiy.storchaka
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14263] switch_index_if_fails fails on py2

2013-02-05 Thread Éric Araujo

Éric Araujo added the comment:

Right, I probably kept this open for the packaging backport, so now it’s moot.

BTW, there are many distutils2 bugs that I haven’t closed, as they will still 
be useful for the successors of d2.

--
resolution:  - fixed
stage:  - committed/rejected
status: pending - closed
versions: +3rd party -Python 2.6, Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17134] Use Windows' certificate store for CA certs

2013-02-05 Thread Christian Heimes

Christian Heimes added the comment:

I like to split up tasks in small subtasks.

It's true that #13655 benefits from this feature but it can be implemented 
without this ticket. This enhancement also requires some addition to API and 
bindings to Windows' crypt32.dll. It might be inappropriate to add it to #13655 
because we need to backport #13655 to Python 2.6 to 3.3.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12177] re.match raises MemoryError

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue9669.

--
nosy: +serhiy.storchaka
resolution:  - duplicate
stage: needs patch - committed/rejected
status: open - closed
superseder:  - regexp: zero-width matches in MIN_UNTIL

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12177
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread Jan Lachnitt

New submission from Jan Lachnitt:

Python 3.3 64-bit seems to compile one of my files incorrectly. Specifically, 
os.path.isdir returns True for a nonexistent folder. The important point is 
that the code works correctly when it is performed step-by-step in pdb.

Python version:
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:57:17) [MSC v.1600 64 bit 
(AMD64)] on win32

OS:
Windows 8 64-bit

The code works fine in Python 3.2.3 32-bit on Windows XP.

My project is quite complex and it interacts with other software packages. I 
tried to make a reduced test-case but I could not reproduce the problem this 
way. What files do you need for processing this bug report? Will e.g. the 
source file in question and the corresponding compiled file (*.pyc) be enough? 
Or should I upload the whole project here, along with the instructions on how 
to run it?

--
messages: 181465
nosy: pepalogik
priority: normal
severity: normal
status: open
title: Malfunctioning compiled code in Python 3.3 x64
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15359] Sockets support for CAN_BCM

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f714af60508d by Charles-François Natali in branch 'default':
Issue #15359: Add CAN_BCM protocol support to the socket module. Patch by Brian
http://hg.python.org/cpython/rev/f714af60508d

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15359
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17134] Use Windows' certificate store for CA certs

2013-02-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Sounds promising. Do you think this should be hooked into 
SSLContext.set_default_verify_paths, or be exposed as a separate method?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17134
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16203] Proposal: add re.fullmatch() method

2013-02-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch doesn't seem to include failure cases for fullmatch (i.e. cases where 
fullmatch returns None where match or search would return a match).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16203
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general it looks good to me. But we can get rid of Python file and use only 
os.open/os.write/os.close. Here is an updated patch which carefully close a 
file descriptor and remove a file even if write or close failed.

Amir Szekely, can you please submit a contributor form?

http://python.org/psf/contrib/contrib-form/
http://python.org/psf/contrib/

--
nosy: +georg.brandl, ncoghlan, serhiy.storchaka
Added file: 
http://bugs.python.org/file28966/fix_tempfile_leaving_files_behind_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16800
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In general it looks good to me. But we can get rid of Python file and use only 
os.open/os.write/os.close. Here is an updated patch which carefully close a 
file descriptor and remove a file even if write or close failed.

Amir Szekely, can you please submit a contributor form?

http://python.org/psf/contrib/contrib-form/
http://python.org/psf/contrib/

--
Added file: 
http://bugs.python.org/file28967/fix_tempfile_leaving_files_behind_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16800
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
Removed message: http://bugs.python.org/msg181470

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16800
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: 
http://bugs.python.org/file28967/fix_tempfile_leaving_files_behind_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16800
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16800] tempfile._get_default_tempdir() leaves files behind when HD is full

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And here are patches for 2.7 and 3.2 (there are some peculiarities, i.e. in 
exception handling).

--
Added file: 
http://bugs.python.org/file28968/fix_tempfile_leaving_files_behind_2-2.7.patch
Added file: 
http://bugs.python.org/file28969/fix_tempfile_leaving_files_behind_2-3.2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16800
___diff -r 20f0c5398e97 Lib/tempfile.py
--- a/Lib/tempfile.py   Mon Feb 04 10:29:38 2013 -0500
+++ b/Lib/tempfile.py   Tue Feb 05 20:57:18 2013 +0200
@@ -193,14 +193,16 @@
 name = namer.next()
 filename = _os.path.join(dir, name)
 try:
-fd = _os.open(filename, flags, 0600)
-fp = _os.fdopen(fd, 'w')
-fp.write('blat')
-fp.close()
-_os.unlink(filename)
-del fp, fd
+fd = _os.open(filename, flags, 0o600)
+try:
+try:
+_os.write(fd, b'blat')
+finally:
+_os.close(fd)
+finally:
+_os.unlink(filename)
 return dir
-except (OSError, IOError), e:
+except (OSError, IOError) as e:
 if e[0] != _errno.EEXIST:
 break # no point trying more names in this directory
 pass
diff -r 20f0c5398e97 Lib/test/test_support.py
--- a/Lib/test/test_support.py  Mon Feb 04 10:29:38 2013 -0500
+++ b/Lib/test/test_support.py  Tue Feb 05 20:57:18 2013 +0200
@@ -1298,6 +1298,33 @@
 except:
 break
 
+@contextlib.contextmanager
+def swap_attr(obj, attr, new_val):
+Temporary swap out an attribute with a new object.
+
+Usage:
+with swap_attr(obj, attr, 5):
+...
+
+This will set obj.attr to 5 for the duration of the with: block,
+restoring the old value at the end of the block. If `attr` doesn't
+exist on `obj`, it will be created and then deleted at the end of the
+block.
+
+if hasattr(obj, attr):
+real_val = getattr(obj, attr)
+setattr(obj, attr, new_val)
+try:
+yield
+finally:
+setattr(obj, attr, real_val)
+else:
+setattr(obj, attr, new_val)
+try:
+yield
+finally:
+delattr(obj, attr)
+
 def py3k_bytes(b):
 Emulate the py3k bytes() constructor.
 
diff -r 20f0c5398e97 Lib/test/test_tempfile.py
--- a/Lib/test/test_tempfile.py Mon Feb 04 10:29:38 2013 -0500
+++ b/Lib/test/test_tempfile.py Tue Feb 05 20:57:18 2013 +0200
@@ -1,7 +1,9 @@
 # tempfile.py unit tests.
 import tempfile
+import errno
 import os
 import signal
+import shutil
 import sys
 import re
 import warnings
@@ -202,8 +204,45 @@
 
 test_classes.append(test__candidate_tempdir_list)
 
+# We test _get_default_tempdir some more by testing gettempdir.
 
-# We test _get_default_tempdir by testing gettempdir.
+class TestGetDefaultTempdir(TC):
+Test _get_default_tempdir().
+
+def test_no_files_left_behind(self):
+# use a private empty directory
+our_temp_directory = tempfile.mkdtemp()
+try:
+# force _get_default_tempdir() to consider our empty directory
+def our_candidate_list():
+return [our_temp_directory]
+
+with test_support.swap_attr(tempfile, _candidate_tempdir_list,
+our_candidate_list):
+# verify our directory is empty after _get_default_tempdir()
+tempfile._get_default_tempdir()
+self.assertEqual(os.listdir(our_temp_directory), [])
+
+def raise_OSError(*args, **kwargs):
+raise OSError(-1)
+
+with test_support.swap_attr(os, open, raise_OSError):
+# test again with failing os.open()
+with self.assertRaises(IOError) as cm:
+tempfile._get_default_tempdir()
+self.assertEqual(cm.exception.errno, errno.ENOENT)
+self.assertEqual(os.listdir(our_temp_directory), [])
+
+with test_support.swap_attr(os, write, raise_OSError):
+# test again with failing os.write()
+with self.assertRaises(IOError) as cm:
+tempfile._get_default_tempdir()
+self.assertEqual(cm.exception.errno, errno.ENOENT)
+self.assertEqual(os.listdir(our_temp_directory), [])
+finally:
+shutil.rmtree(our_temp_directory)
+
+test_classes.append(TestGetDefaultTempdir)
 
 
 class test__get_candidate_names(TC):
diff -r 801cb3918212 Lib/tempfile.py
--- a/Lib/tempfile.py   Tue Feb 05 10:49:49 2013 -0500
+++ b/Lib/tempfile.py   Tue Feb 

[issue15359] Sockets support for CAN_BCM

2013-02-05 Thread Charles-François Natali

Charles-François Natali added the comment:

Committed.
Brian, thanks for the patch!

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15359
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17138] XPath error in xml.etree.ElementTree

2013-02-05 Thread Gutzwiller

New submission from Gutzwiller:

$ python3
Python 3.3.0 (default, Jan 25 2013, 09:38:18) 
[GCC 4.4.5] on linux
Type help, copyright, credits or license for more information.
 import xml.etree.ElementTree as ET
 xml = ET.fromstring(rooth11/h1ph12/h1/p/root)
 result = xml.find(.//h1[2])
 print(result)
None


Expected result : Element 'h1' at ...  (h12/h1)

--
components: XML
messages: 181473
nosy: Antoine2008
priority: normal
severity: normal
status: open
title: XPath error in xml.etree.ElementTree
type: behavior
versions: Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17138
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16723] io.TextIOWrapper on urllib.request.urlopen terminates prematurely

2013-02-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This looks ok to me. I am slightly surprised that isclosed() isn't documented 
anywhere (but perhaps it's better).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16723
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2840] Expat parser locks XML source file if ContentHandler raises an exception

2013-02-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue15388. Parser doesn't close an input source's 
stream if an exception raised.

--
nosy: +serhiy.storchaka
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - SAX parse (ExpatParser) leaks file handle when given filename 
input

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2840
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17122] Fix and cleanup test_functools

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2a369c32f1f1 by Serhiy Storchaka in branch 'default':
Issue #17122: Fix and cleanup test_functools.py.
http://hg.python.org/cpython/rev/2a369c32f1f1

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17122
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17107] test_sni in test_urllib2net could be enabled

2013-02-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f74a12e23aaa by Antoine Pitrou in branch 'default':
Issue #17107: Test client-side SNI support in urllib.request thanks to the new 
server-side SNI support in the ssl module.
http://hg.python.org/cpython/rev/f74a12e23aaa

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17107
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17107] test_sni in test_urllib2net could be enabled

2013-02-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, I've tweaked the patch a bit and committed it. Thank you!

--
resolution:  - fixed
stage: needs patch - committed/rejected
status: open - closed
versions:  -Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17107
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16038] ftplib: unlimited readline() from connection

2013-02-05 Thread Michał Jastrzębski

Michał Jastrzębski added the comment:

Hello,

I've made patch which address this issue.

--
keywords: +patch
nosy: +inc0
Added file: http://bugs.python.org/file28970/ftplib_maxline.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16038
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17135] imp doc should direct to importlib

2013-02-05 Thread Eric Snow

Eric Snow added the comment:

Agreed.  It should also link to the new import section in the language 
reference rather than to the import statement.

--
nosy: +eric.snow

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17135
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread Mark Dickinson

Mark Dickinson added the comment:

Reminds me of this question on StackOverflow:

http://stackoverflow.com/questions/14135846/string-concatenation-with-python-33-isdir-always-returns-true-3-hours-head

--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread Georg Brandl

Georg Brandl added the comment:

The SO post is scary.  Maybe a non-normalized (smallest representation) PEP393 
string is escaping into the wild?

--
nosy: +georg.brandl

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
nosy: +loewis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17136] ctypes tests fail with clang on non-OS X

2013-02-05 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

The changes in CPython mentioned by you are in bundled copy of libffi for OS X 
(Modules/_ctypes/libffi_osx).
You probably should report the problem to libffi upstream.
Gentoo ebuilds of CPython use --with-system-ffi option, so any fixes in bundled 
copy of libffi (Modules/_ctypes/libffi) would not help in Gentoo.

--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
keywords: +3.3regression
nosy: +flox, haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
priority: normal - high

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread STINNER Victor

STINNER Victor added the comment:

 I believe the datetime.now() should always return the same format.

It's now how it was implemented:
http://docs.python.org/dev/library/datetime.html#datetime.datetime.__str__
and
http://docs.python.org/dev/library/datetime.html#datetime.datetime.isoformat

--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread Dave

New submission from Dave:

Calling datetime.datetime.now() will return only the Date and time to the 
second w/o the decimal portion when the second increments when also running 
firefox w/shockwave flash enabled on a windows 7 machine.

  
Example output: 
counter1 is: 23360 time is: 2013-02-05 16:32:24.999000  
counter1 is: 23361 time is: 2013-02-05 16:32:25
counter1 is: 23362 time is: 2013-02-05 16:32:25.002000
Notice the missing decimal value on the middle one.

To reproduce:
Code:
counter = 0
while(True):
counter +=1
time = datetime.datetime.now()
numericDateTime = 
print(counter1 is:  + str(counter) +  time is:  + time)

I can get this to occur every time that firefox is running with Shockwave flash 
enabled.
datetime.now() works fine w/o firefox running w/shockwave flash enabled.

I believe the datetime.now() should always return the same format.

--
components: Windows
messages: 181484
nosy: Dave
priority: normal
severity: normal
status: open
title: dateTime.now() return format missing decimal seconds.
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread Mark Dickinson

Mark Dickinson added the comment:

See also issue #1074462

--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17138] XPath error in xml.etree.ElementTree

2013-02-05 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +eli.bendersky, flox

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17138
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
components: +Unicode, Windows
nosy: +ezio.melotti
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread Mark Dickinson

Mark Dickinson added the comment:

This is a feature request rather than a bug report;  changing fields 
accordingly.

Also, given the discussion leading to the rejection of issue 1074462, and the 
fact that you can now use %f in strftime as an easy way to get consistent 
output (issue 1158), I'm closing this as rejected.

 d = datetime.datetime(2013, 10, 11, 12, 34, 56, 0)
 d.strftime(%Y-%m-%d %H:%M:%S.%f)
'2013-10-11 12:34:56.00'

--
resolution:  - rejected
status: open - closed
type: behavior - enhancement
versions: +Python 3.4 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17137] Malfunctioning compiled code in Python 3.3 x64

2013-02-05 Thread STINNER Victor

STINNER Victor added the comment:

On Windows, os.path.isdir calls nt._isdir(). Core of this C function:

wchar_t *wpath = PyUnicode_AsUnicode(po);
if (wpath == NULL)
return NULL;

attributes = GetFileAttributesW(wpath);
if (attributes == INVALID_FILE_ATTRIBUTES)
Py_RETURN_FALSE;
...

Can you please try to call directly nt._isdir()? Can also also compare with 
stat.S_ISDIR(os.stat(fn).st_mode)?

If the problem is something with the implementation of Unicode, it would be 
interesting to try to get the content of the string using:

 * print(ascii(path.encode(unicode_internal))) # should be result of 
PyUnicode_AsUnicode() which is cached
 * print(ascii(path.encode(utf-8)))

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17137
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13655] Python SSL stack doesn't have a default CA Store

2013-02-05 Thread Ian Cordasco

Ian Cordasco added the comment:

Éric's suggestion is also implemented in python-requests if I remember 
correctly. It allows for user-specified PEM files and tries to find the 
operating system bundle. This would be a wonderful inclusion in the standard 
library.

--
nosy: +icordasc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13655
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread Dave

Dave added the comment:

Point was/is that I'd be willing to fix this so that others don't have to.  
It's for OTHERS SAKE that I submitted this issue as my system is already bullet 
proof from this defect/lack of feature situation.  This is also my first 
attempt to get involved with the freeware community.

Thanks,
Dave

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread Dave

Dave added the comment:

I appreciate you guys looking into this so quickly, but let's dig a little 
deeper.

1. STINNER Victor, you claim this is already fixed in 3.4 by the link, however 
this doesn't really help since I'm not even up to 3.3 yet (though I'm 
considering it, I meant to select 3.2 above).  No one has yet provided any 
insight into why this condition only occurs when firefox is up running 
shockwave flash...(to me this is an even bigger question as I have a 7 other 
rather under tasked cores at my disposal).

2.  Mark Dickinson, let's break this down.  I've already worked around it as 
I’m sure that EVERYONE ELSE WHO USES IT has already done as well...  We know as 
coders it's more difficult to work with a varying format (no advantage there).  
Which begs the question why not fix it so everyone doesn't have to?  By the 
issue you referenced it's been known and unfixed since at least since 2004.  
Also, no curiosity why this only occurs when running firefox w/shockwave flash?

Again I do appreciate you guys looking into this so quickly, but I don't know 
if this is actually going to get fixed, why it wasn't fixed in 2004, or is the 
Python motto it's not broke if there exists a workaround.  Odd that more time 
was spent talking about this (and Mark and myself independently implemented 
actual fixes) than the fix would have taken to apply to the baseline(I used to 
see this much other places I've worked).  But I'm happy to say, I never saw 
responses back so quickly, which is very hopeful.

Sincerely,
Dave

--
versions: +Python 3.2 -Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16991] Add OrderedDict written in C

2013-02-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Added file: http://bugs.python.org/file28971/cleanup-test-collections.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16991
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16991] Add OrderedDict written in C

2013-02-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Added file: http://bugs.python.org/file28972/odict.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16991
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread R. David Murray

R. David Murray added the comment:

I think Victor meant not instead of now.

It doesn't only occur when your run particular programs, it occurs whenever the 
microseconds are zero.  It is possible that your particular combination of 
programs produces a timing pattern that means you see microseconds zero more 
often in your tests.

Keep in mind that the str is a *convenience* representation.  As such it is 
*much* more convenient to not print the zero microseconds in the very common 
case of constructed datetimes that have zero microseconds.

If you want to strictly control the representation you want to use specific 
formatting, which you can do.  

Thus the rejection.

--
nosy: +r.david.murray

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16991] Add OrderedDict written in C

2013-02-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Removed file: http://bugs.python.org/file28971/cleanup-test-collections.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16991
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16991] Add OrderedDict written in C

2013-02-05 Thread Eric Snow

Changes by Eric Snow ericsnowcurren...@gmail.com:


Removed file: http://bugs.python.org/file28972/odict.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16991
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16991] Add OrderedDict written in C

2013-02-05 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +flox

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16991
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread Dave

Dave added the comment:

Thanks David Murry for clearing up STINNER Victor comments.  I already feel 
like I work here;)  So it's not broke if there exists a workaround.  

In that case it's time to update the documents (which often takes longer than 
the code to update) to reflect this inconsistency so others won't run into this 
like I did (it took time to trouble shoot this as it was occurring prior to my 
logging being set up).  It then took time to trap until I started web browsing:)

State clearly in the API that the output format is either:
2013-02-05 16:32:24.999000 or  
2013-02-05 16:32:25
depending on the time returned.


I would also suggest deprecating the now(), __str__ and any method that 
exhibits this inconsistent multi-format output behavior since everyone after 
reading the updated comments will switch to another method immediately for 
simpler/more robust code. 

David Murry, said Keep in mind that the str is a *convenience* representation. 
 As such it is *much* more convenient to not print the zero microseconds in the 
very common case of constructed datetimes that have zero microseconds.  
Interesting since currently datetime does print the zeros microseconds in my 
example: 2013-02-05 16:32:24.999000 (notice the last 3 zeros are microseconds 
returned/printed by datetime.now()).  Apparently this is inconvenient by your 
standards was well.  

I'm moving the status back to open for the documentation update and we'll see 
how anyone feels about the deprecation.

All these little efforts have added up to something great Python and I hope 
these discussion will help further that cause.  I appreciate everyone who has 
participated.

Thanks,
Dave

--
resolution: rejected - 
status: closed - open
type: enhancement - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17139] dateTime.now() return format missing decimal seconds.

2013-02-05 Thread R. David Murray

R. David Murray added the comment:

No, it is not it's not broke because there's a workaround, it is not broken 
because it is *working as designed*.

The str of any object in python is intended to be a convenient representation 
of that object.  Note that this applies to *all* objects in Python, not just 
datetime.  (Thus, talking about deprecating __str__ doesn't make any sense.)

The most convenient representation of a datetime has been deemed to be 
-mm-dd hh:mm:ss if there microseconds is equal to zero, and yyy-mm-dd 
hh:mm:ss.MM if microseconds is not equal to zero, and in practice this has, 
in general, worked out very well.  It is too bad that Python can't read the 
programmer's mind and know whether or not zero microseconds are important in a 
given str call, but sadly it can't, so the above algorithm is the most 
convenient for the typical uses of str on a datetime.

Now, if you are writing an application and you are doing output that needs to 
be in a particular format, you should *format your output* to be the way you 
want it.  This applies to any data, not just datetimes.  It means using a 
format specification, to which the str of an object might or might not be an 
input.  In the case of datetime, you don't want to use its str as the input to 
the format, because that can loose information, as you have discovered.  
Instead you want to specify an strftime format string that causes the data to 
be displayed *exactly as you want it to be*:

 counter1 = 23360
 x = datetime.datetime(2013, 2, 5, 20, 45)
 x
datetime.datetime(2013, 2, 5, 20, 45)
 str(x)
'2013-02-05 20:45:00'
 counter1 is: {:6d} time is: {:%Y-%m-%d %H:%M:%S.%f}.format(counter1, 
x)
'counter 1 is:  23360 time is: 2013-02-05 20:45:00.00'

str is a generic function that is a convenience.  A format specification is, 
well, *specific* to a particular application.  Note how it is necessary to also 
use a format for the counter in order to obtain output records with consistent 
spacing.

Now, as far as documentation goes, __str__ references isoformat, and isoformat 
says:

datetime.isoformat(sep='T')

Return a string representing the date and time in ISO 8601 format,
-MM-DDTHH:MM:SS.mm or, if microsecond is 0,
-MM-DDTHH:MM:SS

It is hard to see how the documentation can get clearer than that.  

(As an aside, I *can* see the argument, as was made in the other issue, that 
the isoformat method should provide a way to control the micorseconds display.  
That would be a feature request, but given the history of this issue you should 
probably raise it on the python-ideas mailing list first in order to get buy-in 
before opening a new request for enhancement for it.  Not optimal, I know, but 
sometimes you have to deal with history when suggesting/requesting a change in 
a project.

Also note that datetime.now() does not have *any* format.  It is a datetime 
object.  Only when turning it in to a string by some method does formatting 
come in to play.

I want to thank you for your enthusiasm for making things better.  I hope that 
my more detailed explanation will help you understand the reasoning behind the 
design decisions that have been made here.

--
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17139
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17140] Provide a more obvious public ThreadPool API

2013-02-05 Thread Nick Coghlan

New submission from Nick Coghlan:

The multiprocessing module currently provides the 
multiprocessing.dummy.ThreadPool API that exposes the same API as the public 
multiprocessing.Pool, but is implemented with threads rather than processes. 
(This is sort of documented - it's existence is implied by the documentation of 
multiprocessing.dummy, but it doesn't spell out hey, stdlib ThreadPool 
implementation!.

Given that this feature is likely useful to many people for parallelising IO 
bound tasks without migrating to the concurrent.futures API (or where that API 
doesn't quite fit the use case), it makes sense to make it a more clearly 
documented feature under a less surprising name.

I haven't looked at the implementation, so I'm not sure how easy it will be to 
migrate it to a different module, but threading seems like a logical choice 
given the multiprocessing.ThreadPool vs threading.ThreadPool parallel.

(Honestly, I'd be happier if we moved queue.Queue to threading as well. Having 
a threading specific data type as a top level module in its own right just 
makes it harder for people to find for no real reason other than a historical 
accident)

Alternatively, we could add a concurrent.pool module which was little more 
than:

from multiprocessing import Pool as ProcessPool
from multiprocessing.dummy import ThreadPool

--
components: Library (Lib)
messages: 181495
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: Provide a more obvious public ThreadPool API
type: enhancement
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17140
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16203] Proposal: add re.fullmatch() method

2013-02-05 Thread Matthew Barnett

Matthew Barnett added the comment:

3 of the tests expect None when using 'fullmatch'; they won't return None when 
using 'match'.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16203
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >