[issue12425] gettext breaks on empty plural-forms value

2013-05-31 Thread Bohuslav "Slavek" Kabrda

Changes by Bohuslav "Slavek" Kabrda :


--
nosy: +bkabrda

___
Python tracker 

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



[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok

New submission from Vajrasky Kok:

In two "test_copying" methods in Lib/test/test_collections.py, variable i is 
never used. My guess is the original test writer forgot to utilize the variable 
i.

For example, in test_copying method in TestOrderedDict class:

def test_copying(self):
# Check that ordered dicts are copyable, deepcopyable, picklable,
# and have a repr/eval round-trip
pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
od = OrderedDict(pairs)
update_test = OrderedDict()
update_test.update(od)
for i, dup in enumerate([
od.copy(),
copy.copy(od),
copy.deepcopy(od),
pickle.loads(pickle.dumps(od, 0)),
pickle.loads(pickle.dumps(od, 1)),
pickle.loads(pickle.dumps(od, 2)),
pickle.loads(pickle.dumps(od, 3)),
pickle.loads(pickle.dumps(od, -1)),
eval(repr(od)),
update_test,
OrderedDict(od),
]):
self.assertTrue(dup is not od)
self.assertEqual(dup, od)
self.assertEqual(list(dup.items()), list(od.items()))
self.assertEqual(len(dup), len(od))
self.assertEqual(type(dup), type(od))

The variable i in "for i, dup in enumerate" is never used.

The test_copying method in TestCounter class has the same problem.

In my opinion, we need to put variable i inside the message in the assert 
functions to detect which place inside the iteration the test fails.

--
components: Tests
files: test_copying.patch
keywords: patch
messages: 190393
nosy: vajrasky
priority: normal
severity: normal
status: open
title: There are unused variables in Lib/test/test_collections.py
versions: Python 3.4
Added file: http://bugs.python.org/file30432/test_copying.patch

___
Python tracker 

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



[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Perhaps it will be even better to extract loop body as a local function and 
then call it with different arguments.

def check(dup):
self.assertTrue(dup is not od)
self.assertEqual(dup, od)
...
check(od.copy())
check(copy.copy(od))
...

In this case we will see a tested case right in the traceback.

--
nosy: +ezio.melotti, michael.foord, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue18105] ElementTree writes invalid files when UTF-16 encoding is specified

2013-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For 3.3+ it was fixed in issue1767933.

--
nosy: +eli.bendersky, serhiy.storchaka
versions:  -3rd party, Python 2.6, Python 3.1, Python 3.2, Python 3.3, Python 
3.4, Python 3.5

___
Python tracker 

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



[issue10224] Build 3.x documentation using python3.x

2013-05-31 Thread Cherniavsky Beni

Cherniavsky Beni added the comment:

I was only thinking of 3.4, which will have venv and a pip bootstrapper.
Is changing the doc build / doctest in scope for minor releases of 3.3 (or even 
earlier)?

The commands I listed (using setup_distribute.py) also work with 3.3.
(But they're unsecure -- https://bitbucket.org/tarek/distribute/issue/374/)
3.2 is harder as it doesn't even have builtin venv.

--

___
Python tracker 

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



[issue18107] 'str(long)' can be made faster

2013-05-31 Thread Armin Rigo

New submission from Armin Rigo:

If you have in x some very large number, like 3**20, then the computation 
for 'str(x)' is sub-efficient.  Nathan Hurst posted to the pypy-dev mailing 
list a pure Python algo that gives the same result in 2/3rd of the time (in 
either CPython or PyPy).  We would get a similar gain by recoding this 
algorithm in C.

The mail is here: http://mail.python.org/pipermail/pypy-dev/2013-May/011433.html

--
messages: 190397
nosy: arigo
priority: normal
severity: normal
status: open
title: 'str(long)' can be made faster
type: performance

___
Python tracker 

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



[issue18107] 'str(long)' can be made faster

2013-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue3451.

--
nosy: +mark.dickinson, serhiy.storchaka
versions: +Python 3.4

___
Python tracker 

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



[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok

Vajrasky Kok added the comment:

According to R. David Murray in Python core-mentorship mailing list addressing 
me:

"It could be that the bug is that the i is not used...it may have been
intended to be used in an extended error message in the asserts, so that
it would be clear which input failed.  In any case, I think the best
fix here would probably be to use the new subtests support in unittest."

So I used subTest feature in the second patch I upload according to his advice.

What do you think? subTest can recognize where the test fails immediately as 
well. You just have to count the line in the loop.

--
Added file: http://bugs.python.org/file30433/test_copying_with_subTest.patch

___
Python tracker 

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



[issue18106] There are unused variables in Lib/test/test_collections.py

2013-05-31 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Anyway to make it complete, I upload the patch according to Storchaka's advice 
too.

May the best patch wins!

--
Added file: http://bugs.python.org/file30434/test_copying_with_def.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://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

2013-05-31 Thread Berker Peksag

Berker Peksag added the comment:

I can't reproduce it on Windows 7 with Python 3.3.2.

Attaching my test script.

Here's the output:

C:\Python33>python.exe -V
Python 3.3.2

C:\Python33>python.exe dbmopen.py

bzdew.dat exists? True
bzdew.dir exists? True
b'hello' b'there'

Could you run it and paste here the output?

--
nosy: +berker.peksag
stage:  -> test needed
Added file: http://bugs.python.org/file30435/dbmopen.py

___
Python tracker 

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



[issue744841] Python-Profiler bug: Bad call

2013-05-31 Thread Terje Wiesener

Terje Wiesener added the comment:

This bug seems to have resurfaced in newer python versions.

I have tested the file attached in the original report (prof2.py) in python 
2.6.6 and 2.7 (x86 versions) under Windows 7, and both give the same output:

c:\temp>c:\Python27\python.exe prof2.py

Exception AssertionError: AssertionError('Bad call', ('prof2.py', 19, 'h'), 
, , , ) in <
bound method C.__del__ of <__main__.C instance at 0x02342A80>> ignored
 5 function calls in 0.007 CPU seconds

   Ordered by: standard name

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
10.0000.0000.0070.007 :1()
10.0010.0010.0010.001 prof2.py:11(g)
10.0060.0060.0070.007 prof2.py:19(h)
10.0000.0000.0000.000 prof2.py:7(f)
10.0000.0000.0070.007 profile:0(h())
00.000 0.000  profile:0(profiler)

--
nosy: +Terje.Wiesener
type:  -> performance
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://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

2013-05-31 Thread Sashko Kopyl

Sashko Kopyl added the comment:

Here is the output.


*** Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 
bit (Intel)] on win32. ***
*** Remote Python engine  is active ***
>>> 
*** Remote Interpreter Reinitialized  ***
>>> 

yoqaA.dat exists? True
yoqaA.dir exists? True
b'hello' b'there'
>>> 


I would like to focus your attention, that flag "n" creates a database, but 
does not overwrite it once it is created. So in Windows case there is no 
difference between "c" and "n" flag.
You can have a look at this link where it was originally discussed.
http://stackoverflow.com/questions/16647131/how-to-empty-dbm-file-in-python-efficiently

--

___
Python tracker 

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



[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2013-05-31 Thread Colin Watson

New submission from Colin Watson:

Python 3.3 added the dir_fd and follow_symlinks keyword arguments to os.chown; 
it also added the shutil.chown function.  Unfortunately the latter, while 
useful, does not support these new keyword arguments.  It would be helpful if 
it did.

--
components: Library (Lib)
messages: 190404
nosy: cjwatson
priority: normal
severity: normal
status: open
title: shutil.chown should support dir_fd and follow_symlinks keyword arguments
versions: Python 3.3

___
Python tracker 

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



[issue15239] Abandoned Tools/unicode/mkstringprep.py

2013-05-31 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Ok, these patches all look fine. Thanks for your effort.

--

___
Python tracker 

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



[issue18107] 'str(long)' can be made faster

2013-05-31 Thread Armin Rigo

Armin Rigo added the comment:

Thanks, I missed it.  Sorry for the noise.

--
resolution:  -> duplicate
status: open -> closed

___
Python tracker 

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



[issue3451] Asymptotically faster divmod and str(long)

2013-05-31 Thread Eric V. Smith

Eric V. Smith added the comment:

See also issue18107, in particular 
http://mail.python.org/pipermail/pypy-dev/2013-May/011433.html.

--
nosy: +eric.smith

___
Python tracker 

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



[issue18093] Move main functions to a separate Programs directory

2013-05-31 Thread Zachary Ware

Zachary Ware added the comment:

I can confirm that the patch doesn't break building on Windows.

Would it make any sense to move Windows-specific sources for things like 
kill_python.exe (PCbuild/kill_python.c), make_buildinfo.exe, 
make_versioninfo.exe, py.exe (PC/launcher.c) into Programs?  Or better to keep 
them in PC or PCbuild (at least for now, until after this patch is approved)?

--
nosy: +zach.ware

___
Python tracker 

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



[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue18103] Create a GUI test framework for Idle

2013-05-31 Thread Todd Rovito

Changes by Todd Rovito :


--
nosy: +Todd.Rovito

___
Python tracker 

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



[issue18104] Idle: make human-mediated GUI tests usable

2013-05-31 Thread Todd Rovito

Changes by Todd Rovito :


--
nosy: +Todd.Rovito

___
Python tracker 

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



[issue18108] shutil.chown should support dir_fd and follow_symlinks keyword arguments

2013-05-31 Thread Hynek Schlawack

Changes by Hynek Schlawack :


--
nosy: +hynek
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue18066] Remove SGI-specific code from pty.py

2013-05-31 Thread Éric Araujo

Éric Araujo added the comment:

LGTM.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Éric Araujo

Éric Araujo added the comment:

+1

--
nosy: +eric.araujo

___
Python tracker 

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



[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 81c02d2c830d by Serhiy Storchaka in branch '3.3':
Issue #18094: test_uuid no more reports skipped tests as passed.
http://hg.python.org/cpython/rev/81c02d2c830d

New changeset ebd11a19d830 by Serhiy Storchaka in branch 'default':
Issue #18094: test_uuid no more reports skipped tests as passed.
http://hg.python.org/cpython/rev/ebd11a19d830

New changeset 6ceb5bf24da8 by Serhiy Storchaka in branch '2.7':
Issue #18094: test_uuid no more reports skipped tests as passed.
http://hg.python.org/cpython/rev/6ceb5bf24da8

--
nosy: +python-dev

___
Python tracker 

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



[issue18094] Skip tests in test_uuid not silently

2013-05-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 2.7

___
Python tracker 

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



[issue15239] Abandoned Tools/unicode/mkstringprep.py

2013-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for review. Should we regenerate Lib/stringprep.py now?

--

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread Dominik Richter

New submission from Dominik Richter:

To reproduce (tested on Arch Linux, python 3.3.2):

  sudo hostname hât
  python -c "import os; os.uname()"

produces:

  Traceback (most recent call last):
File "", line 1, in 
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: 
ordinal not in range(128)

--
components: Unicode
messages: 190413
nosy: Dominik.Richter, ezio.melotti
priority: normal
severity: normal
status: open
title: os.uname() crashes if hostname contains non-ascii characters
type: crash
versions: Python 3.3

___
Python tracker 

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



[issue18085] Verifying refcounts.dat

2013-05-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since creating refcounts.dat many functions changed their argument's types from 
`char*` to `const char*`. Here is a patch which fixes mismatches (perhaps not 
all).

refcounts.dat in 3.x contains PyInt_* functions which don't exist in 3.x.

--
keywords: +patch
Added file: http://bugs.python.org/file30436/refcounts_const_char.patch

___
Python tracker 

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



[issue18048] Merging test_pep263.py and test_coding.py

2013-05-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +easy

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

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

Changes by Charles-François Natali :


--
type: crash -> behavior

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread STINNER Victor

STINNER Victor added the comment:

I'm unable to set an non-ASCII hostname on Fedora 18 (Linux kernel 3.9.2):

$ sudo hostname hât
hostname: the specified hostname is invalid

--
nosy: +haypo

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #9377 (similar issue with the socket module).

--

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread Dmi Baranov

Dmi Baranov added the comment:

I just checked RFC952 [1] and RFC1123 [2], that host name is incorrect.
I think, you need report to Arch Linux bug-tracker.

$ sudo hostname hât
hostname: the specified hostname is invalid
$ uname -a
Linux d9frog9n-desktop 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26

[1] http://tools.ietf.org/html/rfc952
[2] http://tools.ietf.org/html/rfc1123

--
nosy: +dmi.baranov

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread Dmi Baranov

Dmi Baranov added the comment:

/offtop Dumn, sorry for duplication here, Victor. We not having websockets 
here, my page not refreshed.

--

___
Python tracker 

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



[issue17005] Add a topological sort algorithm

2013-05-31 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

+1

I had "tsort" in my own utilities library for so long that I thought it was in 
stdlib already.  I found this issue after unsuccessfully searching 
docs.python.org. :-)

I think functools will be a fine place for it.  It is somewhat related to total 
ordering and solves the problem which is common when implementing functional 
mini-languages.

Another possibility is shutil given that tsort is a standard POSIX command, 
, but I 
think this will be too obscure.

--
nosy: +belopolsky

___
Python tracker 

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



[issue18110] Nested set comprehensions in class scope fail

2013-05-31 Thread Eric Wieser

New submission from Eric Wieser:

This code:

class Sudoku(dict):
COLUMNS = [
{(x, y) for y in xrange(9)} for x in xrange(9)
]

When run on Python 2.7.5, fails with this traceback:

Traceback (most recent call last):
  File "", line 1, in 
class Sudoku(object):
  File "", line 3, in Sudoku
{(x, y) for y in xrange(9)} for x in xrange(9)
  File "", line 3, in 
{(x, y) for y in xrange(9)} for x in xrange(9)
NameError: global name 'x' is not defined

Yet `x` is clearly not a global - it's defined in the comprehension.

Running the comprehension outside of the class gives no error:

>>> [
{(x, y) for y in xrange(9)} for x in xrange(9)
]
[set([...]), ...]

Nor does using `set`:

class Sudoku(dict):
COLUMNS = [
set((x, y) for y in xrange(9)) for x in xrange(9)
]

--
components: Interpreter Core
messages: 190420
nosy: Eric.Wieser
priority: normal
severity: normal
status: open
title: Nested set comprehensions in class scope fail
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue18090] dict_contains first argument declared register, and shouldn't be

2013-05-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Guido, do you still believe in using 'register' in C code in general or in 
particular, for function arguments. Many of the uses in dictobject.c go back to 
your rev1256 and rev5396. The one that caught Larry's eye for dict_contains 
appears to be from the latter.

(Many other appearances are credited to Antoine as solipsis, though these may 
be from merges or something, and he has already said he thinks they could go.)

--
nosy: +gvanrossum, terry.reedy

___
Python tracker 

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



[issue18088] Create importlib.abc.Loader.init_module_attrs()

2013-05-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e873f2e67353 by Brett Cannon in branch 'default':
Issues #18088, 18089: Introduce
http://hg.python.org/cpython/rev/e873f2e67353

--
nosy: +python-dev

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread Dominik Richter

Dominik Richter added the comment:

@dmi.baranov: You're right, according to:
http://tools.ietf.org/html/rfc952
   ::= *["."]
::= [*[]]
http://tools.ietf.org/html/rfc1178
  Don't use non-alphanumeric characters in a name.
If you use posix definition of alphanumeric, that fits. What a shame ;)

