[issue6167] Tkinter.Scrollbar: the activate method needs to return a value, and set should take only two args

2014-06-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue21611] int() docstring - unclear what number is

2014-06-02 Thread eryksun

eryksun added the comment:

The constructor tries __trunc__ (truncate toward 0) if __int__ isn't defined. 
If __trunc__ doesn't return an instance of int, it calls the intermediate 
result's __int__ method. In terms of the numbers ABCs, numbers.Real requires 
__trunc__, which should return a numbers.Integral, which requires __int__. 

The special methods __trunc__, __floor__, and __ceil__ aren't documented in the 
language reference. They're mentioned briefly in the docs for the math 
functions trunc, floor, and ceil.

--
nosy: +eryksun

___
Python tracker 

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



[issue18039] dbm.open(..., flag="n") does not work and does not give a warning

2014-06-02 Thread Claudiu.Popa

Changes by Claudiu.Popa :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue18039] dbm.open(..., flag="n") does not work and does not give a warning

2014-06-02 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Serhiy, could you please have a look at this patch? Given the fact that you 
committed my last dbm patch, I hope you have a couple of minutes to have a look 
at this one as well.

--

___
Python tracker 

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



[issue4350] Remove dead code from Tkinter.py

2014-06-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue17095] Modules/Setup *shared* support broken

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6c468df214dc by Ned Deily in branch '3.4':
Issue #17095: Fix Modules/Setup *shared* support.
http://hg.python.org/cpython/rev/6c468df214dc

New changeset 227ce85bdbe0 by Ned Deily in branch 'default':
Issue #17095: Fix Modules/Setup *shared* support.
http://hg.python.org/cpython/rev/227ce85bdbe0

--
nosy: +python-dev

___
Python tracker 

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



[issue17095] Modules/Setup *shared* support broken

2014-06-02 Thread Ned Deily

Ned Deily added the comment:

Committed for release in 3.4.2 and 3.5.0.

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

___
Python tracker 

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



[issue20147] multiprocessing.Queue.get() raises queue.Empty exception if even if an item is available

2014-06-02 Thread Alexei Mozhaev

Alexei Mozhaev added the comment:

Hi! Are there any updates on the issue?

--

___
Python tracker 

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



[issue19997] imghdr.what doesn't accept bytes paths

2014-06-02 Thread Claudiu.Popa

Claudiu.Popa added the comment:

There are other modules with support for bytes filenames in their API:

bz2  
codecs   
gzip 
lzma 
pipes.Template   
tarfile
tokenize
fileinput
filecmp
sndhdr
configparser

Also, given the fact that sndhdr supports them and its purpose is similar with 
imghdr, it would be a surprise
for a beginner to find out that imghdr.what(b"img") is not working, while 
sndhdr.what(b"snd") works.

--

___
Python tracker 

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



[issue21401] python2 -3 does not warn about str/unicode to bytes conversions and comparisons

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy wrote:
"I think that even if we accept this change (I am unsure in this), a warning 
should be raised only when bytes and unicode objects are equal. When they are 
not equal, a warning should not be raised, because this matches Python 3 
behavior."

Python 3 warns even if strings are equal.

$ python3 -b -Wd
Python 3.3.2 (default, Mar  5 2014, 08:21:05) 
e" for more information.
>>> b'abc' == 'abc'
__main__:1: BytesWarning: Comparison between bytes and string
False
>>> b'abc' == 'abc'
False

The warning is not repeat in the interactive interprter because it is emited 
twice at the same location "__main__:1".

--

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro

New submission from Lennart Regebro:

Pystone uses some floats in Python 3, while in Python 2 it's all integers. And 
since it is, as far as I can tell, based on Dhrystone, it should be all ints.

After fixing the division in the loop to be a floor division it runs the same 
as in Python 2. I've verified that after the attached fix the only floats 
created are time stamps, so this seems to be all that's needed.

This also makes the benchmark run c:a 5% faster, lessening the speed difference 
in pystone between Python 2 and Python 3, which contributes to the 
misconception that Python 3 is horribly slow.

--
components: Benchmarks
files: pystone.diff
keywords: patch
messages: 219559
nosy: lregebro
priority: normal
severity: normal
status: open
title: Pystone uses floats
type: performance
versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35442/pystone.diff

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

According to the name of variables ("IntLoc2 = IntLoc3 // IntLoc1"), I agree 
that integers should be used. Since the performances can be different between 
int and float, you should change the version and explain your change in the 
changelog (in the top docstring).

--
nosy: +haypo

___
Python tracker 

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



[issue13631] readline fails to parse some forms of .editrc under editline (libedit) emulation on Mac OS X

2014-06-02 Thread Ned Deily

Ned Deily added the comment:

It appears that Apple's update to editline in OS X 10.9 Mavericks has also 
broken this patch; with refreshing, it still works with the system editline in 
10.8. So, like the fix for Issue18458, we need to make sure that the fix works 
with either version of a dynamically loaded libedit.

Zvezdan, it would be good if you would be willing to sign the Python 
contributor agreement for your patch:  
https://www.python.org/psf/contrib/contrib-form/

--
stage: commit review -> patch review
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue634412] RFC 2387 in email package

2014-06-02 Thread Abhilash Raj

Abhilash Raj added the comment:

David: I had a look at the examples and documentation as you said. I found some 
support for multipart/related in the form of  `add_related` and `set_related` 
methods. But I am still confused on how to make content_manager recognize 
miltipart/related messages. Do I need to add a new content-manager instance 
like `raw_content_manager` or something else?

--

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro

Lennart Regebro added the comment:

Yes, good point, I added this in a new diff.

--
Added file: http://bugs.python.org/file35443/pystone12.diff

___
Python tracker 

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



[issue4350] Remove dead code from Tkinter.py

2014-06-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Patch is synchronized with tip. It also removes Studbutton and Tributton 
classes which depend on removed methods. These classes are not documented, not 
tested and never worked in supported Python versions. I even not found 
reasonable links in Google, except an annotation [1] and autogenerated from 
Tkinter sources docs.

