[issue1099] Mac compile fails with pydebug and framework enabled

2007-09-04 Thread Humberto Diogenes

New submission from Humberto Diogenes:

Running this on Mac OS X:
$ ./configure --with-pydebug --enable-framework
$ make

I get this:
(...)
ar cr libpython3.0.a Modules/config.o Modules/getpath.o Modules/main.o 
Modules/gcmodule.o 
ar cr libpython3.0.a Modules/threadmodule.o  Modules/signalmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  
Modules/_codecsmodule.o  Modules/_fileio.o  Modules/zipimport.o  
Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython3.0.a
/usr/bin/install -c -d -m 755 Python.framework/Versions/3.0
if test ; then \
gcc -o Python.framework/Versions/3.0/Python -arch i386 -arch ppc 
-dynamiclib 
\
-isysroot  \
-all_load libpython3.0.a -Wl,-single_module \
-install_name 
/Library/Frameworks/Python.framework/Versions/3.0/Python \
-compatibility_version 3.0 \
-current_version 3.0; \
else \
/usr/bin/libtool -o Python.framework/Versions/3.0/Python -dynamic  
libpython3.0.a \
 -lSystem -lSystemStubs -arch_only i386 -install_name 
/Library/Frameworks/Python.framework/Versions/3.0/Python -compatibility_version 
3.0 -
current_version 3.0 ;\
fi
ld: Undefined symbols:
___eprintf
/usr/bin/libtool: internal link edit command failed
make: *** [Python.framework/Versions/3.0/Python] Error 1

If using only --with-pydebug it works fine.

--
components: Build, Macintosh
messages: 55631
nosy: hdiogenes
severity: normal
status: open
title: Mac compile fails with pydebug and framework enabled
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1099
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1100] Can't input non-ascii characters in interactive mode

2007-09-04 Thread Sangpil Yoon

Changes by Sangpil Yoon:


--
type:  - behavior

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1100
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1100] Can't input non-ascii characters in interactive mode

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the report. This is now fixed in r57957 (although I tested it
only on Unix).

--
nosy: +loewis
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1100
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1092] Unexpected results in Tutorial about Unicode

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

The first issue (non-ASCII characters won't work in interactive mode)
was reported as issue 1100 also, and is now fixed in r57957.

As for the other issues, I'm not quite sure what to make out of them - I
see a different behavior:

py Äpfel.decode('latin-1).encode('utf-8')
  File stdin, line 1
Äpfel.decode('latin-1).encode('utf-8')
^
SyntaxError: invalid syntax

This is not surprising - 'latin-1 is missig a closing quotation mark.

I'm not sure where the indentation comes from, it is not supposed to be
there, and I don't see it on my machine.

What operating system, Python version, and interactive mode (shell or
IDLE) are you using?

[unassigning myself - the certain bug has been fixed]

--
assignee: loewis - 

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1092
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1100] Can't input non-ascii characters in interactive mode

2007-09-04 Thread Sangpil Yoon

Sangpil Yoon added the comment:

It's working fine on Windows XP. Thanks.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1100
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1374063] Broader iterable support for xmlrpclib

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I have three problems with the current form of the patch:

a) in the documentation, it should state that __dict__ is an attribute,
not a method.
b) why are you moving the subclassed-from-builtin types into the except
block? It is there to reject things that have an __dict__, but are
derived from a builtin class.
c) Notice that your subclass-from-dict example is flawed. It does have
an __dict__ attribute, but that is *not* the contents to be marshalled:

py class D(dict):pass
...
py d=D()
py d[1]=2
py d.__dict__
{}
py

Here, we would marshal an empty dict, however, the real dict has
contents to be marshalled.

IMO, it's correct to not be able to marshal dict subclasses. People
created them on purpose, and we cannot guess what that purpose was.

--
assignee: loewis - skip.montanaro

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1374063
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1626801] posixmodule.c leaks crypto context on Windows

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Ok, I added a comment in r57958

--
resolution:  - fixed
status: open - closed

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1626801
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1376361] Use 'seealso' to add examples to LibRef

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I'm closing this as out-of-date, now that the documentation format is
not based on TeX anymore. If you would like to port this to Sphinx, feel
free to reopen it (or submit any such feature as a new patch).

--
nosy: +loewis
resolution:  - out of date
status: open - closed

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1376361
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1388440] add more readline support

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the patch. Committed as r57960.

--
nosy: +loewis
versions: +Python 2.6 -Python 2.4

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1388440
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1388440] add more readline support

2007-09-04 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
resolution:  - accepted
status: open - closed

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1388440
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1374063] Broader iterable support for xmlrpclib

2007-09-04 Thread Skip Montanaro

Skip Montanaro added the comment:

Thanks for the feedback.  I will reexamine what I've got.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1374063
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1031213] Use correct encoding for printing SyntaxErrors

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the patch. It wouldn't work as-is, because it broke PGEN. I
fixed that, and committed the change as r57961 and r57962.

--
resolution:  - accepted
status: open - closed
versions: +Python 2.5, Python 2.6

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1031213] Use correct encoding for printing SyntaxErrors

2007-09-04 Thread Guido van Rossum

Guido van Rossum added the comment:

We should make sure this is *not* merged into Py3k; there, things remain
unicode until they're printed, at which point the only encoding that
matters is the output file's encoding.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1031213
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1101] Is there just no PRINT statement any more? Or it just doesn't work.

2007-09-04 Thread Richard Katz

New submission from Richard Katz:

Is there supposed to be a way to do 
  for x in 1,2,3: print x, 

If so, it's appears to be not working.  Is it just not in this release?

If not,  I would think that leaving out the print statement (just
because there is a print function) would represent a major problem for
cross-platform books and training materials.   Just a thought.  

How would one achieve this capability in Python 3.0?  Was it the
intention to remove this capability?

Thank you.

Regards,

Rich

--
components: Interpreter Core
messages: 55643
nosy: richkatz
severity: major
status: open
title: Is there just no PRINT statement any more? Or it just doesn't work.
type: behavior
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1101
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Anthony Tuininga

Changes by 
Anthony Tuininga
:


--
components: Library (Lib)
severity: normal
status: open
title: Add support for _msi.Record.GetString() and _msi.Record.GetInteger()
type: behavior
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Anthony Tuininga

New submission from 
Anthony Tuininga
:

Attached is a patch that adds the requested support. This is in relation
to the thread at

http://www.gossamer-threads.com/lists/python/python/584264

In addition to the two methods I also fixed Fetch() by ensuring that
when the records are exhausted None is returned instead of an error.

If something further is required of me or I submitted this patch
incorrectly, please let me know so I don't screw it up next time. :-)

--
nosy: +atuining

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__Index: _msi.c
===
--- _msi.c  (revision 57972)
+++ _msi.c  (working copy)
@@ -350,6 +350,34 @@
 }
 
 static PyObject*
+record_getstring(msiobj* record, PyObject *args)
+{
+int status, field, size;
+PyObject *value;
+char *data;
+
+if (!PyArg_ParseTuple(args, i:GetString, field))
+   return NULL;
+
+size = 0;
+status = MsiRecordGetString(record-h, field, , size);
+if (status != ERROR_MORE_DATA)
+return msierror(status);
+size++;
+data = PyMem_Malloc(size);
+if (!data)
+return PyErr_NoMemory();
+status = MsiRecordGetString(record-h, field, data, size);
+if (status != ERROR_SUCCESS) {
+PyMem_Free(data);
+return msierror(status);
+}
+value = PyString_FromString(data);
+PyMem_Free(data);
+return value;
+}
+
+static PyObject*
 record_setstring(msiobj* record, PyObject *args)
 {
 int status;
@@ -384,6 +412,22 @@
 }
 
 static PyObject*
+record_getinteger(msiobj* record, PyObject *args)
+{
+int field, value;
+
+if (!PyArg_ParseTuple(args, i:GetInteger, field))
+   return NULL;
+
+value = MsiRecordGetInteger(record-h, field);
+if (value != MSI_NULL_INTEGER)
+return PyInt_FromLong(value);
+
+Py_INCREF(Py_None);
+return Py_None;
+}
+
+static PyObject*
 record_setinteger(msiobj* record, PyObject *args)
 {
 int status;
@@ -405,10 +449,14 @@
 static PyMethodDef record_methods[] = {
 { GetFieldCount, (PyCFunction)record_getfieldcount, METH_NOARGS, 
PyDoc_STR(GetFieldCount() - int\nWraps MsiRecordGetFieldCount)},
+{ GetString, (PyCFunction)record_getstring, METH_VARARGS, 
+   PyDoc_STR(GetString(field) - value\nWraps MsiRecordGetString)},
 { SetString, (PyCFunction)record_setstring, METH_VARARGS, 
PyDoc_STR(SetString(field,str) - None\nWraps MsiRecordSetString)},
 { SetStream, (PyCFunction)record_setstream, METH_VARARGS, 
PyDoc_STR(SetStream(field,filename) - None\nWraps 
MsiRecordSetInteger)},
+{ GetInteger, (PyCFunction)record_getinteger, METH_VARARGS, 
+   PyDoc_STR(GetInteger(field) - value\nWraps MsiRecordGetInteger)},
 { SetInteger, (PyCFunction)record_setinteger, METH_VARARGS, 
PyDoc_STR(SetInteger(field,int) - None\nWraps MsiRecordSetInteger)},
 { ClearData, (PyCFunction)record_cleardata, METH_NOARGS, 
@@ -662,8 +710,13 @@
 int status;
 MSIHANDLE result;
 
-if ((status = MsiViewFetch(view-h, result)) != ERROR_SUCCESS)
-   return msierror(status);
+status = MsiViewFetch(view-h, result);
+if (status == ERROR_NO_MORE_ITEMS) {
+Py_INCREF(Py_None);
+return Py_None;
+}
+if (status != ERROR_SUCCESS)
+return msierror(status);
 
 return record_new(result);
 }
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Anthony Tuininga

Changes by 
Anthony Tuininga
:


--
type: behavior - 

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1103] Typo in dummy_threading documentation

2007-09-04 Thread Dan Thomasset

New submission from Dan Thomasset:

I believe that thread be threading in the line ...imported when the
thread module is not provided...?

From http://docs.python.org/lib/module-dummythreading.html

--
components: Documentation
messages: 55645
nosy: dthomasset
severity: normal
status: open
title: Typo in dummy_threading documentation

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1103
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1101] Is there just no PRINT statement any more? Or it just doesn't work.

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