--
resolution:  -> invalid
type: behavior -> crash

___
Python tracker 

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



[issue18089] Create importlib.abc.InspectLoader.load_module()

2013-05-31 Thread Brett Cannon

Brett Cannon added the comment:

New changeset e873f2e67353 by Brett Cannon in branch 'default':
Issues #18088, 18089: Introduce
http://hg.python.org/cpython/rev/e873f2e67353

--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18088] Create importlib.abc.Loader.init_module_attrs()

2013-05-31 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread STINNER Victor

STINNER Victor added the comment:

"""
http://tools.ietf.org/html/rfc1178
  Don't use non-alphanumeric characters in a name.
"""

This is a recommendation, it does not mean that it is forbidden. But on Fedora, 
I'm unable to set a non-ASCII hostname. Arch Linux may be different.

Python should not fail with non-ASCII hostname, but I don't know which encoding 
should be used: ascii/surrogateescape (PEP 383)? the locale encoding + 
surrogateescape error handler?

--

___
Python tracker 

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



[issue18111] Add a default argument to min & max

2013-05-31 Thread Julian Berman

New submission from Julian Berman:

This has come up a number of times I'm aware, but no one has ever written a 
patch for it as far as a quick look uncovered.

So here's one (written by Thomas Wouters but with permission to submit). 
Submitting without tests and docs, but those are incoming when I get a moment.