I now think that perhaps we should apply this patch to 2.7 and 3.4 too. 
Non-working (and non-worked last 10 or 15 or more years) code only confuses 
people.

[1] http://legacy.python.org/search/hypermail/python-1994q2/1023.html

--
Added file: http://bugs.python.org/file35444/tkinter_remove_dead_code-3.5.diff

___
Python tracker 

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



[issue21635] difflib.SequenceMatcher stores matching blocks as tuples, not Match named tuples

2014-06-02 Thread drevicko

New submission from drevicko:

difflib.SequenceMatcher.get_matching_blocks() last lines:


non_adjacent.append( (la, lb, 0) )
self.matching_blocks = non_adjacent
return map(Match._make, self.matching_blocks)

should be something like:

non_adjacent.append( (la, lb, 0) )
self.matching_blocks = map(Match._make, non_adjacent)
return self.matching_blocks

--
components: Library (Lib)
messages: 219565
nosy: drevicko
priority: normal
severity: normal
status: open
title: difflib.SequenceMatcher stores matching blocks as tuples, not Match 
named tuples
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue21625] help()'s more-mode is frustrating

2014-06-02 Thread Ned Batchelder

Ned Batchelder added the comment:

Serhiy, thanks for the configuration tip.  But you seem to be missing my point, 
which is that beginners need the default to be a little more friendly.  I don't 
want to make it bad for experienced users, of course.  I doubt Unix users will 
be confused by seeing "END (q to quit)" as a prompt.

--

___
Python tracker 

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



[issue21600] mock.patch.stopall doesn't work with patch.dict to sys.modules

2014-06-02 Thread fumihiko kakuma

fumihiko kakuma added the comment:

Checking mock.py(version 1.0.1) it seems that patch.stopall does not support 
patch.dict. Does it have any problem to support ptch.dict by stopall.
I made the attached patch file for this. It seems to work well. How about this?

But I don't know why sys.modules refers the first mock object. 

$ python test_samp.py
test_samp1 (__main__.SampTestCase) ... foo_mod=
myfunc foo=
>>> stopall patch
ok
test_samp2 (__main__.SampTestCase) ... foo_mod=
myfunc foo=
>>> stopall patch
ok
test_samp3 (__main__.SampTestCase) ... foo_mod=
myfunc foo=
>>> stopall patch
ok

--
Ran 3 tests in 0.001s

OK
$

--
keywords: +patch
Added file: http://bugs.python.org/file35445/add_stopall_patch_dict.patch

___
Python tracker 

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



[issue21628] 2to3 does not fix zip in some cases

2014-06-02 Thread Berker Peksag

Berker Peksag added the comment:

This is a duplicate of issue 20742.

--
nosy: +berker.peksag
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> 2to3 zip fixer doesn't fix for loops.

___
Python tracker 

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



[issue20742] 2to3 zip fixer doesn't fix for loops.

2014-06-02 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +RobertG, benjamin.peterson
versions: +Python 2.7, Python 3.4, Python 3.5 -Python 3.2

___
Python tracker 

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-02 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +gregory.p.smith
versions: +Python 3.5

___
Python tracker 

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



[issue20640] Idle: test configHelpSourceEdit

2014-06-02 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Removed file: http://bugs.python.org/file34125/test-config-helpsource-33.patch

___
Python tracker 

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



[issue20640] Idle: test configHelpSourceEdit

2014-06-02 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Removed file: http://bugs.python.org/file34128/test-config-helpsource-27.patch

___
Python tracker 

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



[issue20640] Idle: test configHelpSourceEdit

2014-06-02 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file35446/test-cfg-help-34.diff

___
Python tracker 

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



[issue20640] Idle: test configHelpSourceEdit

2014-06-02 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file35447/test-cfg-help-27.diff

___
Python tracker 

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



[issue21592] Make statistics.median run in linear time

2014-06-02 Thread Thomas Dybdahl Ahle

Thomas Dybdahl Ahle added the comment:

I don't know if it's worth the overhead to implement a multiselect, given we 
only expose a median function.

I've rewritten select2 to be intro, just falling back on sorting. This doesn't 
appear to degrade the performance.

I also added np.median to the test-suite. And it is indeed pretty snappy. 
Though not more than select2 under pypy. There is a discussion here 
https://github.com/numpy/numpy/issues/1811

== Single call mode ==
Nsort select7  select23 select47 select97 select   select2  
select2b np.median
        
 -
50000.0020.0060.0040.0040.0040.0080.003
0.0030.000
   10.0040.0110.0080.0080.0080.0140.007
0.0070.001
   50.0250.0570.0440.0410.0430.0540.028
0.0280.005
  100.0550.1170.0870.0850.0890.1370.079
0.0800.014
  500.3660.6350.4740.4670.4850.5340.445
0.4460.105
 1000.8021.3211.0010.9851.0121.3920.936
0.9200.216
 2001.8332.6662.0201.9892.0403.0391.815
1.8210.468
 3002.8294.0393.0342.9803.1163.1912.622
2.6340.704
 4004.0135.6534.2754.2844.2096.2003.715
3.7550.998
 5005.1926.8885.1375.0295.2015.8265.047
5.0841.271

--
Added file: http://bugs.python.org/file35448/select2.py

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

+Unde Python 3 version 1.1 would use the normal division

I guess that it's a typo: "Under Python 3 ..."?

--

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro

Lennart Regebro added the comment:

Oups, yes, that's a typo.

--

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread Claudiu.Popa

New submission from Claudiu.Popa:

Hello! The attached patch fixes a crash for the logging tests on Windows. 
That's because the tests assume that socket.AF_UNIX exists. The actual 
traceback is:

[1/1] test_logging
test test_logging crashed -- Traceback (most recent call last):
  File "D:\Projects\cpython\lib\test\regrtest.py", line 1271, in runtest_inner
the_module = importlib.import_module(abstest)
  File "D:\Projects\cpython\lib\importlib\__init__.py", line 109, in 
