[issue12991] Python 64-bit build on HP Itanium - Executable built successfully but modules failed with HP Compiler

2011-09-20 Thread Wong Wah Meng

Wong Wah Meng  added the comment:

I think there is something that is not working here at least for the 
instructions in build README file about setting up 4 environment variables 
required for HP Itanium 64-bit build using HP compilers. 
CC=cc
CXX=aCC
BASECFLAGS="+DD64"
LDFLAGS="+DD64 -lxnet"
When above 4 environment variables are set, the configure script will pick them 
up and build the Makefile that passes in LDFLAGS into the linker. The linker 
doesn't seem to recognize +DD64 on HP-UX. 

ld -b +DD64 -lxnet 
build/temp.hp-ux-B.11.31-ia64-2.7/home/r32813/Build/2.7.1/Python-2.7.1/Modules/mathmodule.o
 
build/temp.hp-ux-B.11.31-ia64-2.7/home/r32813/Build/2.7.1/Python-2.7.1/Modules/_math.o
 -L/usr/local/lib -lm -o build/lib.hp-ux-B.11.31-ia64-2.7/math.so
ld: Unrecognized argument: +DD64
Fatal error.

I did a workaround by only setting "CC=cc +DD64" and "CXX=aCC" and did not set 
the other 2 environment variables, and able to build python 64-bit without the 
failed modules that were due to invalid flag passed into the linker. So I am 
re-opening the issue here to see if this is something we can amend in the 
instruction of README file for HP 64-bit build using HP Compiler.

--
status: closed -> open

___
Python tracker 

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



[issue12930] reindent.py inserts spaces in multiline literals

2011-09-20 Thread Dima Tisnek

Dima Tisnek  added the comment:

Thanks Caio, your test case covers my issue; seeing these spelt out got me 
thinking, there are perhaps 3~4 different cases:

def f0():
  s = """select
some sql
from
somewhere;
-- cannot be reindented"""

def f1():
  """ Multiline 
  text docstring
  should be reindented """

def f2():
  """ should example be reindented inside docstring?
  if f2():
print "great"
  """

def f3():
  """ # should doctest be reindented inside docstring?
  >>> if f3():
  ...   print "yes"
  ... else:
  ...   print "no"
  ...
  no
  """

--

___
Python tracker 

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



[issue13004] pprint: add option to truncate sequences

2011-09-20 Thread Nick Coghlan

Changes by Nick Coghlan :


--
dependencies: +general pprint rewrite

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Nick Coghlan

Changes by Nick Coghlan :


Removed file: http://bugs.python.org/file22616/pep380-missing-docs.diff

___
Python tracker 

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-09-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Attached patch should now be complete, including the documentation for the new 
keyword-only 'file' parameter on various dis module functions.

--
Added file: 
http://bugs.python.org/file23197/issue11816_get_opinfo_branch_20110920.diff

___
Python tracker 

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



[issue12991] Python 64-bit build on HP Itanium - Executable built successfully but modules failed with HP Compiler

2011-09-20 Thread Stefan Krah

Stefan Krah  added the comment:

The README looks outdated. This isn't surprising, since probably no one
here has access to the HP compiler.

If you want to improve it, please try this:

make distclean
./configure CC=cc CFLAGS="+DD64"
make test



I don't think the linker should be invoked as 'ld'. Several sites
suggest that the HP compiler can be used a the linker front end
(in the same manner as gcc).

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/r0007656.htm

--

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Nick Coghlan

Changes by Nick Coghlan :


Added file: http://bugs.python.org/file22616/pep380-missing-docs.diff

___
Python tracker 

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



[issue5178] Add context manager for temporary directory

2011-09-20 Thread Ugra Dániel

Changes by Ugra Dániel :


--
nosy: +daniel.ugra

___
Python tracker 

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



[issue12991] Python 64-bit build on HP Itanium - Executable built successfully but modules failed with HP Compiler

2011-09-20 Thread Wong Wah Meng

Wong Wah Meng  added the comment:

Thanks! I am gonna try this out again. 

Actually I noticed this when you mentioned about using cc as the linker front 
end. 