The justification here is mostly related to being able to call min/max on an 
iterable of unknown length when there's a sensible default (which is usually 
going to be None, but that's not the default for backwards compat obviously).

--
components: Interpreter Core
messages: 190426
nosy: Julian, twouters
priority: normal
severity: normal
status: open
title: Add a default argument to min & max
type: enhancement
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue18111] Add a default argument to min & max

2013-05-31 Thread Julian Berman

Changes by Julian Berman :


--
keywords: +patch
Added file: http://bugs.python.org/file30437/minmaxdefault.patch

___
Python tracker 

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



[issue13483] Use VirtualAlloc to allocate memory arenas

2013-05-31 Thread STINNER Victor

STINNER Victor added the comment:

I tested VirtualAlloc/VirtualFree versus malloc/free on Windows 7 SP1 64-bit. 
On my small test, when using VirtualAlloc/VirtualFree, the memory peak is lower 
(ex: 58.1 MB vs 59.0), and the memory usage is the same or sometimes lower. The 
difference is small, malloc() implementation on Windows 7 is efficient! But I 
am in favor of using VirtualAlloc/VirtualFree because it is the native API and 
the gain may be bigger on a real application.

--

I used the following script for my test:
https://bitbucket.org/haypo/misc/raw/98eb42a3ed2144141d62c75e3d07933839fe2a0c/python/python_memleak.py