import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 2203, in _gcd_import
  File "", line 2186, in _find_and_load
  File "", line 2175, in _find_and_load_unlocked
  File "", line 1149, in _load_unlocked
  File "", line 1420, in exec_module
  File "", line 321, in _call_with_frames_removed
  File "D:\Projects\cpython\lib\test\test_logging.py", line 863, in 
class TestUnixStreamServer(TestTCPServer):
  File "D:\Projects\cpython\lib\test\test_logging.py", line 864, in 
TestUnixStreamServer
address_family = socket.AF_UNIX
AttributeError: module 'socket' has no attribute 'AF_UNIX'

1 test failed:
test_logging

--
components: Tests
files: logging_windows.patch
keywords: patch
messages: 219572
nosy: Claudiu.Popa, vinay.sajip
priority: normal
severity: normal
status: open
title: test_logging fails on Windows for Unix tests
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file35449/logging_windows.patch

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1318324aa93a by Victor Stinner in branch '3.4':
Issue #21634: Fix pystone micro-benchmark: use floor division instead of true
http://hg.python.org/cpython/rev/1318324aa93a

New changeset 95b7acdc0f24 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21634: Fix pystone micro-benchmark: use floor division
http://hg.python.org/cpython/rev/95b7acdc0f24

--
nosy: +python-dev

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

Thanks the patch, I fixed pystone in Python 3.4 and 3.5.

--
resolution:  -> fixed
status: open -> closed
versions:  -Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

Oh, it looks like a follow-up of the issue #21583 (change 
f1393e82660819996e74c7eeddc5ae1f38b15f0a), the test was already buggy but not 
run before.

--
nosy: +diana, haypo, python-dev
versions: +Python 3.4

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

+if threading and hasattr(socket, "AF_UNIX"):

The check on socket.AF_UNIX attribute looks redundant: there is already a 
decorator on the testcase class to skip the whole test case. No?

--

___
Python tracker 

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +neologix, pitrou

___
Python tracker 

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



[issue21634] Pystone uses floats

2014-06-02 Thread Lennart Regebro

Lennart Regebro added the comment:

Awesome, thanks!

--

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread Claudiu.Popa

Claudiu.Popa added the comment:

No, because the tests will be skipped after the assignment of the address 
family.

--

___
Python tracker 

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

I have no opinon on close() vs setting CLOEXEC flag, but you should use 
_Py_set_inheritable(fd, 0, NULL). _Py_set_inheritable() is able to set the 
CLOEXEC flag in a single syscall, instead of 2 syscalls. 
_close_fds_by_brute_force() is already very slow when the maximum file 
descriptor is large:
http://legacy.python.org/dev/peps/pep-0446/#closing-all-open-file-descriptors

--
nosy: +haypo

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

> No, because the tests will be skipped after the assignment of the address 
> family.

Ah yes, the body of the class is executed before the decorator.

--

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d7a491c6cbdb by Victor Stinner in branch '3.4':
Issue #21636: Fix test_logging, skip UNIX stream (AF_UNIX) tests on Windows.
http://hg.python.org/cpython/rev/d7a491c6cbdb

New changeset b49e366556ba by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21636: Fix test_logging, skip UNIX stream (AF_UNIX) tests on
http://hg.python.org/cpython/rev/b49e366556ba

--

___
Python tracker 

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



[issue21636] test_logging fails on Windows for Unix tests

2014-06-02 Thread STINNER Victor

Changes by STINNER Victor :


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

___
Python tracker 

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



[issue21627] Concurrently closing files and iterating over the open files directory is not well specified

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

Since Python 3.4, all file descriptors directly created by Python are marked as 
non-inheritable. It should now be safe to use subprocess with close_fds=False, 
but the default value was not changed because third party modules (especially 
code written in C) may not respect the PEP 446.

If you are interested to change the default value, you should audit the major 
Python modules on PyPI to check if they were adapted to respect the PEP 446 
(mark all file descriptors as non-inheritable).

--

___
Python tracker 

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



[issue634412] RFC 2387 in email package

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