I followed instruction in the README file, after I edited Makefile to remove 
the -O Limit 1500 line, and after python executable is built, the Makefile is 
overwritten (maybe re-generated by the compiler) again and my changes of -O and 
-Limit 1500 is added back. However that doesn't create big damage like the 
+DD64 to the linker (ld). 

I see. Since I have got HP Compiler, I will provide some updates here once I 
have a newer finding. I have submitted my question of "Why ld doesn't recognize 
+DD64" flag to HP and they are checking for me. The progress over there is 
slow. 

Thanks for your reply!

Regards,
Wah Meng

--

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

I have updated the bitbucket repo with changes to address most of Benjamin's 
review comments.

A few points of note:
- I agree in principle with the idea of splitting Yield and YieldFrom into 
distinct AST nodes, but I'd prefer to focus on getting the current 
implementation into the main repo first
- in cleaning up the handling of missing send/close/throw attributes on 
subiterators I discovered that the PyObject_CallMethod* APIs were discarding 
exception information and coercing everything to a terse AttributeError. The 
branch now changes them to allow the error reported by the underlying call to 
PyObject_GetAttr to pass through unmodified.
- the generator close() method treats an AttributeError as expected when 
looking for a close() method on the subiterator, but uses WriteUnraisable to 
deal with anything else.
- I share Benjamin's suspicion that some of the INCREF/DECREF pairs in 
genobject.c aren't actually necessary, but I don't think it's worth messing 
with them at this stage.

I haven't looked at Zbyszek's proposed doc changes at this point - the pull 
request has a lot of irrelevant line wrapping changes in it, so it makes it 
hard to review.

--

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson

New submission from Mark Dickinson :

The docstring of str.splitlines says:

splitlines(...)
S.splitlines([keepends]) -> list of strings

Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.

Currently the optional argument can only be specified positionally.  What do 
people think about also allowing this argument to be specified by keyword?  
(And applying the same change to bytes.splitlines.)

The main motivation here is readability:  in

   long_string.splitlines(keepends=True)

it's fairly clear what the boolean argument is doing.  But in

   long_string.splitlines(True)

it's much less clear.  (This came up during a Python training class that I was 
running recently.)  I'm not advocating making the argument keyword-only;  just 
allowing those who want to specify it by keyword to do so.

There are many other str methods that don't accept keyword arguments, but it's 
only this one where I think readability would really benefit.

--
components: Interpreter Core
messages: 144326
nosy: mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: Allow keyword argument in str.splitlines()
type: feature request
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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson

Mark Dickinson  added the comment:

> (And applying the same change to bytes.splitlines.)

Oh, and bytearray.splitlines, too.

--

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Alex Gaynor

Alex Gaynor  added the comment:

Personally, I regard every C function which, for obscure internal details, 
doesn't take keyword arguments as a sad bug, which should of course be fixed :)

--
nosy: +alex

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Meador Inge

Meador Inge  added the comment:

+1; the keyword arg version is much more readable.

--
nosy: +meador.inge

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-09-20 Thread Meador Inge

Changes by Meador Inge :


--
stage:  -> patch review

___
Python tracker 

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



[issue13008] syntax error when pasting valid snippet into console without empty string after the function def

2011-09-20 Thread Meador Inge

Changes by Meador Inge :


--
nosy: +meador.inge

___
Python tracker 

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



[issue13013] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PyTuple_Pack is not freed on one error path.

--
files: python_patch1
messages: 144330
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23198/python_patch1

___
Python tracker 

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



[issue13014] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PyList_New is not freed on one error path.

--
files: python_patch2
messages: 144331
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23199/python_patch2

___
Python tracker 

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



[issue13015] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PyDict_Type.tp_repr is not freed on one error 
path.

--
files: python_patch3
messages: 144332
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23200/python_patch3

___
Python tracker 

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



[issue13016] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PySequence_Fast is not freed on one error 
path.

--
files: python_patch4
messages: 144333
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23201/python_patch4

___
Python tracker 

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



[issue13017] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using conv_content_model is not freed on one error 
path.

--
files: python_patch5
messages: 144334
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23202/python_patch5

___
Python tracker 

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