I reused get_process_mem_info() code from psutil to get current and peak memory 
usage (I failed to install psutil, I don't understand why).

I also replace func() of my script with tuples.py to create many tuples.

--

Python < 3.3 wastes a lot of memory with python_memleak.py. Python 3.3 behaves 
much better thanks to the usage of mmap() on Linux, and the fixed threshold on 
64-bit (min=512 bytes, instead of 256).

--

___
Python tracker 

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



[issue18110] Nested set comprehensions in class scope fail

2013-05-31 Thread Dmi Baranov

Changes by Dmi Baranov :


--
nosy: +dmi.baranov

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread Dominik Richter

Dominik Richter added the comment:

@haypo: You're right, RFC1178 is only a recommendation. RFC952 however is 
mandatory, although it doesn't seem to define  explicitly (or at 
least i wasn't able to find it; thus referencing POSIX).

Regarding Arch Linux's hostname: It is part of the package inetutils v1.9.1-5 
[1], which is GNU inetutils packaged [2]. Unfortunately I don't know which 
encoding it uses. I agree with you: It would be great if python supported it.

fyi: I opened a bug on Arch Linux [3] (thank you Dmi for the suggestion)

[1] https://www.archlinux.org/packages/core/i686/inetutils/
[2] http://www.gnu.org/software/inetutils/
[3] https://bugs.archlinux.org/task/35580

--

___
Python tracker 

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



[issue18112] PEP 442 implementation

2013-05-31 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: Interpreter Core
hgrepos: 194
nosy: pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: PEP 442 implementation
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue3329] API for setting the memory allocator used by Python