My idea (which I haven't worked out in detail) is to add either a new content 
manager that extends raw_data_manager, or just add to raw_data_manager, a 
handler for 'multipart/related'.  The set handler would handle a value of type 
'dict', and expect it to contain a mapping from content-ids to...something.  
What the 'something' is is the part I'm not clear on yet.  Trivially it could 
be MIMEParts, but that may not be the most convenient API.  Or perhaps it 
*should* be MIMEParts, with a helper utility to make building the dict easy.  
The 'get' handler would return a dict in the same format, whatever we decide 
that format should be.

--

___
Python tracker 

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



[issue21594] asyncio.create_subprocess_exec raises OSError

2014-06-02 Thread Sebastian Kreft

Sebastian Kreft added the comment:

I agree that blocking is not ideal, however there are already some other 
methods that can eventually block forever, and for such cases a timeout is 
provided. A similar approach could be used here.

I think this method should retry until it can actually access the resources, 
because knowing when and how many files descriptors are going to be used is 
very implementation dependent. So handling the retry logic on the application 
side, would be probably very inefficient as lot os information is missing, as 
the subprocess mechanism is a black box.

--

___
Python tracker 

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



[issue21637] Add a warning section exaplaining that tempfiles are opened in binary mode

2014-06-02 Thread Sebastian Kreft

New submission from Sebastian Kreft:

Although it is already explained that the default mode of the opened tempfiles 
is 'w+b' a warning/notice section should be included to make it clearer.

I think this is important as the default for the open function is to return 
strings and not bytes.

I just had to debug an error with traceback, as traceback.print_exc expects a 
file capable of handling unicode.

--
assignee: docs@python
components: Documentation
messages: 219585
nosy: Sebastian.Kreft.Deezer, docs@python
priority: normal
severity: normal
status: open
title: Add a warning section exaplaining that tempfiles are opened in binary 
mode
versions: Python 3.4

___
Python tracker 

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



[issue21638] Seeking to EOF is too inefficient!

2014-06-02 Thread Linlin Yan

New submission from Linlin Yan:

I noticed this problem when I run a Python2 program (MACS: 
http://liulab.dfci.harvard.edu/MACS/) very inefficiently on a large storage on 
a high performace server (64-bit Linux). It was much slower (more than two 
days) than running it on a normal PC (less than two hours).

After ruling out many optimizing conditions, I finally located the problem on 
the seek() function of Python2. Now I can reproduce the problem in a very 
simple example:

#!/usr/bin/python2
f = open("Input.sort.bam", "rb")
f.seek(0, 2)
f.close()

Here, the size of file 'Input.sort.bam' is 4,110,535,920 bytes. When I run the 
program with 'strace' to see the system calls on Linux:

$ strace python2 foo.py
...
open("Input.sort.bam", O_RDONLY)= 3
fstat(3, {st_mode=S_IFREG|0644, st_size=4110535920, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=4110535920, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f23d4492000
fstat(3, {st_mode=S_IFREG|0644, st_size=4110535920, ...}) = 0
lseek(3, 4110532608, SEEK_SET)  = 4110532608
read(3, 
"f\203\337<\334\350\313\315\345&T\227\211\fC\212a\260\204P\235\366\326\353\230\327>\373\361\221\357\373"...,
 3312) = 3312
close(3)= 0
...

It seems that python2 just move file cursor to a specific position (4110532608 
in this case) and read ahead the rest bytes, rather than seek to the file end 
directly. I tried to run the exact the same program on the large storage, the 
position changed to 1073741824, left 889310448 bytes to read to reach the file 
end, which reduced the performance a lot!

--
components: IO
messages: 219586
nosy: yanlinlin82
priority: normal
severity: normal
status: open
title: Seeking to EOF is too inefficient!
type: performance
versions: Python 2.7

___
Python tracker 

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



[issue21639] tracemalloc crashes with floating point exception when using StringIO

2014-06-02 Thread Claudiu.Popa

New submission from Claudiu.Popa:

Given the following code, tracemalloc crashes with:
"Floating point exception: 8 (core dumped)"

import tracemalloc
tracemalloc.start(10)
import io
io.StringIO()

The culprit is this line "assert(nelem <= PY_SIZE_MAX / elsize);" from 
tracemalloc_alloc. elsize is 0 from stringio.c, "self->buf = (Py_UCS4 
*)PyMem_Malloc(0);".
The attached patch skips the assert if elsize is 0, but I don't know if this is 
the right approach.
Thanks!

--
components: Library (Lib)
files: tracemalloc.patch
keywords: patch
messages: 219587
nosy: Claudiu.Popa, haypo
priority: normal
severity: normal
status: open
title: tracemalloc crashes with floating point exception when using StringIO
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file35450/tracemalloc.patch

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

Changes by Auke Willem Oosterhoff :


Added file: http://bugs.python.org/file35452/python_3.1.patch

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

Changes by Auke Willem Oosterhoff :


Added file: http://bugs.python.org/file35455/python_3.3.patch

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

Changes by Auke Willem Oosterhoff :


Added file: http://bugs.python.org/file35454/python_3.2.patch

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

Changes by Auke Willem Oosterhoff :


Added file: http://bugs.python.org/file35456/python_3.4.patch

___
Python tracker 

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



[issue6181] Tkinter.Listbox several minor issues

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5ab8ec8b5b5b by Serhiy Storchaka in branch '2.7':
Issue #6181: Fixed errors in tkinter.Listbox docstrings.
http://hg.python.org/cpython/rev/5ab8ec8b5b5b

New changeset 932532360578 by Serhiy Storchaka in branch '3.4':
Issue #6181: Fixed errors in tkinter.Listbox docstrings.
http://hg.python.org/cpython/rev/932532360578

New changeset bc0ac2f10aa0 by Serhiy Storchaka in branch 'default':
Issue #6181: Fixed errors in tkinter.Listbox docstrings.
http://hg.python.org/cpython/rev/bc0ac2f10aa0

--
nosy: +python-dev

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

Changes by Auke Willem Oosterhoff :


Added file: http://bugs.python.org/file35453/python_3.2.patch

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

Changes by Auke Willem Oosterhoff :


--
assignee: docs@python
components: Documentation
files: python_2.7.patch
keywords: patch
nosy: OrangeTux, docs@python
priority: normal
severity: normal
status: open
title: References to other Python version in sidebar of documentation index is 
not up to date
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file35451/python_2.7.patch

___
Python tracker 

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



[issue21640] References to other Python version in sidebar of documentation index is not up to date

2014-06-02 Thread Auke Willem Oosterhoff

New submission from Auke Willem Oosterhoff:

Most version of the documentation are labeling Python 3.4 as 'in development' 
and missing reference to Python 3.5.

--
Added file: http://bugs.python.org/file35457/python_3.5.patch

___
Python tracker 

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



[issue18292] Idle: test AutoExpand.py

2014-06-02 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file35458/test-autoexpand1.diff

___
Python tracker 

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



[issue21559] OverflowError should not happen for integer operations

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

Your second bullet item would seem to me to be the obvious interpretation of 
the docs.  This is, after all, Python, so 'integer' would refer to Python 
integers and their operations.  So I agree with Stefan that the docs are 
correct as they stand.  As he also said, there may be places where 
OverflowError is currently raised that may not be appropriate, especially since 
we are dealing with a codebase that once had Python integer operations that 
*could* overflow.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21594] asyncio.create_subprocess_exec raises OSError

2014-06-02 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +giampaolo.rodola, gvanrossum, pitrou, yselivanov

___
Python tracker 

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



[issue20800] Cannot run gui tests twice.

2014-06-02 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

>From Ned Deily's message.
>>haven't tried it recently on a Linux system

Output from a linux syste:

./python -m test  -ugui test_ttk_guionly test_ttk_guionly test_idle test_idle
[1/4] test_ttk_guionly
[2/4] test_ttk_guionly
[3/4] test_idle
[4/4] test_idle
All 4 tests OK.

So it confirms as a windows issue. Unfortunately, that's all I have to offer on 
this issue ATM.

--
nosy: +sahutd

___
Python tracker 

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



[issue21641] smtplib leaves open sockets around if SMTPResponseException is raised in __init__

2014-06-02 Thread Claudiu.Popa

Claudiu.Popa added the comment:

An alternative to this approach would be to catch the error in __init__ and 
close the socket there.

--

___
Python tracker 

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



[issue10656] "Out of tree" build fails on AIX 5.3

2014-06-02 Thread Michael Haubenwallner

Changes by Michael Haubenwallner :


--
nosy: +haubi

___
Python tracker 

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



[issue21641] smtplib leaves open sockets around if SMTPResponseException is raised in __init__

2014-06-02 Thread Claudiu.Popa

New submission from Claudiu.Popa:

Hello!

I noticed that test_smtplib raises a ResourceWarning, tracking this to this 
piece of code:

   self.assertRaises(smtplib.SMTPResponseException, smtplib.SMTP,
 HOST, self.port, 'localhost', 3)

What happens is that `SMTP.getreply` is called in `SMTP.__init__` after the 
socket was opened, but if getreply raises SMTPResponseException, the socket 
remains opened. The attached patch fixes this.

--
components: Library (Lib)
files: smtplib_resource_warning.patch
keywords: patch
messages: 219592
nosy: Claudiu.Popa
priority: normal
severity: normal
status: open
title: smtplib leaves open sockets around if SMTPResponseException is raised in 
__init__
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file35459/smtplib_resource_warning.patch

___
Python tracker 

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



[issue16189] ld_so_aix not found

2014-06-02 Thread Michael Haubenwallner

Changes by Michael Haubenwallner :


--
nosy: +haubi

___
Python tracker 

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



[issue13493] Import error with embedded python on AIX 6.1

2014-06-02 Thread Michael Haubenwallner

Changes by Michael Haubenwallner :


--
nosy: +haubi

___
Python tracker 

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



[issue14150] AIX, crash loading shared module into another process than python like operator.so results in 0509-130

2014-06-02 Thread Michael Haubenwallner

Michael Haubenwallner added the comment:

Doing it this way strictly requires runtime-linking to be enabled, to have "the 
main executable" and the module use the same runtime instance of the 
libpython${VERSION}.so symbols.

Instead, "the main executable" better should re-export the python symbols 
itself. This requires httpd to be linked with "-bE:/path/to/python.exp" linker 
flag.

--
nosy: +haubi

___
Python tracker 

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



[issue21625] help()'s more-mode is frustrating

2014-06-02 Thread eryksun

eryksun added the comment:

You can use '-P?e(END) .(q to quit)' to add (END) just on the last line. Or 
show the line count instead:

os.environ['LESS'] = '-Pline %lB?L/%L. (press h for help or q to quit)'

--

___
Python tracker 

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



[issue21625] help()'s more-mode is frustrating

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

There is also an option to make less quit if enter is pressed on the last line 
(-e/--quit-at-eof).

These more beginner friendly options could be provided by pydoc if there is no 
existing PAGER or LESS environment variable.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21631] List/Dict Combination Bug

2014-06-02 Thread Robert w

Robert w added the comment:

banner
C:\Users\r0b3\files\backuped\own_dropbox\programmierung\raymarcher0>C:\Python33\python
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.


C:\Users\r0b3\files\backuped\own_dropbox\programmierung\raymarcher0>C:\Python33\python
 bug.py
bug.py:45: SyntaxWarning: assertion is always true, perhaps remove parentheses?
  assert(False, "Should be unreachable!")



{'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', 
'11H']}, 'type': 2}INSIDE
False
False
True