[issue13018] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PyObject_CallObjec is not freed on one
or more error paths.

--
files: python_patch6
messages: 144335
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23203/python_patch6

___
Python tracker 

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



[issue13019] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

1. Something that is allocated using PyObject_GetIter is not freed on one error 
path.
2. Something that is allocated using PyByteArray_FromStringAndSize is not freed 
on one error path

--
files: python_patch7
messages: 144336
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23204/python_patch7

___
Python tracker 

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



[issue13020] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PySequence_Fast is not freed on one error 
path.

--
files: python_patch8
messages: 144337
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23205/python_patch8

___
Python tracker 

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



[issue13021] Resource is not released before returning from the functiion

2011-09-20 Thread Suman Saha

New submission from Suman Saha :

Something that is allocated using PyUnicode_DecodeFSDefault is not freed on one 
error path.

--
files: python_patch9
messages: 144338
nosy: Suman.Saha
priority: normal
severity: normal
status: open
title: Resource is not released before returning from the functiion
type: resource usage
Added file: http://bugs.python.org/file23206/python_patch9

___
Python tracker 

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



[issue13021] Resource is not released before returning from the functiion

2011-09-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +haypo
stage:  -> patch review

___
Python tracker 

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



[issue13021] Resource is not released before returning from the functiion

2011-09-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage: patch review -> test needed

___
Python tracker 

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



[issue13020] Resource is not released before returning from the functiion

2011-09-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Hi, thanks for the report(s) and the patch(es)!
I think it would be better to have a test that shows the refleak for each of 
the patches that you submitted.
Just out of curiosity, how did you find these?

--
nosy: +ezio.melotti
stage:  -> test needed

___
Python tracker 

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



[issue13008] syntax error when pasting valid snippet into console without empty string after the function def

2011-09-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
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



[issue13021] Resource is not released before returning from the functiion

2011-09-20 Thread STINNER Victor

STINNER Victor  added the comment:

It's not me, it's Barry! (PEP 3147: 7b69e630d237)

--
nosy: +barry

___
Python tracker 

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



[issue12993] prepared statements in sqlite3 module

2011-09-20 Thread Mayur & Angela Patel-Lam

Mayur & Angela Patel-Lam  added the comment:

Okay, I missed that in the documentation.  I was looking for a handle to a
prepared statement.  I suppose it's hashing on the text of the SQL statement
to determine equivalence?

I'm willing to retract the request.  I need to restructure my code a little
bit to take advantage of this feature.

On Sat, Sep 17, 2011 at 5:47 PM, poq  wrote:

>
> poq  added the comment:
>
> The sqlite3 module already uses prepared statements. Quoting from the
> documentation:
>
> "The sqlite3 module internally uses a statement cache to avoid SQL parsing
> overhead. If you want to explicitly set the number of statements that are
> cached for the connection, you can set the cached_statements parameter. The
> currently implemented default is to cache 100 statements."
>
> --
> nosy: +poq
>
> ___
> Python tracker 
> 
> ___
>

--
Added file: http://bugs.python.org/file23207/unnamed

___
Python tracker 

___Okay, I missed that in the documentation.  I was looking for a handle to a 
prepared statement.  I suppose it's hashing on the text of the SQL 
statement to determine equivalence?I'm willing to retract the 
request.  I need to restructure my code a little bit to take advantage of this 
feature.
On Sat, Sep 17, 2011 at 5:47 PM, poq rep...@bugs.python.org> 
wrote:

poq p...@gmx.com> added the 
comment:

The sqlite3 module already uses prepared statements. Quoting from the 
documentation:

"The sqlite3 module internally uses a statement cache to avoid SQL parsing 
overhead. If you want to explicitly set the number of statements that are 
cached for the connection, you can set the cached_statements parameter. The 
currently implemented default is to cache 100 statements."


--
nosy: +poq

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

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



[issue12996] multiprocessing.Connection endianness issue

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9c1c81d24e23 by Charles-François Natali in branch 'default':
Issue #12996: multiprocessing.connection: transmit the header in network byte
http://hg.python.org/cpython/rev/9c1c81d24e23

--
nosy: +python-dev

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson

Mark Dickinson  added the comment:

Here's a patch.

--
keywords: +patch
Added file: http://bugs.python.org/file23208/issue13012.patch

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue13021] Resource is not released before returning from the functiion

2011-09-20 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Suman, good eye, confirmed!  Thanks for the patch, I'll commit this to 3.2 and 
3.3.

--
assignee:  -> barry

___
Python tracker 

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



[issue12996] multiprocessing.Connection endianness issue

2011-09-20 Thread Charles-François Natali

Changes by Charles-François Natali :


--
resolution:  -> fixed
stage: patch review -> 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



[issue12981] rewrite multiprocessing (senfd|recvfd) in Python

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1d91a3ba5c87 by Charles-François Natali in branch 'default':
Issue #12981: test_multiprocessing: catch ImportError when importing
http://hg.python.org/cpython/rev/1d91a3ba5c87

--
nosy: +python-dev

___
Python tracker 

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



[issue12981] rewrite multiprocessing (senfd|recvfd) in Python

2011-09-20 Thread Charles-François Natali

Charles-François Natali  added the comment:

I committed the patch to catch the ImportError in test_multiprocessing.
I'll commit the other patch (pure Python version) in a couple days.

> Ah, no, you're right - that's fine.  Sorry for the false alarm.

No problem. As they say, "better safe than sorry".

--

___
Python tracker 

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



[issue13013] Resource is not released before returning from the functiion

2011-09-20 Thread Mark Dickinson

Changes by Mark Dickinson :


--
components: +ctypes

___
Python tracker 

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



[issue12961] itertools: unlabelled balls in boxes

2011-09-20 Thread Phillip Feldman

Phillip Feldman  added the comment:

Mark: I disagree with your claim that "in its basic form, this is covered by 
itertools.combinations".  If you open the attached text on elementary 
combinatorics and go to page 11, you will see a table that lays out six of the 
eight most basic types of occupancy problem.  Note that only two of the six are 
handled by itertools.combinations.

--
Added file: http://bugs.python.org/file23209/math-408-notes-b.pdf

___
Python tracker 

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



[issue13021] Resource is not released before returning from the function

2011-09-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
title: Resource is not released before returning from the functiion -> Resource 
is not released before returning from the function

___
Python tracker 

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



[issue13021] Resource is not released before returning from the function

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 7a48e98915f2 by Barry Warsaw in branch '3.2':
- Issue #13021: Missing decref on an error path.  Thanks to Suman Saha for
http://hg.python.org/cpython/rev/7a48e98915f2

New changeset ad0804d3dbd0 by Barry Warsaw in branch 'default':
- Issue #13021: Missing decref on an error path.  Thanks to Suman Saha for
http://hg.python.org/cpython/rev/ad0804d3dbd0

--
nosy: +python-dev

___
Python tracker 

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



[issue12961] itertools: unlabelled balls in boxes

2011-09-20 Thread Mark Dickinson

Mark Dickinson  added the comment:

> Mark: I disagree ...

Okay, I misunderstood.  I thought you were still talking about the unlabelled 
balls in labelled boxes problem, which is an isomorphic problem to that solved 
by combinations_with_replacement.

It looks as though you're now widening the scope of your proposal.  Please 
could you give clear descriptions of exactly what functionality you're 
proposing to add?

--

___
Python tracker 

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



[issue13021] Resource is not released before returning from the function

2011-09-20 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Zbyszek Szmek  added the comment:

Here are the un-reflowed documentation changes, as a patch this time. I've 
split the changes in two:
0001 is the real documentation change
0002 is the link fixes [optional].

--
Added file: 
http://bugs.python.org/file23210/0001-Document-the-yield-from-syntax-and-StopIteration-ret.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Added file: 
http://bugs.python.org/file23211/0002-Fix-references-to-__next__-__iter__-and-nearby-refer.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Removed file: 
http://bugs.python.org/file23210/0001-Document-the-yield-from-syntax-and-StopIteration-ret.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Removed file: 
http://bugs.python.org/file23211/0002-Fix-references-to-__next__-__iter__-and-nearby-refer.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Added file: 
http://bugs.python.org/file23212/0001-Document-the-yield-from-syntax-and-StopIteration-ret.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Added file: 
http://bugs.python.org/file23213/0002-Fix-references-to-__next__-__iter__-and-nearby-refer.patch