2013-05-31 Thread STINNER Victor

STINNER Victor added the comment:

> typedef void *(*PyCCP_Malloc_t)(size_t size, void *arg, const char *file, int 
> line, const char *msg);

I don't understand the purpose of the filename and line number. Python does not 
have such information. Is it just to have the API expected by Unreal engine?

What is the message? How is it filled?

--

I'm proposing a simpler prototype:

void* (*malloc) (size_t);

Just because Python does not use or have less or more. I'm not against adding 
an arbitrary void* argument, it should not hurt, and may be required by some 
other applications or libraries.

@kristjan.jonsson: Can you adapt your tool to fit the following API?

PyAPI_FUNC(int) Py_SetAllocators(
char api,
void* (*malloc) (size_t size, void *data),
void* (*realloc) (void* ptr, size_t size, void *data),
void (*free) (void* ptr, void *data)
);

--

My pytracemalloc project hooks allocation functions and then use C Python 
functions to get the current filename and line number. No need to modify the C 
code to pass __FILE__ and __LINE__.

It can produce such summary:

2013-02-28 23:40:18: Top 5 allocations per file
#1: .../Lib/test/regrtest.py: 3998 KB
#2: .../Lib/unittest/case.py: 2343 KB
#3: .../ctypes/test/__init__.py: 513 KB
#4: .../Lib/encodings/__init__.py: 525 KB
#5: .../Lib/compiler/transformer.py: 438 KB
other: 32119 KB
Total allocated size: 39939 KB