{'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', 
'11H']}, 'type': 2}INSIDE
False
False
True
db


{'data': {'elements': ['83H', '0FAH', '9AH', '27H', '81H', '49H', '0CEH', 
'11H']}, 'type': 2}INSIDE
False
False
True

(and so on, some lines with the expected output, see the attached file)


Either im totaly nuts and do *something* wrong, or it is a very weird bug...
Im _not_ some random noob from the inet who doesn't know what a bugtracker is.

---
Seems to be a weird memory issue.

---

I closed the first version of the issue because i was confused between the 
words "issue" and "summaries" because issues...are bugs...

--
Added file: http://bugs.python.org/file35460/output.txt

___
Python tracker 

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



[issue21631] List/Dict Combination Bug

2014-06-02 Thread Robert w

Changes by Robert w :


--
versions: +Python 3.4

___
Python tracker 

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



[issue21561] help() on enum34 enumeration class creates only a dummy documentation

2014-06-02 Thread Ethan Furman

Ethan Furman added the comment:

I think something like the following, taken from 
http://bugs.python.org/issue19030#msg199920, shoud do the trick for something 
to test against:

class Meta(type):
def __getattr__(self, name):
if name == 'ham':
return 'spam'
return super().__getattr__(name)

class VA(metaclass=Meta):
@types.DynamicClassAttribute
def ham(self):
return 'eggs'

which should result in:

VA_instance = VA()
VA_instance.ham  # should be 'eggs'
VA.ham   # should be 'spam'

Combining all that with the DynamicClassAttribute should make a fitting test.  
Thanks, Andreas, for working on that.

--
assignee:  -> ethan.furman

___
Python tracker 

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



[issue6167] Tkinter.Scrollbar: the activate method needs to return a value, and set should take only two args

2014-06-02 Thread Jim Jewett

Jim Jewett added the comment:

I'm still not seeing why these changes are sufficiently desirable to justify 
the code churn.  Nor am I seeing test or doc changes that would explain the 
advantages of the new way, and prevent future regressions.

I agree that the changes would make the signatures better for the typical use 
cases for this particular widget -- but wouldn't they also break the common 
interface for the "set" and "activate" methods across several types of tkinter 
widget?  

If so, then instead of changing or restricting the method, it would be better 
to add examples (and maybe even an explanation) to the documentation (including 
the docstring).




In particular:

(1)  Why change actrivate's parameter from "index" to "element"?  I agree that 
"element" is a better name for the normal case, but 
https://docs.python.org/dev/library/tkinter.html#the-index-parameter
strongly suggests that "index" is more consistent with the rest of tkinter, and 
that there are use cases wehre "index" is the right name.  If that is not true, 
please say so explicitly, at least in comments.