___
Python tracker 

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



[issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received

2011-09-20 Thread David Watson

New submission from David Watson :

The function _multiprocessing.recvfd() calls recvmsg() and
expects to receive a file descriptor in an SCM_RIGHTS control
message, but doesn't check that such a control message is
actually present.  So if the sender sends data without an
accompanying file descriptor, recvfd() will the return the
integer value of the uninitialized CMSG_DATA() buffer.

The attached recvfd-check.diff checks for a complete control
message of the correct type, and raises RuntimeError if it isn't
there.  This matches the behaviour of the proposed pure-Python
implementation at issue #12981.

The patch includes a test case, but like the other recently-added
tests for the function, it isn't guarded against
multiprocessing.reduction being unavailable.  Issue #12981 has a
patch "skip_reduction.diff" (already in 3.3) to fix this, and I'm
attaching recvfd-skip-reduction-fix.diff to apply on top of it
and guard the new test case as well.

--
components: Extension Modules
files: recvfd-check.diff
keywords: patch
messages: 144351
nosy: baikie
priority: normal
severity: normal
status: open
title: _multiprocessing.recvfd() doesn't check that file descriptor was 
actually received
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23214/recvfd-check.diff

___
Python tracker 

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



[issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received

2011-09-20 Thread David Watson

Changes by David Watson :


Added file: http://bugs.python.org/file23215/recvfd-skip-reduction-fix.diff

___
Python tracker 

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



[issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received

2011-09-20 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +neologix

___
Python tracker 

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



[issue12981] rewrite multiprocessing (senfd|recvfd) in Python

2011-09-20 Thread David Watson

David Watson  added the comment:

On Tue 20 Sep 2011, Charles-François Natali wrote:

> I committed the patch to catch the ImportError in test_multiprocessing.

This should go in all branches, I think - see issue #13022.

--

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Removed file: 
http://bugs.python.org/file23212/0001-Document-the-yield-from-syntax-and-StopIteration-ret.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Removed file: 
http://bugs.python.org/file23213/0002-Fix-references-to-__next__-__iter__-and-nearby-refer.patch

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Added file: http://bugs.python.org/file23216/0001.diff

___
Python tracker 

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



[issue11682] PEP 380 reference implementation for 3.3

2011-09-20 Thread Zbyszek Szmek

Changes by Zbyszek Szmek :


Added file: http://bugs.python.org/file23217/0002.diff

___
Python tracker 

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



[issue12806] argparse: Hybrid help text formatter

2011-09-20 Thread Denilson Figueiredo de Sá

Denilson Figueiredo de Sá  added the comment:

I was about to suggest this feature. I had the exact same need: a formatter 
that preserves newlines (and maybe whitespace), but that also automatically 
wraps the lines.

In other words, the behavior would be similar to CSS property white-space: 
pre-wrap;

--
nosy: +denilsonsa

___
Python tracker 

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



[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class

2011-09-20 Thread Denilson Figueiredo de Sá

New submission from Denilson Figueiredo de Sá :

In my script, I wanted two things at the same time:
1. Setting a formatter class so that the epilog would have the line breaks 
preserved.
2. Telling argparse to automatically display default values for all arguments.

Currently, both things are handled by the same configuration parameter: 
formatter_class
This means we can either pass argparse.RawDescriptionHelpFormatter or 
argparse.ArgumentDefaultsHelpFormatter, but not both.

I did a hackish workaround by subclassing both formatters, and passing my 
(empty) subclass to ArgumentParser. It works for now, but it might break on 
future versions.

The ideal solution, however, would have a native support for both features, or 
at least explicitly allowing subclassing.
Maybe ArgumentDefaultsHelpFormatter could be transformed into a simple boolean 
parameter passed to ArgumentParser object (and maybe also passed to 
add_argument() method), instead of being a formatter class.

--
components: Library (Lib)
messages: 144354
nosy: denilsonsa
priority: normal
severity: normal
status: open
title: argparse should allow displaying argument default values in addition to 
setting a formatter class
type: feature request
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue12961] itertools: unlabelled balls in boxes

2011-09-20 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Any additions would need to be motivated by real world problems.  The issue is 
that adding more generators makes the module harder to learn and remember, so 
tools are not usually added "for the sake of completeness".

--

___
Python tracker 

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



[issue13024] cgitb uses stdout encoding

2011-09-20 Thread STINNER Victor

New submission from STINNER Victor :

cgitb module writes its output to sys.stdout by default and so encode its HTML 
document into stdout encoding, whereas it doesn't specify the HTML encoding.

Moreover it uses stdout error handler. If the locale encoding is ASCII whereas 
a filename in the traceback contains a non-ASCII character, it fails to encode 
the non-ASCII characters. Another error handler should be used, 
xmlcharrefreplace is a good candidate.

To reproduce this issue, use the following script with ASCII locale encoding 
and a non-ASCII character in name of the current directory:
---
import cgitb
cgitb.enable()
raise ValueError("Hello World")
---

Attached patch uses a workaround similar to the one used in Log._log() from 
distutils.logging.

--
components: Library (Lib)
files: cgitb.patch
keywords: patch
messages: 144356
nosy: haypo
priority: normal
severity: normal
status: open
title: cgitb uses stdout encoding
versions: Python 3.3
Added file: http://bugs.python.org/file23218/cgitb.patch

___
Python tracker 

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



[issue13025] mimetypes should read the rule file using UTF-8, not the locale encoding

2011-09-20 Thread STINNER Victor

New submission from STINNER Victor :

On Debian and Ubuntu, /etc/mime.types file is pure ASCII, but on Fedora 15 it 
contains a non-ASCII character, ³ (U+00B3), in the line:
"application/vnd.geocube+xml g3 g³"

And the file is encoded in UTF-8.

That's why Python should read this file from UTF-8 instead of the locale 
encoding, because the locale encoding can be ASCII. Attached patch implements 
this idead.

I think that it is a bug and so it should also be fixed in Python 3.2.

(Python 2.7 reads the file in binary mode, it doesn't care of the encoding.)

--
files: mimetypes_encoding.patch
keywords: patch
messages: 144357
nosy: haypo, sandro.tosi, terry.reedy
priority: normal
severity: normal
status: open
title: mimetypes should read the rule file using UTF-8, not the locale encoding
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23219/mimetypes_encoding.patch

___
Python tracker 

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



[issue13025] mimetypes should read the rule file using UTF-8, not the locale encoding

2011-09-20 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Library (Lib), Unicode

___
Python tracker 

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



[issue13024] cgitb uses stdout encoding

2011-09-20 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Unicode
nosy: +georg.brandl

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

LGTM

--

___
Python tracker 

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



[issue1172711] long long support for array module

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 15659e0e2b2e by Meador Inge in branch 'default':
Issue #1172711: Add 'long long' support to the array module.
http://hg.python.org/cpython/rev/15659e0e2b2e

--
nosy: +python-dev

___
Python tracker 

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



[issue1172711] long long support for array module

2011-09-20 Thread Meador Inge

Changes by Meador Inge :


--
resolution:  -> fixed
stage: patch review -> 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



[issue1172711] long long support for array module

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3c56e546dc60 by Victor Stinner in branch 'default':
Issue #1172711: Update What's New in Python 3.3 document for the struct module
http://hg.python.org/cpython/rev/3c56e546dc60

--

___
Python tracker 

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-20 Thread Meador Inge

Meador Inge  added the comment:

Patch looks good.  I noticed a change in the conventional type for 
'keepends' from 'int' to 'bool'.  Several unit tests were updated to 
match this change.  Perhaps other call sites should be updated too?  A 
little greping shows:

$ grep -Rl 'splitlines(0)' * --include='*.py'
Doc/tools/docutils/writers/newlatex2e/__init__.py
$ grep -Rl 'splitlines(1)' * --include='*.py'
Doc/tools/sphinx/pycode/pgen2/tokenize.py
Doc/tools/docutils/readers/python/moduleparser.py
Lib/test/test_tokenize.py
Lib/difflib.py
Lib/lib2to3/pgen2/tokenize.py
Lib/codecs.py

--

___
Python tracker 

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



[issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received

2011-09-20 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
assignee:  -> jcea
nosy: +jcea

___
Python tracker 

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



[issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 21e7a55cb943 by Jesus Cea in branch '2.7':
Close #13022: _multiprocessing.recvfd() doesn't check that file descriptor was 
actually received
http://hg.python.org/cpython/rev/21e7a55cb943

New changeset 447770470d00 by Jesus Cea in branch '3.2':
Close #13022: _multiprocessing.recvfd() doesn't check that file descriptor was 
actually received
http://hg.python.org/cpython/rev/447770470d00

New changeset 74434cff2c90 by Jesus Cea in branch 'default':
Close #13022: _multiprocessing.recvfd() doesn't check that file descriptor was 
actually received
http://hg.python.org/cpython/rev/74434cff2c90

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> 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



[issue13013] Resource is not released before returning from the functiion

2011-09-20 Thread Meador Inge

Meador Inge  added the comment:

I'll take this one.

Suman, thanks for finding this.  It will help in the future if you don't
open a ton of bugs with the *exact* same title.  They are harder to 
filter and keep track of that way.

--
assignee:  -> meador.inge
nosy: +meador.inge
stage:  -> test needed
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



[issue1172711] long long support for array module

2011-09-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 672b63aff0f4 by Meador Inge in branch 'default':
Issue #1172711: Update What's New in Python 3.3 document for the array module.
http://hg.python.org/cpython/rev/672b63aff0f4

--

___
Python tracker 

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



[issue13004] pprint: add option to truncate sequences

2011-09-20 Thread Steven Samuel Cole

Steven Samuel Cole  added the comment:

@anand: as the names say, the depth parameter limits the depth of display while 
the length parameter limits the length.

for example, with a data structure of a list of lists of lists and a depth of 
2, only the first two levels would be shown, the third list at the 'bottom' 
would be replaced by '...'

on the other hand, in a list with 10 entries and a length parameter of 5, only 
5 list entries would be displayed.

@Raymond: agreed. i have squeezed max_len into the existing code and ported 
that back to 2.6 for my current project; while it works, it is a bad hack. i 
would much more prefer bundling efforts into an extensible pprint rewrite.

--

___
Python tracker 

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



[issue7434] general pprint rewrite

2011-09-20 Thread Steven Samuel Cole

Changes by Steven Samuel Cole :


--
nosy: +ssc

___
Python tracker 

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



[issue12961] itertools: unlabelled balls in boxes

2011-09-20 Thread Phillip Feldman

Phillip Feldman  added the comment:

Ideally, I'd like to see support for all combinations of the following 
occupancy problem features:

- Labeled and unlabeled boxes
- Labeled and unlabeled balls
- Empty boxes allowed and empty boxes forbidden
- Boxes with no capacity limits and with capacity limits

There are 2^4= 16 combinations in total.  As has been previously noted, some of 
these can be handled with the existing toolset, but the majority cannot.

--

___
Python tracker 

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



[issue12961] itertools: unlabelled balls in boxes

2011-09-20 Thread Phillip Feldman

Phillip Feldman  added the comment:

With the exception of the "empty boxes forbidden" category, I've come across 
all of these at one time or another, many in the context of error control 
coding (data communications).  Much of the early work on occupancy problems was 
motivated by physics and the theory of probability, but if one does Internet 
searches on occupancy problems, it seems as though there is now more interest 
in such area as the biological sciences, genetic testing, wildlife monitoring, 
and the like.

--

___
Python tracker 

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



[issue13022] _multiprocessing.recvfd() doesn't check that file descriptor was actually received

2011-09-20 Thread Charles-François Natali

Charles-François Natali  added the comment:

> The patch includes a test case, but like the other recently-added
> tests for the function, it isn't guarded against
> multiprocessing.reduction being unavailable.  Issue #12981 has a
> patch "skip_reduction.diff" (already in 3.3) to fix this,

I'll apply skip_reduction.diff and your patch to 2.7 and 3.2.

--

___
Python tracker 

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