[issue18993] There is an overshadowed and invalid test in testmock.py

2013-09-10 Thread Vajrasky Kok

New submission from Vajrasky Kok:

In Lib/unittest/test/testmock/testmock.py, there are two 
test_attribute_deletion. One of them is overshadowed (not executed) by the 
other.

def test_attribute_deletion(self):
# this behaviour isn't *useful*, but at least it's now tested...
for Klass in Mock, MagicMock, NonCallableMagicMock, NonCallableMock:
m = Klass()
original = m.foo
m.foo = 3
del m.foo
self.assertEqual(m.foo, original)

new = m.foo = Mock()
del m.foo
self.assertEqual(m.foo, new)

def test_attribute_deletion(self):
for mock in Mock(), MagicMock():
self.assertTrue(hasattr(mock, 'm'))

del mock.m
self.assertFalse(hasattr(mock, 'm'))

del mock.f
self.assertFalse(hasattr(mock, 'f'))
self.assertRaises(AttributeError, getattr, mock, 'f')

They are testing the same thing but with different expectations. The first one 
is invalid and should be removed. The patch altered a bit of the second test to 
incorporate more mock classes.

--
components: Tests
files: remove_wrongly_test_in_testmock.patch
keywords: patch
messages: 197424
nosy: vajrasky
priority: normal
severity: normal
status: open
title: There is an overshadowed and invalid test in testmock.py
type: enhancement
versions: Python 3.4
Added file: 
http://bugs.python.org/file31708/remove_wrongly_test_in_testmock.patch

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



[issue18994] Inside fcntl module, we does not check the return code of all_ins function

2013-09-10 Thread Vajrasky Kok

New submission from Vajrasky Kok:

In Modules/fcntlmodule.c, there is a code to insert symbolic constants to the 
module.

all_ins(m);

But we don't check the return code of the function whether it is successful or 
not, unlike in posix module in which we check it.

if (all_ins(m))
return NULL;

Attached the patch to add checking of the return code of all_ins function in 
fcntl module file.

--
components: Extension Modules
files: check_return_code_all_ins_in_fcntl.patch
keywords: patch
messages: 197425
nosy: vajrasky
priority: normal
severity: normal
status: open
title: Inside fcntl module, we does not check the return code of all_ins 
function
type: enhancement
versions: Python 3.4
Added file: 
http://bugs.python.org/file31709/check_return_code_all_ins_in_fcntl.patch

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



[issue18903] IDLE file-completion is case-sensitive in Windows

2013-09-10 Thread Westley Martínez

Westley Martínez added the comment:

I've written a patch that sort of implements the functionality that makes the 
most sense to me.  The problem is it only works right for the first entry.  
It's kind of wonky and I'm not entirely sure how it behaves, nor do I know the 
cause of the bug, but it's a start.

--
keywords: +patch
Added file: http://bugs.python.org/file31710/cpython-idle-18903-1.patch

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



[issue18943] argparse: default args in mutually exclusive groups

2013-09-10 Thread Armin Rigo

Armin Rigo added the comment:

The patch looks good to me.  It may break existing code, though, as reported on 
https://bugs.pypy.org/issue1595.  I would say that it should only go to trunk.  
We can always fix PyPy (at Python 2.7) in a custom manner, in a bug-to-bug 
compatibility mode.

--

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



[issue18995] Enum does not work with reversed

2013-09-10 Thread Vajrasky Kok

New submission from Vajrasky Kok:

cutecat@amiau:~/cpython$ cat /tmp/innerplanets.py 
from enum import Enum

class innerplanets(Enum):
mercury = 1
venus = 2
earth = 3
mars = 4

for planet in innerplanets:
print(planet)
for planet in reversed(innerplanets):
print(planet)
cutecat@amiau:~/cpython$ ./python /tmp/innerplanets.py 
innerplanets.mercury
innerplanets.venus
innerplanets.earth
innerplanets.mars
Traceback (most recent call last):
  File /tmp/innerplanets.py, line 11, in module
for planet in reversed(innerplanets):
  File /home/cutecat/cpython/Lib/enum.py, line 255, in __getitem__
return cls._member_map_[name]
KeyError: 3

Attached the patch to add support for reversed in enum.

--
components: Library (Lib)
files: add_reversed_support_for_enum.patch
keywords: patch
messages: 197428
nosy: ethan.furman, vajrasky
priority: normal
severity: normal
status: open
title: Enum does not work with reversed
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file31711/add_reversed_support_for_enum.patch

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