(2)  Why change the "set" method?  I understand that a more specific signature 
is desirable, and I assume that other values would be ignored (or raise an 
exception), but the set method seems to have an existing API across several 
widgets -- and that shouldn't be broken lightly.

--

___
Python tracker 

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



[issue21631] List/Dict Combination Bug

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

You may not be a noob, but on the other hand we can't see the bug.  So your 
best bet would be to post your code to the python-list mailing list and ask for 
help refining your bug report into something we can take action on.

--

___
Python tracker 

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



[issue10652] test___all_ + test_tcl fails (Windows installed binary)

2014-06-02 Thread Zachary Ware

Zachary Ware added the comment:

As for what's actually wrong here, Hirokazu Yamamoto's diagnosis in msg123615 
(adjusted for 2.7) is correct.

Either of the last two patches I posted should work to fix this issue, but 
they're both just band-aids rather than a real, once-and-for-all fix.  #20035 
(which I need to rewrite again) will be a once-and-for-all fix for 3.5 by 
getting rid of tkinter._fix, but I'm not sure if such an invasive fix is 
appropriate for 2.7 and 3.4.  I prefer the second band-aid (import FixTk at the 
top of test_support) just because it's simpler and also prevents the 
'os.environ has been changed' warnings.

A workaround that doesn't require a patch is to just set TCL_LIBRARY manually 
in your environment before running the tests, which is how the 3.x buildbots 
are currently working (see Tools/buildbot/test.bat:4).

For the record, I'm not sure why the 3.x fix we came up with earlier in this 
issue worked, though I suspect it has something to do with _fix being part of 
the tkinter package.  The same patch fails on 2.7 because Tkinter is not a 
package; FixTk is a standalone module and is thus completely unaffected by 
support.import_fresh_module('Tkinter').  Fresh-importing FixTk itself works, 
since it's what we actually need to run.

--

___
Python tracker 

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



[issue21594] asyncio.create_subprocess_exec raises OSError

2014-06-02 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm not sure. Running out of file descriptors is really not something a
library can handle on its own -- this needs to be kicked back to the app to
handle. E.g. by pacing itself, or closing some connections, or changing the
system limit... The library really can't know what to do, and just waiting
until the condition magically clears seems asking for mysterious hangs.

On Mon, Jun 2, 2014 at 7:30 AM, STINNER Victor 
wrote:

>
> Changes by STINNER Victor :
>
>
> --
> nosy: +giampaolo.rodola, gvanrossum, pitrou, yselivanov
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue21631] List/Dict Combination Bug

2014-06-02 Thread Robert w

Robert w added the comment:

i cutted it down

=
class EnumSectionContentType(object):
DATABYTE = 2
DATADOUBLEWORD = 3
DATAWORD = 4
#LABEL = 0

def _getStringOfElements(elements):
objectFileString = ""

elements = [{'type': 2, 'data': {'elements': ['83H', '0FAH', '9AH', '27H', 
'81H', '49H', '0CEH', '11H']}}]

for iterationElement in elements:
objectFileString += "INSIDE1 "

if iterationElement["type"] == EnumSectionContentType.LABEL:
objectFileString +=  iterationElement["data"]["labelname"] + ":" + 
"\n"
elif iterationElement["type"] == EnumSectionContentType.DATABYTE:
objectFileString += "INSIDE" + "\n"

if   iterationElement["type"] == 
EnumSectionContentType.DATADOUBLEWORD:
objectFileString += objectFileString + "dd "
elif iterationElement["type"] == EnumSectionContentType.DATABYTE:
objectFileString += objectFileString + "db "

return objectFileString

print(_getStringOfElements(None))
=

I don't expect any output, I expect a exception (because LABEL is not defined)

but hell no...
i get
-
C:\Users\r0b3\Downloads>C:\Python34\python bug.py
INSIDE1 INSIDE
INSIDE1 INSIDE
db
-
C:\Users\r0b3\Downloads>C:\Python34\python
Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

--

___
Python tracker 

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



[issue21623] build ssl failed use vs2010 express

2014-06-02 Thread Zachary Ware

Zachary Ware added the comment:

The first error makes no sense to me.  What version of OpenSSL are you 
building?  How did you invoke the Python build (command line, or through the VS 
GUI)?

As for the second error, all of the VS-generated files in PCbuild have a UTF-8 
BOM, which is what the 'gbk' codec can't handle.

--

___
Python tracker 

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



[issue21623] build ssl failed use vs2010 express

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1d36bd258ee8 by Zachary Ware in branch '3.4':
Issue #21623: open pyproject.props with an explicit encoding
http://hg.python.org/cpython/rev/1d36bd258ee8

--
nosy: +python-dev

___
Python tracker 

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



[issue21631] List/Dict Combination Bug

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

I get an exception.  I think you need to be more careful with your testing.  
Please take this to python-list for further help.

--

___
Python tracker 

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



[issue21567] cannot create multipart alternative message with us-ascii charset

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

I suspect this is either related to or is a duplicate of issue 1823.

--

___
Python tracker 

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



[issue21623] build ssl failed use vs2010 express

2014-06-02 Thread Zachary Ware

Zachary Ware added the comment:

The cause of the second error should be fixed now.

--

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2014-06-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I reconsidered this in the light of #21559. getargs_b requires an integer of 
type int in range(256). A non-int properly raises TypeError.

>>> from _testcapi import getargs_b as gb
>>> gb(1.0)
Traceback (most recent call last):
  File "", line 1, in 
gb(1.0)
TypeError: integer argument expected, got float
>>> import fractions
>>> gb(fractions.Fraction(1, 1))
Traceback (most recent call last):
  File "", line 1, in 
gb(fractions.Fraction(1, 1))
TypeError: an integer is required (got type Fraction)