You can also configure it to display also the line number.

https://pypi.python.org/pypi/pytracemalloc

--

___
Python tracker 

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



[issue18104] Idle: make human-mediated GUI tests usable

2013-05-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

What I want is for the tests to be discovered when they should be and not when 
they should not ;-) -- without jumping through too many hoops. I probably once 
read 'recursing into subdirectories' but forgot. I like 'h_test...' for 'human 
test ...'.

Thinking about it more, unittest does not not add much to this type of test. If 
dialogs maps dialog to test information used by h_test_dialog, then a first 
draft of testing all (there are 6 that I know of, 3 with display tests) could 
amount to
def h_test_dialogs():
  for dialog in dialogs:
h_test_dialog(dialog)
New entries to dialogs would be 'discovered' as added.

--

___
Python tracker 

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



[issue18109] os.uname() crashes if hostname contains non-ascii characters

2013-05-31 Thread R. David Murray

R. David Murray added the comment:

Issue 10097 may also have some relevant discussion, even though that issue 
originates from Windows.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18111] Add a default argument to min & max

2013-05-31 Thread R. David Murray

R. David Murray added the comment:

Issue 7153 and the discussions linked therefrom is presumably relevant here.

Do you have a concrete use case?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue18113] Memory leak in curses.panel

2013-05-31 Thread Atsuo Ishimoto

New submission from Atsuo Ishimoto:

Objects associated to the panel with panel.set_userptr() are never DECREF()ed. 
Attached file is script to reproduce the leak.

Confirmed with Python2.7/3.3.

--
files: userptr-leak.py
messages: 190433
nosy: ishimoto
priority: normal
severity: normal
status: open
title: Memory leak in curses.panel
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file30438/userptr-leak.py