What's wrong with

py for x in 1,2,3:print(x,end= )
...
1 2 3

Closing as invalid.

--
nosy: +loewis
resolution:  - invalid
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1101
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1103] Typo in dummy_threading documentation

2007-09-04 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Why do you think so? The documentation is correct as it stands;
dummy_threading should be used when thread is not present, not when
threading is not present (as threading will always be present, it just
won't import when thread is not present).

--
nosy: +loewis
resolution:  - invalid
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1103
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1102] Add support for _msi.Record.GetString() and _msi.Record.GetInteger()

2007-09-04 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
assignee:  - loewis
nosy: +loewis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1102
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1103] Typo in dummy_threading documentation

2007-09-04 Thread Dan Thomasset

Dan Thomasset added the comment:

Ahh, my mistake then.  I misunderstood what was going on.

Thanks,
 Dan

On 9/4/07, Martin v. Löwis [EMAIL PROTECTED] wrote:


 Martin v. Löwis added the comment:

 Why do you think so? The documentation is correct as it stands;
 dummy_threading should be used when thread is not present, not when
 threading is not present (as threading will always be present, it just
 won't import when thread is not present).

 --
 nosy: +loewis
 resolution:  - invalid
 status: open - closed

 __
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1103
 __


__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1103
__Ahh, my mistake then.nbsp; I misunderstood what was going 
on.brbrThanks,brnbsp;Danbrbrdivspan class=gmail_quoteOn 
9/4/07, b class=gmail_sendernameMartin v. Löwis/b lt;a 
href=mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED]/agt; wrote:/spanblockquote class=gmail_quote 
style=border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; 
padding-left: 1ex;brMartin v. Löwis added the comment:brbrWhy do you 
think so? The documentation is correct as it stands;
brdummy_threading should be used when thread is not present, not 
whenbrthreading is not present (as threading will always be present, it 
justbrwon#39;t import when thread is not 
present).brbr--brnosy: +loewis
brresolution:nbsp;nbsp;-gt; invalidbrstatus: open -gt; 
closedbrbr__brTracker lt;a 
href=mailto:[EMAIL PROTECTED][EMAIL PROTECTED]/agt;brlt;a 
href=http://bugs.python.org/issue1103;
http://bugs.python.org/issue1103/agt;br__br/blockquote/divbr

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



[issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character

2007-09-04 Thread Anthony Tuininga

New submission from 
Anthony Tuininga
:

Attached is a patch that fixes the truncation of the property values
returned by msilib.SummaryInfo.GetProperty(). Unfortunately Microsoft
has deemed it necessary to return the size of the string without the
null termination character but insists upon the size including it when
passing it in. Arggh!

--
components: Library (Lib)
files: _msi.patch2.txt
messages: 55649
nosy: atuining
severity: normal
status: open
title: msilib.SummaryInfo.GetProperty() truncates the string by one character
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1104
__Index: _msi.c
===
--- _msi.c  (revision 57972)
+++ _msi.c  (working copy)
@@ -488,7 +536,7 @@
 FILETIME fval;
 char sbuf[1000];
 char *sval = sbuf;
-DWORD ssize = sizeof(sval);
+DWORD ssize = sizeof(sbuf);
 
 if (!PyArg_ParseTuple(args, i:GetProperty, field))
return NULL;
@@ -496,7 +544,8 @@
 status = MsiSummaryInfoGetProperty(si-h, field, type, ival, 
fval, sval, ssize);
 if (status == ERROR_MORE_DATA) {
-   sval = malloc(ssize);
+ssize++;
+   sval = malloc(ssize);
 status = MsiSummaryInfoGetProperty(si-h, field, type, ival, 
fval, sval, ssize);
 }
@@ -508,7 +557,7 @@
PyErr_SetString(PyExc_NotImplementedError, FILETIME result);
return NULL;
case VT_LPSTR:
-   result = PyString_FromStringAndSize(sval, ssize);
+   result = PyString_FromString(sval);
if (sval != sbuf)
free(sval);
return result;
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1092] Unexpected results in Tutorial about Unicode