An out-of-range int should, it seems to me, just raise ValueError("int %d not 
in range(256)" % n). Verification of the range:

>>> gb(255)
255
>>> gb(256)
Traceback (most recent call last):
  File "", line 1, in 
gb(256)
OverflowError: unsigned byte integer is greater than maximum
>>> gb(0)
0
>>> gb(-1)
Traceback (most recent call last):
  File "", line 1, in 
gb(-1)
OverflowError: unsigned byte integer is less than minimum

The last message is wrong or contradictory. An unsigned (non-negative) int 
cannot be less than 0.

--

___
Python tracker 

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



[issue21573] Clean up turtle.py code formatting

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

A side note about tests: once a couple or three years ago I made it so that you 
could run 'make doctest' against the turtle documentation and it would work 
(displaying stuff on the screen).  There's no checking of the output, but it 
proved the examples at least executed cleanly (with the help of some 
sphinx-hidden extra code).

For whatever it is worth, they still appear to run to completion:

Document: library/turtle

1 items passed all tests:
 313 tests in default
313 tests in 1 items.
313 passed and 0 failed.
Test passed.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21559] OverflowError should not happen for integer operations

2014-06-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I was tempted to close this, but I think there is an issue that 'theme' has 
implied but not stated clearly enough. The OverflowError entry might be 
re-written as "Raised when the result of an arithmetic operation involving at 
least one non-int is too large to be represented. For pairs of ints, 
MemoryError is raised instead." This much is true. However, the clear 
implication is that a binary operation on non-ints is the only situation in 
which OverflowError is raised. But as theme has shown, it is not. In this 
sense, the doc is incomplete.

Another, unstated, situation is failure of an internal conversion from an int 
to an internal type. In #20539, #20539, the justification for switching from 
MemoryError to OverflowError when factorial input grows too large for 
conversion is that memory is then not filled. In #21444, the justification is 
history.

A third possibility is that OverflowError is used instead of ValueError when an 
int fails a simple range check. See #15988: _testcapi.getargs_b requires an int 
in range(256). -1 and 256 raise OverflowErrors. #7267 is about the same issue. 
An int not being in range(256) has nothing to do with the merging of integer 
types in 3.x.

So I think that the docs need a new sentence. Both alternatives can be 
summarized by "OverflowError may also be raised for integers that are outside a 
required range." Knowing this might help people debugging such situations.

--

___
Python tracker 

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



[issue21623] build ssl failed use vs2010 express

2014-06-02 Thread Steve Dower

Steve Dower added the comment:

Has the first log been abbreviated at all? It looks like it's trying to build 
the tests before building the library...

(Nosied Martin, since he's managed to build this version of OpenSSL with VC10 
and may have encountered this. I've only dealt with VC9 so far.)

--
nosy: +loewis

___
Python tracker 

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



[issue21533] built-in types dict docs - construct dict from iterable, not iterator

2014-06-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti, zach.ware
type:  -> enhancement

___
Python tracker 

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



[issue21623] build ssl failed use vs2010 express

2014-06-02 Thread Zachary Ware

Zachary Ware added the comment:

I will note that VC++ 2010 Express is what I use on one of my usual machines, 
and don't recall ever having this issue.

--

___
Python tracker 

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



[issue9196] Improve docs for string interpolation "%s" re Unicode strings

2014-06-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +eric.smith

___
Python tracker 

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



[issue21547] '!s' formatting documentation bug

2014-06-02 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> behavior

___
Python tracker 

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



[issue21642] "_ if 1else _" does not compile

2014-06-02 Thread Joshua Landau

New submission from Joshua Landau:

By the docs,

Except at the beginning of a logical line or in
string literals, the whitespace characters space,
tab and formfeed can be used interchangeably to
separate tokens. Whitespace is needed between two
tokens only if their concatenation could otherwise
be interpreted as a different token
(e.g., ab is one token, but a b is two tokens).

"_ if 1else _" should compile equivalently to "_ if 1 else _".

The tokenize module does this correctly:

import io
import tokenize

def print_tokens(string):
tokens = tokenize.tokenize(io.BytesIO(string.encode("utf8")).readline)  
  

for token in tokens:
print("{:12}{}".format(tokenize.tok_name[token.type], token.string))

print_tokens("_ if 1else _")
#>>> ENCODINGutf-8
#>>> NAME_
#>>> NAMEif
#>>> NUMBER  1
#>>> NAMEelse
#>>> NAME_
#>>> ENDMARKER   

but it fails when compiled with, say, "compile", "eval" or "ast.parse".

import ast

compile("_ if 1else _", "", "eval")
#>>> Traceback (most recent call last):
#>>>   File "", line 32, in 
#>>>   File "", line 1
#>>> _ if 1else _
#>>>   ^
#>>> SyntaxError: invalid token

eval("_ if 1else _")
#>>> Traceback (most recent call last):
#>>>   File "", line 40, in 
#>>>   File "", line 1
#>>> _ if 1else _
#>>>   ^
#>>> SyntaxError: invalid token

ast.parse("_ if 1else _")
#>>> Traceback (most recent call last):
#>>>   File "", line 48, in 
#>>>   File "/usr/lib/python3.4/ast.py", line 35, in parse
#>>> return compile(source, filename, mode, PyCF_ONLY_AST)
#>>>   File "", line 1
#>>> _ if 1else _
#>>>   ^
#>>> SyntaxError: invalid token

Further, some other forms work:

1 if 0b1else 0
#>>> 1

1 if 1jelse 0
#>>> 1

See


http://stackoverflow.com/questions/23998026/why-isnt-this-a-syntax-error-in-python

particularly,

http://stackoverflow.com/a/23998128/1763356

for details.

--
messages: 219614
nosy: Joshua.Landau
priority: normal
severity: normal
status: open
title: "_ if 1else _" does not compile
type: compile error
versions: Python 3.4

___
Python tracker 

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



[issue21559] OverflowError should not happen for integer operations

2014-06-02 Thread R. David Murray

R. David Murray added the comment:

"Integers are outside a required range" makes me wonder why it isn't a 
ValueError.  An OverflowError should be the result of a *computation*, IMO, not 
a bounds check.

So, maybe add your sentence with the additional phrase "for historical 
reasons"? :)

--

___
Python tracker 

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



[issue1191964] asynchronous Subprocess

2014-06-02 Thread Josiah Carlson

Josiah Carlson added the comment:

First, with the use of Overlapped IO on Windows, BlockingIOError should never 
come up, and we don't even handle that exception.

As for BrokenPipeError vs. EOF; while we do treat them more or less the same, 
we aren't killing the process or reporting that the process is dead, and we 
tell users to check the results of Popen.poll() in the docs.

Could we bubble up BrokenPipeError? Sure. Does it make sense? In the case of 
Popen.communicate(), exposing the error and changing expected behavior doesn't 
make sense.

I have implemented and would continue to lean towards continuing to hide 
BrokenPipeError on the additional API endpoints. Why? If you know that a 
non-blocking send or receive could result in BrokenPipeError, now you need to 
wrap all of your communication pieces in BrokenPipeError handlers. Does it give 
you more control? Yes. But the majority of consumers of this API (and most APIs 
in general) will experience failure and could lose critical information before 
they realize, "Oh wait, I need to wrap all of these communication pieces in 
exception handlers."

I would be open to adding either a keyword-only argument to the methods and/or 
an instance attribute to enable/disable raising of BrokenPipeErrors during the 
non-blocking calls if others think that this added level of control. I would 
lean towards an instance attribute that is defaulted to False.

--

___
Python tracker 

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



[issue21643] "File exists" error during venv --upgrade

2014-06-02 Thread Virgil Dupras

New submission from Virgil Dupras:

There seems to have been a regression in Python 3.4.1 with "pyvenv --upgrade", 
and this regression seems to be caused by #21197.

It now seems impossible to use the "--upgrade" flag without getting a "File 
exists" error. Steps to reproduce:

$ pyvenv env
$ pyvenv --upgrade env
Error: [Errno 17] File exists: '//env/lib' -> '//env/lib64'

--
components: Library (Lib)
keywords: 3.4regression
messages: 219617
nosy: vdupras, vinay.sajip
priority: normal
severity: normal
status: open
title: "File exists" error during venv --upgrade
versions: Python 3.4

___
Python tracker 

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



[issue21533] built-in types dict docs - construct dict from iterable, not iterator

2014-06-02 Thread Zachary Ware

Zachary Ware added the comment:

LGTM.

--

___
Python tracker 

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



[issue6181] Tkinter.Listbox several minor issues

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8cd7eb00894e by Serhiy Storchaka in branch '2.7':
Issue #6181: Fixed minor bugs in tkinter.Listbox methods:
http://hg.python.org/cpython/rev/8cd7eb00894e

New changeset 54a2ceacac05 by Serhiy Storchaka in branch '3.4':
Issue #6181: Fixed minor bugs in tkinter.Listbox methods:
http://hg.python.org/cpython/rev/54a2ceacac05

New changeset 3a923156ca05 by Serhiy Storchaka in branch 'default':
Issue #6181: Fixed minor bugs in tkinter.Listbox methods:
http://hg.python.org/cpython/rev/3a923156ca05

--

___
Python tracker 

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



[issue18373] implement sys.get/setbyteswarningflag()

2014-06-02 Thread Daniel Holth

Daniel Holth added the comment:

As an aside, why wouldn't I run my program with -bb?

One reason is that the following code won't work on Linux:

#!/usr/bin/env python -bb

Instead of passing -bb to Python, it will look for an executable called "python 
-bb", and it's not likely to find it.

The original reason was that I did not know about -bb.

--

___
Python tracker 

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



[issue21643] "File exists" error during venv --upgrade

2014-06-02 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue6167] Tkinter.Scrollbar: the activate method needs to return a value, and set should take only two args