[issue1565525] tracebacks eat up memory by holding references to locals and globals when they are not wanted

2013-09-10 Thread A.M. Kuchling

A.M. Kuchling added the comment:

I'm happy to change the function name, though I'll note that the traceback 
module does have print_tb(), format_tb() and extract_tb(). 

I'm OK with both of Victor's suggestions but personally slightly prefer 
traceback.clear_frames(tb).

Rationale: People who are keeping tracebacks around and want to save memory are 
probably using other functions from the traceback module, and the module has 
fairly short names (print_tb, format_exception) so I doubt they'll often do 
'from traceback import clear_traceback_frames'.

--

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(now relayed on python-dev)

--

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Is there an easy way to recheck the entire tree, possibly reverting any files 
that don't match the content that they should have? I'd rather not throw the 
tree away.

--

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

hg update -C default

--
nosy: +serhiy.storchaka

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



[issue18996] unittest: more helpful truncating long strings

2013-09-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Error message in assertEqual() is not vary useful when compared long strings 
with long common prefix. It looks as:

'For the first time in his life h [truncated]...' != 'For the first time in his 
life h [truncated]...'

With the proposed patch it will look as:

'For [25 chars]e he seemed to be vividly aware of his own existence.' != 'For 
[25 chars]e he felt humble. He perceived how misgui[105 chars]ers.'

New algorithm splits strings on common prefix and differing suffixes, shortens 
every part if it is too long, and concatenates them back. So user always see 
the start and the end of string, and the place of first difference with some 
characters before and after.