2007-09-04 Thread Vizcaynot

Vizcaynot added the comment:

Thanks about the fixing info.
In relation to the second issue, I am afraid it is my fault, the value 
of variable a was asigned and filled with a previous valid operation. 
Please forgive me for the time you spent unnecessarily. I will attempt 
to be careful in the future.  :-(

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1092
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1105] patch for readme.txt in PCbuild8

2007-09-04 Thread Ty

New submission from Ty:

This update adds some comments to the readme.txt file for PCbuild8.

When building subprojects VS2005 does not build the dependencies.  I
have included some text to alert the reader to this so they don't have
the same trouble building subprojects as I did.

I encountered this problem when building the pythoncore subproject. 
VS2005 did not build its dependencies (make_buildinfo, make_versioninfo)
for me.

--
components: Documentation
files: pcbuild8_readme_txt.patch
messages: 55651
nosy: chipped
severity: normal
status: open
title: patch for readme.txt in PCbuild8
type: compile error

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1105
__

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



[issue1583946] SSL issuer and server names cannot be parsed

2007-09-04 Thread Bill Janssen

Bill Janssen added the comment:

I've changed the return value of ssl.sslsocket.getpeercert() to return the 
issuer and subject names as tuples containing 2-element name-value 
tuples, in the same order that they appear in the certificate.  This 
should complete the fulfillment of this issue.  Please see the doc page on 
library/ssl.rst for more information.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1583946
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1106] Error in random.shuffle

2007-09-04 Thread Vizcaynot

New submission from Vizcaynot:

In python 3.0a1 under Win XP SP2:
Typing next code:

import random
s=range(10)
random.shuffle(s)

I have next error:
Traceback (most recent call last):
  File stdin, line 1, in module
  File C:\python30\lib\random.py, line 262, in shuffle
x[i], x[j] = x[j], x[i]
TypeError: 'range' object does not support item assignment

It does not happen in python 2.5

--
components: Library (Lib)
messages: 55653
nosy: Viscaynot
severity: normal
status: open
title: Error in random.shuffle
type: crash
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1106
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1107] [patch] 2to3, lambda with non-tuple argument inside parenthesis

2007-09-04 Thread Jeong-Min Lee

New submission from Jeong-Min Lee:

lambda (x): x

should be transformed to 

lambda x: x

not
lambda x1: x1[0]

--
components: Demos and Tools
files: 2to3_lambda_nontuple_param.diff
messages: 55654
nosy: falsetru, gvanrossum
severity: normal
status: open
title: [patch] 2to3, lambda with non-tuple argument inside parenthesis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1107
__Index: tests/test_fixers.py
===
--- tests/test_fixers.py	(revision 57982)
+++ tests/test_fixers.py	(working copy)
@@ -1527,6 +1527,16 @@
 s = lambda x: x + 5
 self.unchanged(s)
 
+def test_lambda_single_nontuple_argument_inside_parenthesis(self):
+b = lambda (x): x
+a = lambda x: x
+self.check(b, a)
+
+def test_lambda_single_tuple_argument_inside_parenthesis(self):
+b = lambda (x,): x
+a = lambda x1: x1[0]
+self.check(b, a)
+
 def test_lambda_simple(self):
 b = lambda (x, y): x + f(y)
 a = lambda x_y: x_y[0] + f(x_y[1])
Index: fixes/fix_tuple_params.py
===
--- fixes/fix_tuple_params.py	(revision 57982)
+++ fixes/fix_tuple_params.py	(working copy)
@@ -99,6 +99,12 @@
 body = results[body]
 
 params = find_params(args)
+if not isinstance(params, list):
+new_param = Name(params)
+new_param.set_prefix(args.get_prefix())
+args.replace(new_param.clone())
+return
+
 to_index = map_to_index(params)
 tup_name = self.new_name(tuple_name(params))
 
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1107] [patch] 2to3, lambda with non-tuple argument inside parenthesis

2007-09-04 Thread Jeong-Min Lee

Jeong-Min Lee added the comment:

I found this while 2to3ing BeautifulSoup.py.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1107
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com