2014-06-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

1. In activate, change parameter 'index' to 'element'.  I agree with Jim about 
rejecting this. A (specific). 'index' is routinely used to point to an item in 
a sequence; "arrow1", "slider", and "arrow2" are visually sequenced. The doc 
string is clear on the possible indexes Text also uses words for indexes. B 
(general). we don't break code by renaming arguments; I am pretty sure that any 
exception one might raise does not apply to this issue.

2. Give index a default of None and return the result of calling tk with None, 
instead of tossing it. I believe this enhancement would make activate more 
consistent with other methods. If so, do it -- with an added test.

3. Give .set() specific parameters. I think the current docstring is a bit 
confusing and should be revised. Am I correct in thinking that on a vertical 
slider, the upper end get the lower value, whereas the lower end gets the 
higher value? And that one should call bar.set(.3, .6) rather than bar.set(.6, 
.3)? If so, calling the parameters 'lowval' and 'hival' might be clearer.

Does msg201484 mean that tk requires exactly 2 args? If so, some change seems 
ok. Deleting 'args' cannot in itself break code as 'args' cannot be used as a 
keyword. I agree with not adding defaults,

--

___
Python tracker 

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



[issue6181] Tkinter.Listbox several minor issues

2014-06-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I divided the patch to three parts. First, obvious errors in docstrings. 
Second, minor behavior bugs. Added tests for affected methods. And I didn't 
commit third part, style changes to docstrings, because I want to update 
docstrings in separate issue.

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

___
Python tracker 

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



[issue21639] tracemalloc crashes with floating point exception when using StringIO

2014-06-02 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d87ede8da3c8 by Victor Stinner in branch '3.4':
Issue #21639: Fix name of _testcapi test functions
http://hg.python.org/cpython/rev/d87ede8da3c8

New changeset 7083634065c9 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21639: Fix name of _testcapi test functions
http://hg.python.org/cpython/rev/7083634065c9

New changeset 6f362a702242 by Victor Stinner in branch '3.4':
Issue #21639: Add a test to check that PyMem_Malloc(0) with tracemalloc enabled
http://hg.python.org/cpython/rev/6f362a702242

New changeset 1505124c0df4 by Victor Stinner in branch 'default':
Issue #21639: Fix a division by zero in tracemalloc on calloc(0, 0). The
http://hg.python.org/cpython/rev/1505124c0df4

--
nosy: +python-dev

___
Python tracker 

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



[issue21639] tracemalloc crashes with floating point exception when using StringIO

2014-06-02 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the report, it should now be fixed. The crash is a regression 
introduced by the issue #21233.

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

___
Python tracker 

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



  1   2   >