--
components: Tests
files: assertEqual_shorten.patch
keywords: patch
messages: 197433
nosy: ezio.melotti, michael.foord, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: unittest: more helpful truncating long strings
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31712/assertEqual_shorten.patch

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I'm uploading a pure Python transformdict implementation + tests, for Serhiy's 
benefits (and others') :-)

--
keywords: +patch
Added file: http://bugs.python.org/file31713/transform.patch

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



[issue16564] email.generator.BytesGenerator fails with bytes payload

2013-09-10 Thread Alexander Kruppa

Alexander Kruppa added the comment:

It seems to me that this issue is not fixed correctly yet. I've tried Python 
3.3.2:
~/build/Python-3.3.2$ ./python --version
Python 3.3.2

When modifying the test case in Lib/test/test_email/test_email.py like this:

--- Lib/test/test_email/test_email.py   2013-05-15 18:32:55.0 +0200
+++ Lib/test/test_email/test_email_mine.py  2013-09-10 14:22:08.160089440 
+0200
@@ -1461,17 +1461,17 @@
 # Issue 16564: This does not produce an RFC valid message, since to be
 # valid it should have a CTE of binary.  But the below works in
 # Python2, and is documented as working this way.
-bytesdata = b'\xfa\xfb\xfc\xfd\xfe\xff'
+bytesdata = b'\x0b\xfa\xfb\xfc\xfd\xfe\xff'
 msg = MIMEApplication(bytesdata, _encoder=encoders.encode_noop)
 # Treated as a string, this will be invalid code points.
-self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
+# self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
 self.assertEqual(msg.get_payload(decode=True), bytesdata)
 s = BytesIO()
 g = BytesGenerator(s)
 g.flatten(msg)
 wireform = s.getvalue()
 msg2 = email.message_from_bytes(wireform)
-self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
+# self.assertEqual(msg.get_payload(), '\uFFFD' * len(bytesdata))
 self.assertEqual(msg2.get_payload(decode=True), bytesdata)

then running:

./python ./Tools/scripts/run_tests.py test_email

results in:

==
FAIL: test_binary_body_with_encode_noop (test_email_mine.TestMIMEApplication)
--
Traceback (most recent call last):
  File 
/localdisk/kruppaal/build/Python-3.3.2/Lib/test/test_email/test_email_mine.py,
 line 1475, in test_binary_body_with_encode_noop
self.assertEqual(msg2.get_payload(decode=True), bytesdata)
AssertionError: b'\x0b\n\xfa\xfb\xfc\xfd\xfe\xff' != 
b'\x0b\xfa\xfb\xfc\xfd\xfe\xff'

The '\x0b' byte is incorrectly translated to '\x0b\n', i.e., a New Line 
character is inserted.

Encoding the bytes array:
bytes(range(256))

results output data (MIME Header stripped):

000: 0001 0203 0405 0607 0809 0a0b 0a0c 0a0a  
010: 0e0f 1011 1213 1415 1617 1819 1a1b 1c0a  
020: 1d0a 1e0a 1f20 2122 2324 2526 2728 292a  . !#$%'()*
030: 2b2c 2d2e 2f30 3132 3334 3536 3738 393a  +,-./0123456789:
040: 3b3c 3d3e 3f40 4142 4344 4546 4748 494a  ;=?@ABCDEFGHIJ
050: 4b4c 4d4e 4f50 5152 5354 5556 5758 595a  KLMNOPQRSTUVWXYZ
060: 5b5c 5d5e 5f60 6162 6364 6566 6768 696a  [\]^_`abcdefghij
070: 6b6c 6d6e 6f70 7172 7374 7576 7778 797a  klmnopqrstuvwxyz
080: 7b7c 7d7e 7f80 8182 8384 8586 8788 898a  {|}~
090: 8b8c 8d8e 8f90 9192 9394 9596 9798 999a  
0a0: 9b9c 9d9e 9fa0 a1a2 a3a4 a5a6 a7a8 a9aa  
0b0: abac adae afb0 b1b2 b3b4 b5b6 b7b8 b9ba  
0c0: bbbc bdbe bfc0 c1c2 c3c4 c5c6 c7c8 c9ca  
0d0: cbcc cdce cfd0 d1d2 d3d4 d5d6 d7d8 d9da  
0e0: dbdc ddde dfe0 e1e2 e3e4 e5e6 e7e8 e9ea  
0f0: ebec edee eff0 f1f2 f3f4 f5f6 f7f8 f9fa  
100: fbfc fdfe ff .

That is, a '\n' is inserted after '\x0b', '\x1c', '\x1d', and '\x1e', 
and '\x0d' is replaced by '\n\n'.

--

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



[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson

Dan Nicholson added the comment:

It turns out this is pretty easy to fix by just changing the stub to import 
builtins or __builtin__ depending on the python install version. Attached are 
patches that fix this for both the default and 2.7 branches.

My test case is a pure python module with an install script. I've rebuilt the 
wininst stub for both default (3.3) with VS2010 Express and 2.7 with VS2008 
Express. I then built installers and ran them in both directions: installer 
created with python-2.7 and installed into python-3.3, and an installer created 
with python-3.3 and installed into python-2.7. Both worked fine with no 
warnings.

I've attached the stubs I built in case they're helpful. 
wininst-10.0-compat.exe is the 32 bit stub for default/3.3. 
wininst-9.0-compat-2.7.exe is the 32 bit stub for 2.7.

--
keywords: +patch
nosy: +dbn
Added file: http://bugs.python.org/file31714/wininst-compat.patch

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



[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson

Changes by Dan Nicholson dbn.li...@gmail.com:


Added file: http://bugs.python.org/file31716/wininst-10.0-compat.exe

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



[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson

Changes by Dan Nicholson dbn.li...@gmail.com:


Added file: http://bugs.python.org/file31715/wininst-compat-2.7.patch

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



[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Dan Nicholson

Changes by Dan Nicholson dbn.li...@gmail.com:


Added file: http://bugs.python.org/file31717/wininst-9.0-compat-2.7.exe

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



[issue18281] tarfile defines stat constants

2013-09-10 Thread Eli Bendersky

Eli Bendersky added the comment:

lgtm. kill 'em

--
nosy: +eli.bendersky

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



[issue17797] Visual C++ 11.0 reports fileno(stdin) == 0 for non-console program

2013-09-10 Thread Daniel

Daniel added the comment:

After contacting Microsoft they answered that they cannot fix that within the 
VS2012 or VS2013 cycle. Very bad. Any ideas?

--
nosy: +m_python

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



[issue11598] missing afxres.h error when building bdist_wininst in Visual Studio 2008 Express

2013-09-10 Thread Dan Nicholson

Dan Nicholson added the comment:

Like the previous users, I've only got VS Express, so I can't tell exactly what 
happens when you have VS Pro and it generates the install.rc file. However, I 
might as well post this fuller patch, which I think would do the right thing 
since it also fixes the part where the regeneration of the '#include 
afxres.h' would happen.

I've used this in the installer for both 3.3 and 2.7 and not seen any adverse 
effects.

--
keywords: +patch
nosy: +dbn
Added file: http://bugs.python.org/file31718/wininst-no-afxres.h.patch

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



[issue18997] Crash when using pickle and ElementTree

2013-09-10 Thread Germán M . Bravo

New submission from Germán M. Bravo:

On the tip of 3.3, I've found `Element.__getstate__` doesn't work and neither 
as `pickle.dumps(Element)` under certain circumstances.

This crashes:
  e1 = ElementTree().parse('houses.xml')
  e1.__getstate__()

This doesn't crash:
  e2 = ElementTree().parse('houses.xml')
  e2.text = 'some'
  e2.__getstate__()

But still, both of these crash:
  pickle.dumps(e1)
  pickle.dumps(e2)

--
components: Extension Modules
files: houses.xml
messages: 197440
nosy: Kronuz, eli.bendersky, scoder
priority: normal
severity: normal
status: open
title: Crash when using pickle and ElementTree
versions: Python 3.3
Added file: http://bugs.python.org/file31719/houses.xml

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



[issue4636] bdist_wininst installer with install script raises exception

2013-09-10 Thread Éric Araujo

Éric Araujo added the comment:

I think the exe files are specific to one Python version, so the version check 
would not be necessary.  I may be wrong though, as I’m not a windows dev or 
user, so I’m adding Mark to this issue.

--
nosy: +mhammond

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



[issue18998] iter() not working in ElementTree

2013-09-10 Thread Germán M . Bravo

New submission from Germán M. Bravo:

The added iter/itertext methods in Element are not working under certain 
circumstances (crashes):

This crashes:
  e = ElementTree().parse('/Users/kronuz/Desktop/tests/houses.xml')
  e.iter()

But the problem is not there if I use bootstrapped iterators instead (from the 
previous commit to the one introducing Element iterator)

--
components: Extension Modules
files: houses.xml
messages: 197441
nosy: Kronuz, eli.bendersky, scoder
priority: normal
severity: normal
status: open
title: iter() not working in ElementTree
type: crash
versions: Python 3.3
Added file: http://bugs.python.org/file31720/houses.xml

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Richard Oudkerk

Richard Oudkerk added the comment:

With the current patch __repr__() will fail if the untransformed key is 
unhashable:

 d = collections.transformdict(id)
 L = [1,2,3]
 d[L] = None 
 d.keys()
Traceback (most recent call last):
  File stdin, line 1, in module
  File C:\Repos\cpython-dirty\lib\collections\abc.py, line 444, in __repr__
return '{0.__class__.__name__}({0._mapping!r})'.format(self)
  File C:\Repos\cpython-dirty\lib\collections\__init__.py, line 944, in 
__repr__
self._transform, repr(dict(self)))
TypeError: unhashable type: 'list'

--
nosy: +sbt

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Lars Buitinck

Changes by Lars Buitinck larsm...@gmail.com:


--
title: Allow multiple calls to multiprocessing.set_start_method - Robustness 
issues in multiprocessing.{get,set}_start_method

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Olivier Grisel

Olivier Grisel added the comment:

Related question: is there any good reason that would prevent to pass a custom 
`start_method` kwarg to the `Pool` constructor to make it use an alternative 
`Popen` instance (that is an instance different from the  
`multiprocessing._Popen` singleton)?

This would allow libraries such as joblib to keep minimal side effect by try to 
impact the default multiprocessing runtime as low as possible.

--
nosy: +Olivier.Grisel

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



[issue18999] Allow multiple calls to multiprocessing.set_start_method

2013-09-10 Thread Lars Buitinck

New submission from Lars Buitinck:

The new multiprocessing based on forkserver (issue8713) looks great, but it has 
two problems. The first:

set_start_method() should not be used more than once in the program.

The documentation does not explain what the effect of calling it twice would 
be. Judging from the documentation, it should be possible to do

start_method = get_start_method()
if start_method is None:
set_start_method('forkserver')

but this code shows the second problem: it always succeeds with the 
(undocumented!) side-effect of setting the start method in get_start_method, to 
the system default, if it hasn't been set already.

I was just going to forge a patch for joblib (http://pythonhosted.org/joblib/) 
to set the start method to forkserver at import time. But in the current state 
of affairs, it would be impossible for the user to safely override the start 
method before importing joblib, because joblib can't figure out if it's been 
set already without setting it.

The enclosed patch solves the problem by making the new functions more robust:

* get_start_method no longer sets anything, but returns None if the start 
method has not been set already;
* set_start_method raises a RuntimeError (for want of a better exception type) 
when resetting the start method is attempted.

Unfortunately, I had to hack up the tests a bit, because they were violating 
the set_start_method contract. There is a test for the new set_start_method 
behavior, though, and all {fork,forkserver,spawn} tests pass on Linux.

--
components: Library (Lib)
files: mp_getset_start_method.patch
keywords: patch
messages: 197444
nosy: larsmans
priority: normal
severity: normal
status: open
title: Allow multiple calls to multiprocessing.set_start_method
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file31721/mp_getset_start_method.patch

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



[issue18999] Allow multiple calls to multiprocessing.set_start_method

2013-09-10 Thread Lars Buitinck

Changes by Lars Buitinck l.j.buiti...@uva.nl:


--
nosy: +sbt

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 With the current patch __repr__() will fail if the untransformed key
 is unhashable:

Yeah, the __repr__() implementation will be a bit annoying to get right :-)

--

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



[issue19000] Alt + Num Does Not Work in IDLE.

2013-09-10 Thread Howitzer21

New submission from Howitzer21:

While Num Lock is in use, if I hold Alt, type 234, then release Alt, Ω is 
supposed to be printed (and it is printed in most other programs).  If I try to 
do this in IDLE, however, IDLE will toggle its maximization along the y-axis 
and move the cursor to the beginning of the line, without printing anything.

--
components: IDLE
messages: 197448
nosy: Howitzer21
priority: normal
severity: normal
status: open
title: Alt + Num Does Not Work in IDLE.
type: behavior
versions: Python 3.3

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



[issue19000] Alt + Num Does Not Work in IDLE.

2013-09-10 Thread Howitzer21

Howitzer21 added the comment:

Sorry, it may be a UTF-8 issue.  I would delete this, but I don't see a way to 
do so.

--
status: open - closed

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



[issue18998] iter() not working in ElementTree

2013-09-10 Thread irakli

irakli added the comment:

Can you clearify under which circumstances python 3.3 crashes?

--
nosy: +iraklid94

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Richard Oudkerk

Richard Oudkerk added the comment:

With your patch, I think if you call get_start_method() without later calling 
set_start_method() then the helper process(es) will never be started.

With the current code, popen.Popen() automatically starts the helper processes 
if they have not already been started.

Also, set_start_method() can have the side-effect of starting helper 
process(es).  I do not really approve of new processes being started as a 
side-effect of importing a library.  But it is reasonable for a library to want 
a specific start method unless the user demands otherwise.

I will have to think this over.


BTW, the reason for discouraging using set_start_method() more than once is 
because some shared resources are created differently depending on what the 
current start method is.

For instance using the fork method semaphores are created and then immediately 
unlinked.  But with the other start methods we must not unlink the semaphore 
until we are finished with it (while being paranoid about cleanup).

Maybe it would be better to have separate contexts for each start method.  That 
way joblib could use the forkserver context without interfering with the rest 
of the user's program.

from multiprocessing import forkserver_context as mp
l = mp.Lock()
p = mp.Process(...)
with mp.Pool() as pool:
...

--

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



[issue18997] Crash when using pickle and ElementTree

2013-09-10 Thread Germán M . Bravo

Germán M. Bravo added the comment:

The attached patch fixes the problem (there were some missing JOIN_OBJ())

--
keywords: +patch
Added file: http://bugs.python.org/file31723/join_obj.diff

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Lars Buitinck

Changes by Lars Buitinck larsm...@gmail.com:


Removed file: http://bugs.python.org/file31721/mp_getset_start_method.patch

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Lars Buitinck

Lars Buitinck added the comment:

Cleaned up the patch.

--
Added file: http://bugs.python.org/file31722/mp_getset_start_method.patch

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



[issue18998] iter() not working in ElementTree

2013-09-10 Thread Germán M . Bravo

Germán M. Bravo added the comment:

It crashes when I run that code snippet I posted (using the attached xml file) 
The problem was introduced by the commit that added iterator support.

--

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Tim Peters

Tim Peters added the comment:

Serhiy, did you test hg update -C default?  Didn't work for me :-(

Martin, I don't know an easy way.  eol fiddling in Hg seems brittle :-(

I suppose you could get a fresh clone and then _compare_ the checked-out files 
to your old clone.  Then, from the old clone, delete the files that don't 
match.  Then hg revert -a in the old clone.  Then check again.  If they all 
match, throw away the new clone.  But, no, that's not really easy ;-)

--

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



[issue18996] unittest: more helpful truncating long strings

2013-09-10 Thread Serhiy Storchaka

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


Removed file: http://bugs.python.org/file31712/assertEqual_shorten.patch

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



[issue18997] Crash when using pickle and ElementTree

2013-09-10 Thread Germán M . Bravo

Changes by Germán M. Bravo german...@gmail.com:


Removed file: http://bugs.python.org/file31723/join_obj.diff

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



[issue18997] Crash when using pickle and ElementTree

2013-09-10 Thread Germán M . Bravo

Changes by Germán M. Bravo german...@gmail.com:


Added file: http://bugs.python.org/file31725/join_obj.diff

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Tim Peters

Tim Peters added the comment:

OK, hg up -C _can_ work, but it appears to require that hg stat shows that 
the files with the bad line endings are modified (M).  That may or may not be 
the case, depending on lots of things.

Martin, can you verify that (for example) test.xml.out does have \r\n line ends 
in your tree?  Maybe it doesn't, and the problem really lies elsewhere (unsure 
- some step in building the .msi, or maybe even the .msi changes line ends 
during installation - don't know).

I think bad line endings in the tree are most likely, though, since test_sax 
was failing in the same way for (at least) me and Terry Reddy when building our 
own Pythons on Windows, before changing .hgeol.

--

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Tim Peters

Tim Peters added the comment:

BTW, the reason I wonder whether you don't have bad line ends in your tree is 
this:  if you did, test_sax would have been failing for you too.  I assume you 
run the test suite before building the installer ;-)

--

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



[issue18998] iter() not working in ElementTree

2013-09-10 Thread Eli Bendersky

Eli Bendersky added the comment:

I'm having trouble reproducing the problem, Germán. Running with Python 3.3.2 
from a couple of days ago:

Python 3.3.2+ (3.3:0eef1670f316, Sep  8 2013, 08:31:59) 
[GCC 4.6.3] on linux
Type help, copyright, credits or license for more information.
 from xml.etree.ElementTree import *
 e = ElementTree().parse('houses.xml')
 e.iter()
_elementtree._element_iterator object at 0x7fac621d9aa0
 list(e.iter())
[Element '{http://dogs.house.local}group' at 0x7fac621e02b8, Element 
'{http://dogs.house.local}house' at 0x7fac621e0368, Element 
'{http://dogs.house.local}id' at 0x7fac621e0418, Element 
'{http://dogs.house.local}dogs' at 0x7fac621e0470, Element 
'{http://dogs.house.local}house' at 0x7fac621e04c8, Element 
'{http://dogs.house.local}id' at 0x7fac621e0520, Element 
'{http://dogs.house.local}dogs' at 0x7fac621e0578]



Can you provide a patch for the ET tests that I can apply to tip of 3.3 and see 
this reproduced?

--
assignee:  - eli.bendersky
stage:  - test needed

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



[issue18997] Crash when using pickle and ElementTree

2013-09-10 Thread Eli Bendersky

Eli Bendersky added the comment:

Thanks for this report, Germán (and the other issue as well). I'll do my best 
to take a look later this week.

--
assignee:  - eli.bendersky
stage:  - patch review
type:  - behavior
versions: +Python 3.4

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Éric Araujo

Éric Araujo added the comment:

FTR this is one message from the previous thread about this: 
https://mail.python.org/pipermail/python-ideas/2010-June/007332.html

--
nosy: +eric.araujo

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



[issue18962] Add special case for single iterator in heapq.merge function

2013-09-10 Thread Wouter Bolsterlee

Wouter Bolsterlee added the comment:

Thanks Raymond, that is exactly what I had in mind (see my previous comment).
Here's a slightly cleaned up version of the patch (stylistic/PEP8 cleanups),
with some benchmarks included below.

In case the two longest iterators have about the same size, no performance
difference can be measured:

$ ./python -m timeit -s 'from heapq import merge' 'for x in merge([], [], [1], 
range(100), range(100)): pass'

Without patch:

1 loops, best of 3: 71.2 usec per loop
1 loops, best of 3: 71.9 usec per loop
1 loops, best of 3: 71.7 usec per loop

With patch:

1 loops, best of 3: 71.4 usec per loop
1 loops, best of 3: 76.7 usec per loop
1 loops, best of 3: 72.1 usec per loop

As expected, the performance gain is very significant in case one of the
iterators is much longer than the others:

$ python -m timeit -n 100 -s 'from heapq import merge' 'for x in merge([], [], 
[1], range(100), range(10)): pass'

Without path:

100 loops, best of 3: 27.8 msec per loop
100 loops, best of 3: 26.9 msec per loop
100 loops, best of 3: 27.7 msec per loop

With patch:

100 loops, best of 3: 6.26 msec per loop
100 loops, best of 3: 6.28 msec per loop
100 loops, best of 3: 6.03 msec per loop

--
Added file: http://bugs.python.org/file31726/merge3.diff

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

It turns out that TortoiseHg was showing the files as modified. I have now 
reverted my local changes, so this should be fine now. I was somewhat under 
time pressure when making the release, so I didn't notice then (and TortoiseHg 
seems to needs some time also to detect modifications and reversals).

And no, I don't run the test suite when making a release. If a test was 
failing, I would have to research what the problem is (or ignore the failure), 
which could easily delay the release by several days. I only verify that IDLE 
starts and the help file opens.

Thanks for your investigation.

--
resolution:  - fixed
status: open - closed

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



[issue4832] IDLE does not supply a default ext of .py on Windows or OS X for new file saves

2013-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

With PEP 434, this can and I think should be backported. I should have done it 
for 2.7.5 and will try to do soon.

--

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



[issue19001] test_gdb fails on Fedora buildbot

2013-09-10 Thread Antoine Pitrou

New submission from Antoine Pitrou:

This is on Stefan's Fedora without threads buildbot, and it's the sets 
pretty-printing tests which fail:
http://buildbot.python.org/all/builders/AMD64%20Fedora%20without%20threads%203.x/builds/5119

--
components: Demos and Tools, Interpreter Core
messages: 197463
nosy: ncoghlan, pitrou, rhettinger, skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: test_gdb fails on Fedora buildbot
type: behavior
versions: Python 3.4

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Updated patch: fixes repr(), and retains the first key not the last.

--
Added file: http://bugs.python.org/file31727/transformdict.patch

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



[issue16564] email.generator.BytesGenerator fails with bytes payload

2013-09-10 Thread R. David Murray

R. David Murray added the comment:

That's a different bug, and is probably due to the fact that \x0b is considered 
a line-ending character by the 'splitlines' method.

Could you please open a new issue for this?  It could be that this can't be 
fixed in Python3 until support for the 'binary' CTE is added.

--

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



[issue18992] test_sax fails on Windows under 3.4.0a2

2013-09-10 Thread Tim Peters

Tim Peters added the comment:

No problems, Martin - thanks for following up on this! :-)

--

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



[issue17477] update the bsddb module do build with db 5.x versions

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18987] distutils.utils.get_platform() for 32-bit Python on a 64-bit machine

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18997] Crash when using pickle and ElementTree

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18936] 2.7 distutils getopt chokes on unicode option names

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18734] Berkeley DB versions 4.4-4.9 are not discovered by setup.py

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18996] unittest: more helpful truncating long strings

2013-09-10 Thread Serhiy Storchaka

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


Added file: http://bugs.python.org/file31724/assertEqual_shorten.patch

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Lars Buitinck

Lars Buitinck added the comment:

In my patched version, the private popen.get_start_method gets a kwarg 
set_if_needed=True. popen.Popen calls that as before, so its behavior should 
not change, while the public get_start_method sets the kwarg to False.

I realise now that this has the side effect that get_start_method's output 
changes when multiprocessing has first been used, but then that reflects how 
the library works. Maybe this should be documented.

As for the contexts, those would be great.

--

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



[issue10977] Concrete object C API considered harmful to subclasses of builtin types

2013-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue18999] Robustness issues in multiprocessing.{get, set}_start_method

2013-09-10 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 In my patched version, the private popen.get_start_method gets a kwarg 
 set_if_needed=True. popen.Popen calls that as before, so its behavior 
 should not change, while the public get_start_method sets the kwarg to 
 False.

My mistake.

--

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



[issue18986] Add a case-insensitive case-preserving dict

2013-09-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I would *really* like for this to start outside the standard library.
It needs to mature with user feedback before being dumped
in the collections module (which was never intended to be a
giant pile of every collection a person could think of).  

Adding yet more dictionary variants is an example of
way-too-many-ways-to-do-it.

--

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