___
Python tracker 

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



[issue18114] Update PyImport_ImportFrozenModuleObject() to use importlib

2013-05-31 Thread Brett Cannon

New submission from Brett Cannon:

_imp.init_frozen is not really necessary; you can implement imports entirely 
using the other frozen-related functions. Because of that it's probably better 
to simply rewrite PyImport_ImportFrozenModuleObject() to use importlib to make 
the code easier to maintain and help guarantee consistency with other code.

--
assignee: brett.cannon
components: Interpreter Core
messages: 190434
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Update PyImport_ImportFrozenModuleObject() to use importlib
type: behavior
versions: Python 3.4

___
Python tracker 

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



[issue18115] Use importlib.util.module_to_load in all loaders in importlib

2013-05-31 Thread Brett Cannon

New submission from Brett Cannon:

BuiltinImporter, FrozenImporter, and ExtensionFileLoader all have their own 
custom code to manage clearing sys.modules if something goes wrong. Should see 
if any of them would break if they used importlib.util.module_to_load. And if 
they would break thanks to any pre-existing module in sys.modules, then add a 
keyword argument to suppress creating a new module.

--
assignee: brett.cannon
components: Library (Lib)
keywords: easy
messages: 190435
nosy: brett.cannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Use importlib.util.module_to_load in all loaders in importlib
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue18065] set __path__ = [] for frozen packages

2013-05-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82db02a2e023 by Brett Cannon in branch 'default':
Issue #18065: For frozen packages set __path__ to [].
http://hg.python.org/cpython/rev/82db02a2e023

--
nosy: +python-dev

___
Python tracker 

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



[issue18065] set __path__ = [] for frozen packages

2013-05-31 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue18115] Use importlib.util.module_to_load in all loaders in importlib

2013-05-31 Thread Brett Cannon

Brett Cannon added the comment:

Turns out BuiltinImporter doesn't like having a pre-existing module, so a new 
keyword argument will be necessary to allow for only the cleanup code to run 
and not the construction of a new module.

--

___
Python tracker 

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



[issue18104] Idle: make human-mediated GUI tests usable

2013-05-31 Thread Terry J. Reedy

Terry J. Reedy added the comment:

While improving the self-test for confixSectionNameDialog.py after fixing the 
error that stopped it from running, I discovered an error in the NameOk method: 
names were not really stripped before being tested. so duplicate section names 
were erroneously accepted if initially surrounded by whitespace. After fixing 
that, I removed unneeded code, including 5 pairs of parentheses in one 
statement, and added recommended spaces. I also centered the action buttons in 
the dialog.

Attached is a drop-in replacement for the file (produced with Idle on my 
non-developement  Win7 machine, so probably with the extra line end char). I 
think it is good enough to commit, but I am curious if the instructions added 
to the test are clear enough. (The dialog is the one seen if Save as New Custom 
Theme (Highlighting tab) or Save as New Custom Key Set (Key tab) are selected 
on the Options / Preferences dialog.

For new custom test files, the root window should be open farther from the edge 
of the screen.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file30439/configSectionNameDialog.py

___
Python tracker 

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



[issue18110] Nested set comprehensions in class scope fail

2013-05-31 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> improper scope in list comprehension, when used in class 
declaration

___
Python tracker 

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



[issue13123] bdist_wininst uninstaller does not remove pycache directories

2013-05-31 Thread Matt Wilkie

Changes by Matt Wilkie :


--
nosy: +Matt.Wilkie

___
Python tracker 

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



[issue4636] bdist_wininst installer with install script raises exception

2013-05-31 Thread Matt Wilkie

Matt Wilkie added the comment:

I confirm this is happening with 3.2.4 from an installer generated in 2.7.4 
(64bit Win7, 32bit python): 
https://pypi.python.org/pypi/leo/4.11.devel-build-5802

--
nosy: +Matt.Wilkie

___
Python tracker 

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