[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-30 Thread Mark Dickinson

Mark Dickinson  added the comment:

Ok, great.  I'll add the PyInt_Check back in and commit the patch, then.  I 
just wanted to check that I wasn't missing something obvious.  Thank you!

--

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-30 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16046/issue7092_test_exceptions.diff

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Cleanup test_exceptions:
 - removed "filterwarnings" for "testSlicing"

--
Added file: http://bugs.python.org/file16053/issue7092_test_exceptions_v2.diff

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-30 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16049/issue7092_silence_imports.diff

___
Python tracker 

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



[issue7767] Add PyLong_AsLongLongAndOverflow

2010-01-30 Thread Mark Dickinson

Mark Dickinson  added the comment:

Applied in r77842 (trunk), r77843 (py3k).

--
resolution:  -> accepted
status: open -> closed

___
Python tracker 

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



[issue7567] Messed up terminal after calling curses.initscr() twice.

2010-01-30 Thread Sami Zerrade

Sami Zerrade  added the comment:

This is being caused by the following 2 new lines in the initscr() function of 
Lib/curses/__init__.py:


setupterm(term=_os.environ.get("TERM", "unknown"),
fd=_sys.__stdout__.fileno())

Commenting them out will cause the behavior from version 2.5.  


In general, invoking the C curses library's setupterm() function after the C 
initscr() function has been called will cause the terminal to break the next 
time that endwin() is called.  In this particular case, the first call to the 
Python initscr() function provides the call to the C initscr() and the second 
call to Python's initscr() provides the call to setupterm().  The bug can be 
fixed by having the Python initscr() function in __init__.py make sure that 
initscr hasn't been called before making the call to setupterm().

--
nosy: +Sami.Zerrade

___
Python tracker 

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



[issue7567] Messed up terminal after calling curses.initscr() twice.

2010-01-30 Thread Sami Zerrade

Sami Zerrade  added the comment:

I'm attaching a file that patches Modules/_cursesmodule.c to make sure that 
initscr hasn't been called before invoking setupterm().  This fixes the bug for 
me; your mileage may vary.

--
keywords: +patch
Added file: http://bugs.python.org/file16054/setupterm.patch

___
Python tracker 

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



[issue7567] Messed up terminal after calling curses.initscr() twice.

2010-01-30 Thread Sami Zerrade

Changes by Sami Zerrade :


Removed file: http://bugs.python.org/file16054/setupterm.patch

___
Python tracker 

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



[issue7567] Messed up terminal after calling curses.initscr() twice.

2010-01-30 Thread Sami Zerrade

Changes by Sami Zerrade :


Added file: http://bugs.python.org/file16055/setupterm.patch

___
Python tracker 

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



[issue7810] fix_callable breakage

2010-01-30 Thread Martin v . Löwis

New submission from Martin v. Löwis :

For the attached script, 2to3 reports  
File "/tmp/lib/python3.1/lib2to3/pytree.py", line 135, in replace
assert self.parent is not None, str(self)
AssertionError: def a(self):
pass

This was originally discovered for twisted/trial/test/test_pyunitcompat.py.

--
components: 2to3 (2.x to 3.0 conversion tool)
files: a.py
messages: 98561
nosy: loewis
severity: normal
status: open
title: fix_callable breakage
versions: Python 3.1
Added file: http://bugs.python.org/file16056/a.py

___
Python tracker 

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



[issue7544] Fatal error on thread creation in low memory condition

2010-01-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I didn't test the patch but some comments:
- PyThreadState_Prealloc and PyThreadState_Init should probably be prefixed 
with an underscore, because there's no use for them outside of the interpreter
- _PyThreadState_New should be static. Besides, static functions usually don't 
get the "Py" in their name and are all lowercased, so something like 
"new_threadstate"
- the last change ("Py_InitializeEx() calls _PyGILState_Init() before 
initsite()") should be part of a separate patch (and issue?)

--

___
Python tracker 

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



[issue7544] Fatal error on thread creation in low memory condition

2010-01-30 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Oh, and besides, you can use the -R option to regrtest to find out if there are 
any reference leaks (e.g. "-R 3:2:").

--

___
Python tracker 

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



[issue7811] [decimal] ValueError -> TypeError in from_tuple

2010-01-30 Thread Stefan Krah

New submission from Stefan Krah :

As discussed privately, the following test cases should raise TypeError
(currently ValueError):

self.assertRaises(TypeError, Decimal, (0., (4, 3, 4, 9, 1), 2) )
self.assertRaises(TypeError, Decimal, (Decimal(1), (4, 3, 4, 9, 1), 2))
self.assertRaises(TypeError, Decimal, (1, (4, 3, 4, 9, 1), 0.) )
self.assertRaises(TypeError, Decimal, (1, (4, 3, 4, None, 1), 2) )
self.assertRaises(TypeError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )

--
messages: 98564
nosy: mark.dickinson, skrah
severity: normal
status: open
title: [decimal] ValueError -> TypeError in from_tuple

___
Python tracker 

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



[issue7812] Call to gestalt('sysu') on

2010-01-30 Thread Peter Hansen

Changes by Peter Hansen :


--
nosy: phansen
severity: normal
status: open
title: Call to gestalt('sysu') on
type: crash
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7812] Call to gestalt('sysu') on OSX can lead to freeze in wxPython apps

2010-01-30 Thread Peter Hansen

New submission from Peter Hansen :

In platform.mac_ver() there is a call to look up Mac version info, which 
results in a call to gestalt.gestalt('sysu').  This call is useless since, as 
documented in comments in the function the "sysu" option no longer exists, but 
the call was left in "as documentation".  

Unfortunately, as described in 
http://groups.google.com/group/wxpython-users/browse_thread/thread/ced6c57cc84cb252
 this call has the unfortunate and mysterious (but conclusively proven) side 
effect of preventing a wxPython app from running the GUI main loop in any 
thread other than the main thread (or rather, the one in which this failing 
call to gestalt() is first made).

See also http://bugs.python.org/issue780461 for some related background.

--
assignee:  -> ronaldoussoren
components: +Macintosh
nosy: +ronaldoussoren
title: Call to gestalt('sysu') on -> Call to gestalt('sysu') on OSX can lead to 
freeze in wxPython apps

___
Python tracker 

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



[issue7813] Bug of command-line module launcher

2010-01-30 Thread Pascal Chambon

New submission from Pascal Chambon :

I have a weird behaviour of the interpreter on my python2.6 win32 install : if 
I launch as __main__ the file joined below, like "python 
test_rsFileLocking.py", all works fine.
But if I put it in my PYTHONPATH (or current working directory), and launch it 
via the "-m" option of python.exe, I get this unexplanatory traceback below.
How comes the syntax analyser is not the same in both cases ? I don't what 
what, in this file, could give syntax errors in the latter case...


C:\Users\Pakal\Desktop\release26-maint\PCbuild>python.exe -m 
rstest.test_rsFileLocking
Traceback (most recent call last):
  File "C:\Users\Pakal\Desktop\release26-maint\lib\runpy.py", line 104, in 
_run_module_as_main
loader, code, fname = _get_module_details(mod_name)
  File "C:\Users\Pakal\Desktop\release26-maint\lib\runpy.py", line 85, in 
_get_module_details
code = loader.get_code(mod_name)
  File "C:\Users\Pakal\Desktop\release26-maint\lib\pkgutil.py", line 275, in 
get_code
self.code = compile(source, self.filename, 'exec')
  File "C:\Users\Pakal\Desktop\RockSolidTools\rstest\test_rsFileLocking.py", 
line 391

SyntaxError: invalid syntax

--
components: Interpreter Core
files: test_rsFileLocking.py
messages: 98566
nosy: pakal
severity: normal
status: open
title: Bug of command-line module launcher
type: compile error
versions: Python 2.6
Added file: http://bugs.python.org/file16057/test_rsFileLocking.py

___
Python tracker 

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



[issue7812] Call to gestalt('sysu') on OSX can lead to freeze in wxPython apps

2010-01-30 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
versions:  -Python 2.5

___
Python tracker 

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



[issue7814] SimpleXMLRPCServer Example uses "mul" instead of "div" in client portion

2010-01-30 Thread Michael Newman

New submission from Michael Newman :

In "20.24.1.1. SimpleXMLRPCServer Example":
http://docs.python.org/3.1/library/xmlrpc.server.html

The client portion of the example uses "mul", which does not exist in the 
server portion. The easiest fix to change the client to use "div" instead of 
"mul".

# Attempt to use client code exactly as provided:
# Python 3.1.1 (r311:74483) on win32
E:\notes\Programming\python3\lib\xmlrpc.server>py31 example1_xmlrpc_client.py
8
5
Traceback (most recent call last):
  File "example1_xmlrpc_client.py", line 11, in 
print(s.mul(5,2))  # Returns 5*2 = 10
  File "C:\python31\lib\xmlrpc\client.py", line 1029, in __call__
return self.__send(self.__name, args)
  File "C:\python31\lib\xmlrpc\client.py", line 1271, in __request
verbose=self.__verbose
  File "C:\python31\lib\xmlrpc\client.py", line 1070, in request
return self.parse_response(resp)
  File "C:\python31\lib\xmlrpc\client.py", line 1169, in parse_response
return u.close()
  File "C:\python31\lib\xmlrpc\client.py", line 673, in close
raise Fault(**self._stack[0])
xmlrpc.client.Fault: :method "mul" is not 
supported'>

To fix it, I changed this line in the client code:

print(s.mul(5,2))  # Returns 5*2 = 10

to:

print(s.div(8,2))  # Returns 8/2 = 4

# Here's how it now looks after the suggested fix:
E:\notes\Programming\python3\lib\xmlrpc.server>py31 example1_xmlrpc_client_rev1.
py
8
5
4
['add', 'div', 'pow', 'system.listMethods', 'system.methodHelp', 
'system.methodSignature']

--
assignee: georg.brandl
components: Documentation
messages: 98567
nosy: georg.brandl, mnewman
severity: normal
status: open
title: SimpleXMLRPCServer Example uses "mul" instead of "div" in client portion
versions: Python 3.1

___
Python tracker 

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



[issue7567] Messed up terminal after calling curses.initscr() twice.

2010-01-30 Thread Brian Curtin

Changes by Brian Curtin :


--
keywords: +needs review
priority:  -> normal
stage:  -> test needed
type:  -> behavior

___
Python tracker 

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



[issue7810] fix_callable breakage

2010-01-30 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This should be fixed as of r77855 and r77856.

--
nosy: +benjamin.peterson
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



[issue7813] Bug in command-line module launcher

2010-01-30 Thread R. David Murray

R. David Murray  added the comment:

This fails on 2.6 maint but works on trunk.  There have been several 
improvements to the way that that compile works in trunk, and one of those 
fixed the problem that you are seeing.  The source of the problem is the final 
line in the source file containing nothing but whitespace.  I can't find the 
bug/revision that fixed this, but I suspect it depends on issue 7468, which 
Benjamin says is not a backport candidate.  

Since the limitation on compile on 2.6 is documented (see issue 4262), this 
would be considered a runpy bug if someone was moved to fix it in 2.6.

--
nosy: +benjamin.peterson, ncoghlan, r.david.murray
priority:  -> low
stage:  -> test needed
title: Bug of command-line module launcher -> Bug in command-line module 
launcher
type: compile error -> behavior

___
Python tracker 

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



[issue7814] SimpleXMLRPCServer Example uses "mul" instead of "div" in client portion

2010-01-30 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r77857.

--
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



[issue7802] socket.gaierror before ProtocolError for xmlrpc.client

2010-01-30 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, that example was indeed wrong.  ProtocolError is not meant to be raised 
if the HTTP connection to the specified URI can't even be made, e.g. for 
unknown hosts.  Fixed in r77858.

--
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



[issue7798] document pydoc methods

2010-01-30 Thread Georg Brandl

Georg Brandl  added the comment:

Very likely, these functions are not meant to be anything but utilities.  As 
API functions, they also don't belong into pydoc.

--
assignee: georg.brandl -> 

___
Python tracker 

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



[issue7815] Regression in unittest traceback formating extensibility

2010-01-30 Thread Martin

New submission from Martin :

Prior to being split up into a package, unittest had an extensible method of 
trimming uninteresting, testing-framework related parts from tracebacks. As an 
unintended side effect, this is no longer the case, only modules actually named 
"unittest" are excluded. Code depending on the old method exists in a number of 
different projects, and there is no benefit to breaking them.

More details and discussion of this issue on python-dev can be read at:


Reverting this change is trivial, something along the lines of:

--- old/Lib/unittest/case.py
+++ new/Lib/unittest/case.py
@@ -9,7 +9,9 @@
 
 from . import result, util
 
+__unittest = True
 
+
 class SkipTest(Exception):
 """
 Raise this exception in a test to skip it.
--- old/Lib/unittest/result.py
+++ new/Lib/unittest/result.py
@@ -94,11 +94,7 @@
 return ''.join(traceback.format_exception(exctype, value, tb))
 
 def _is_relevant_tb_level(self, tb):
-globs = tb.tb_frame.f_globals
-is_relevant =  '__name__' in globs and \
-globs["__name__"].startswith("unittest")
-del globs
-return is_relevant
+return tb.tb_frame.f_globals.has_key('__unittest')
 
 def _count_relevant_tb_levels(self, tb):
 length = 0

--
components: Library (Lib)
messages: 98573
nosy: gz
severity: normal
status: open
title: Regression in unittest traceback formating extensibility
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue7733] asyncore docs reference is unclear

2010-01-30 Thread Georg Brandl

Georg Brandl  added the comment:

Would you like to contribute a patch?

--

___
Python tracker 

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



[issue7815] Regression in unittest traceback formating extensibility

2010-01-30 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy: +brian.curtin, michael.foord
priority:  -> normal
stage:  -> needs patch

___
Python tracker 

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



[issue7813] Bug in command-line module launcher

2010-01-30 Thread Pascal Chambon

Pascal Chambon  added the comment:

Allright, I guess in these conditions this bugs doesn't require a patch B-)
Thanks for the details.

--

___
Python tracker 

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



[issue7812] Call to gestalt('sysu') on OSX can lead to freeze in wxPython apps

2010-01-30 Thread Robin Dunn

Changes by Robin Dunn :


--
nosy: +robind

___
Python tracker 

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



[issue5484] subprocess.call() fails for .bat files on Windows, if executable path contains parenthesis

2010-01-30 Thread Brian Curtin

Brian Curtin  added the comment:

I'm not seeing the same thing Tim sees on 2.6, or 3.1 for that matter. Looks 
like this is still an issue.

--
nosy: +brian.curtin
priority:  -> normal
stage:  -> test needed
versions: +Python 2.6, Python 3.1 -Python 2.5

___
Python tracker 

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



[issue5677] Serious interpreter crash and/or arbitrary memory leak using .read() on writable file

2010-01-30 Thread pmpp

pmpp  added the comment:

related:
f=open('test','w+b')
f.write('123456789ABCDEF')
#f.seek(0)
print "position",f.tell()
print '[',len(f.read()),']'
f.close()

windows: 2.6.2 mingw/ 2.6.4 msvc builds
len(f.read()) > 0   ( 4081 when i did the test ) but should be 0
printing the buffer show binary garbage.

linux is ok f.read() return '' as expected

--
nosy: +pmpp
versions:  -Python 2.5

___
Python tracker 

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



[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

2010-01-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Proposed test and fix.
Please comment, there's probably room for improvement.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file16058/issue7385_memoryview.diff

___
Python tracker 

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



[issue7816] test_capi crashes when run with "-R"

2010-01-30 Thread Florent Xicluna

New submission from Florent Xicluna :

test test_capi crashed -- : PyDateTime_CAPI somehow 
initialized
1 test failed:


It was introduced in r76824.
It may be fixed with something like r72357.

--
components: Tests
messages: 98579
nosy: benjamin.peterson, flox
priority: normal
severity: normal
status: open
title: test_capi crashes when run with "-R"
type: crash
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue7816] test_capi crashes when run with "-R"

2010-01-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Patch.

--
keywords: +patch
Added file: http://bugs.python.org/file16059/issue7816_test_capi.diff

___
Python tracker 

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



[issue7816] test_capi crashes when run with "-R"

2010-01-30 Thread Florent Xicluna

Changes by Florent Xicluna :


--
stage:  -> patch review

___
Python tracker 

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



[issue7816] test_capi crashes when run with "-R"

2010-01-30 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Should be fixed in r77867.

--
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



[issue5677] Serious interpreter crash and/or arbitrary memory leak using .read() on writable file

2010-01-30 Thread Robert Xiao

Robert Xiao  added the comment:

It seems like this is actually a problem in Windows libc or something (tested 
using MinGW on Windows XP):

#include 

main() {
FILE *f = fopen("test", "wb");
fwrite("test", 1, 4, f);
char buf[2048];
size_t k = fread(buf, 1, 2048, f);
printf("%d\n", k);
int i=0;
for(; i

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



[issue7816] test_capi crashes when run with "-R"

2010-01-30 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16059/issue7816_test_capi.diff

___
Python tracker 

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



[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

2010-01-30 Thread Florent Xicluna

Changes by Florent Xicluna :


Removed file: http://bugs.python.org/file16058/issue7385_memoryview.diff

___
Python tracker 

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



[issue7385] MemoryView_FromObject crashes if PyBuffer_GetBuffer fails

2010-01-30 Thread Florent Xicluna

Florent Xicluna  added the comment:

Removed /* XXX */ code

--
Added file: http://bugs.python.org/file16060/issue7385_memoryview.diff

___
Python tracker 

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



[issue6899] Base.replace breaks tree

2010-01-30 Thread Meador Inge

Meador Inge  added the comment:

I updated the patch with a few unit tests:

euclid:trunk minge$ ./python.exe Lib/test/test_lib2to3.py

...

==
FAIL: test_replace (lib2to3.tests.test_pytree.TestNodes)
--
Traceback (most recent call last):
  File 
"/Users/minge/Research/Languages/python/trunk/Lib/lib2to3/tests/test_pytree.py",
 line 161, in test_replace
self.assertEqual(l2.parent, n1)
AssertionError: None != Node(1000, [Leaf(100, 'foo'), Leaf(100, '+'), Leaf(100, 
'bar')])

==
FAIL: test_replace_with_list (lib2to3.tests.test_pytree.TestNodes)
--
Traceback (most recent call last):
  File 
"/Users/minge/Research/Languages/python/trunk/Lib/lib2to3/tests/test_pytree.py",
 line 179, in test_replace_with_list
self.assertEqual(l1.parent, n1)
AssertionError: None != Node(1000, [Leaf(100, 'foo'), Leaf(100, '+'), Leaf(100, 
'baz'), Leaf(100, '*'), Leaf(100, '*'), Leaf(100, 'bar')])

--
Ran 541 tests in 19.328s

FAILED (failures=2)

...

euclid:trunk minge$ patch -p0 < python.patch 
patching file Lib/lib2to3/pytree.py
Hunk #1 succeeded at 132 (offset 2 lines).
Hunk #2 succeeded at 151 (offset 2 lines).

euclid:trunk minge$ ./python.exe Lib/test/test_lib2to3.py

...

--
Ran 541 tests in 19.642s

OK

--
nosy: +minge
Added file: http://bugs.python.org/file16061/issue-6899.patch

___
Python tracker 

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



[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

I'm unable to reproduce the crash. Can someone write a shorter code reproducing 
the issue? I downloaded Cython tip and applied the patch attached to this issue.

I tried py3k, py3k compiled in pydebug mode, python 3.1 branch: none crashed. 
Should I clear generated files before running a new test? If yes, how?

--
nosy: +haypo

___
Python tracker 

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



[issue3194] Demo/loop.c passing "char *" instead of "wchar_t *"

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

loop demo is still broken in py3k:
 * try to link to libpython3.0 (wrong python version)
 * there is still the argv[0] type issue

--
nosy: +haypo

___
Python tracker 

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



[issue7817] Pythonw.exe fails to start

2010-01-30 Thread Dan

New submission from Dan <10equa...@gmail.com>:

Pythonw.exe refuses to start on my Windows 7 x64 computer.  I don't get any 
kind of error message (i.e. "pythonw.exe has stopped working"), it simply 
doesn't open.  python.exe works fine.

Attached is a Windows Debugger analysis log, I can also provide a Process 
Monitor log if it would be helpful (shows all the file registry access attempts 
by the program).

--
components: Build
files: windbg-python.txt
messages: 98587
nosy: ZDan
severity: normal
status: open
title: Pythonw.exe fails to start
type: crash
versions: Python 3.1
Added file: http://bugs.python.org/file16062/windbg-python.txt

___
Python tracker 

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



[issue4340] xmlrpc.client - default 'SlowParser' not defined

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

I'm unable to reproduce the bug on py3k nor python3.1. Reopen the issue if the 
bug reappears.

--
nosy: +haypo
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue7817] Pythonw.exe fails to start

2010-01-30 Thread Dan

Dan <10equa...@gmail.com> added the comment:

I forgot to mention that this is with a brand new install of Python 3.1.1, and 
a complete uninstall / reinstall did nothing.

--

___
Python tracker 

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



[issue6409] 2to3 generates malformed diffs

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

I'm able to reproduce the bug. The problem is that "-j 4" option creates 4 
working processes, and they are all writing to stdout at the same time.

Main process: main() => refactor() => refactor_file() sends tasks to child 
processes
Children: _child() => queue.get ~> refactor_file() => processed_file() => 
print_output() writes the diff to stdout using print()

A solution would be to use a lock to ensure that only one process is writing to 
stdout at the same time... But we may loose all advantages of using different 
Python processes, it's a new kind of GIL :)

A better solution would be to send output (the whole diff for one file) to the 
main process which will be the only process writing the stdout. I don't know 
multiprocessing enough to propose a patch.

Note: flush() in each child process doesn't ensure that no process is writing 
to stdout at the same time.

--
nosy: +haypo

___
Python tracker 

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



[issue7165] xmlrpc.server assumes sys.stdout will have a buffer attribute

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

antoine's patch (fixing this issue) is commited. Can we close this issue?

--
nosy: +haypo

___
Python tracker 

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



[issue7708] test_xmlrpc fails with non-ascii path

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

This issue is a duplicate of #7606.

--

___
Python tracker 

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



[issue7606] test_xmlrpc fails with non-ascii path

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

#7608 was a duplicate issue. Copy of my message (msg98091):
-
SimpleXMLRPCRequestHandler.do_POST() writes the traceback in the HTTP header 
"X-traceback". But an HTTP header value is ASCII only, whereas a traceback can 
contain any character (eg. an non-ASCII character from a directory name for 
this issue).

A simple fix would be to use the ASCII charset with the backslashreplace error 
handler. Attached patch uses:

   trace = str(trace.encode('ASCII', 'backslashreplace'), 'ASCII')

Is there an easier method to escape non-ASCII characters without double 
conversion (unicode->bytes and bytes->unicode)?
-
I also copied my patch to this issue.

--
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file16063/xmlrpc_server_ascii_traceback.patch

___
Python tracker 

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



[issue7708] test_xmlrpc fails with non-ascii path

2010-01-30 Thread STINNER Victor

Changes by STINNER Victor :


--
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



[issue7606] test_xmlrpc fails with non-ascii path

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

pitrou> If it's only about transmitting the string representation of the
pitrou> traceback, perhaps we can simply use "replace" or "ignore" as the error
pitrou> handler?

Both replace and ignore loose information. My patch keeps all information by 
using backslashreplace. It's consistent with Python behaviour: Python writes a 
backtrace to stderr which uses also the backslashreplace error handler.

--

___
Python tracker 

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



[issue7813] Bug in command-line module launcher

2010-01-30 Thread R. David Murray

R. David Murray  added the comment:

I meant issue 7268 in my previous message.

--

___
Python tracker 

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



[issue7818] Improve set().test_c_api(): don't expect a set("abc"), modify the content

2010-01-30 Thread STINNER Victor

New submission from STINNER Victor :

test_c_api() method of a set() (only defined in pydebug mode) suppose that the 
set content is "abc". It causes assertion error if the method is called in a 
set different than set("abc").

My patch modifies the set content at the beginning of the test.

--
files: set_test_c_api.patch
keywords: patch
messages: 98596
nosy: haypo
severity: normal
status: open
title: Improve set().test_c_api(): don't expect a set("abc"), modify the content
Added file: http://bugs.python.org/file16064/set_test_c_api.patch

___
Python tracker 

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



[issue7818] Improve set().test_c_api(): don't expect a set("abc"), modify the content

2010-01-30 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Interpreter Core
type:  -> crash
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue7092] Test suite emits many DeprecationWarnings when -3 is enabled

2010-01-30 Thread Ezio Melotti

Ezio Melotti  added the comment:

The patch for bsddb3 looks good, however there's no reason (IMHO) to keep in 
the tests those "if sys.version_info[0] < 3:" or replace the version with (2,6) 
since we are already using things like assertIn that are 2.7-only. I changed it 
only to avoid warnings, and left it unchanged in other places (not related to 
this issue) and in dbtables.py (to preserve compatibility in the unlikely case 
that someone wants to try running 2.7's bsddb with older versions of Python).
Attached a new patch.

--
Added file: http://bugs.python.org/file16065/issue7092_bsddb3v2.diff

___
Python tracker 

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



[issue7819] sys.call_tracing(): check arguments type

2010-01-30 Thread STINNER Victor

New submission from STINNER Victor :

Ensure that "args" argument is a tuple. Fix the following crash:

$ python -c "import sys; sys.call_tracing(open, u'a')"
SystemError: ../Python/getargs.c:1413: bad argument to internal function

--
components: Interpreter Core
files: sys_call_tracing.patch
keywords: patch
messages: 98598
nosy: haypo
severity: normal
status: open
title: sys.call_tracing(): check arguments type
type: crash
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file16066/sys_call_tracing.patch

___
Python tracker 

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



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-30 Thread STINNER Victor

New submission from STINNER Victor :

My patch fixes check_bom() to restore all bytes in the right order if there is 
no BOM to leave the stream unchanged and to fix an assertion error in 
buf_ungetc() (raised in pydebug mode).

The current code only unget one byte (0xFF), even if two or three bytes are 
read. I suppose that check_bom() writes any non-ASCII byte, because such byte 
will raise a SyntaxError.

--
files: parser_restore_bom.patch
keywords: patch
messages: 98599
nosy: haypo
severity: normal
status: open
title: parser: restores all bytes in the right order if check_bom() fails
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file16067/parser_restore_bom.patch

___
Python tracker 

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



[issue7818] Improve set().test_c_api(): don't expect a set("abc"), modify the content

2010-01-30 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-30 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Are there test cases for this?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue7813] Bug in command-line module launcher

2010-01-30 Thread Nick Coghlan

Nick Coghlan  added the comment:

Since import and direct execution will cope with files that don't end with a 
blank line, changing the first argument to "source + '\n'" in the pkgutil 
compile call seems like a reasonable workaround for the limitation in the 2.6 
compile function.

--

___
Python tracker 

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



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-30 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file16068/parser_restore_bom-2.patch

___
Python tracker 

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



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-30 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file16067/parser_restore_bom.patch

___
Python tracker 

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



[issue7820] parser: restores all bytes in the right order if check_bom() fails

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

> Are there test cases for this?

Here you have.

--

___
Python tracker 

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



[issue7819] sys.call_tracing(): check arguments type

2010-01-30 Thread STINNER Victor

STINNER Victor  added the comment:

Before someone is asking, i wrote a new version of my patch using an unit test. 
The patch also test sys.call_tracing() with valid arguments.

--
Added file: http://bugs.python.org/file16069/sys_call_tracing-2.patch

___
Python tracker 

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



[issue7818] Improve set().test_c_api(): don't expect a set("abc"), modify the content

2010-01-30 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Will think about this.  The method was supposed to be for internal use only.  
May just rename it to _test_c_api() and add a docstring noting that it is only 
defined for "abc".  

That being said, it may be worthwhile to build-out the test to accept many 
different possible inputs and possibly do a more thorough exercised of possible 
inputs and outputs to C functions.

--
priority:  -> low

___
Python tracker 

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



[issue7809] Documentation for random module should indicate that a call to seed() is not required

2010-01-30 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

ISTM, the docs are fine in this regard.  The very long history of this module 
suggests that this is not a recurring point of confusion.

--
assignee: georg.brandl -> rhettinger
nosy: +rhettinger
status: open -> closed

___
Python tracker 

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



[issue7817] Pythonw.exe fails to start

2010-01-30 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Why do you think this is a bug? It's the whole point of pythonw.exe to not open 
any window.

--
nosy: +loewis

___
Python tracker 

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



[issue7165] xmlrpc.server assumes sys.stdout will have a buffer attribute

2010-01-30 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
stage: needs patch -> 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



[issue7821] Command line option -U not documented

2010-01-30 Thread Steven D'Aprano

New submission from Steven D'Aprano :

There is a command line switch -U (uppercase U) which is mentioned in PEP 3147 
http://www.python.org/dev/peps/pep-3147/ but doesn't appear to be documented 
anywhere.

It is listed here, but not described:

http://docs.python.org/using/cmdline.html

Nor does it appear in the output of pythonX --help for X in 2.5, 2.6 and 3.1.

--
assignee: georg.brandl
components: Documentation
messages: 98607
nosy: georg.brandl, stevenjd
severity: normal
status: open
title: Command line option -U not documented
versions: Python 2.5, Python 2.6, Python 3.1

___
Python tracker 

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



[issue7173] Cython compiler run crashes CPython 3.1.1 and 3.2

2010-01-30 Thread Stefan Behnel

Stefan Behnel  added the comment:

Looks like this is one of those bugs that run away when you look too close...

I can get it to crash reliably for me with the latest py3k branch (and all 
Python 3.x release versions) when I run the test suite completely, so here's a 
new recipe. The intention is to keep CPython from importing Cython built 
modules to make sure it's not related to the C code that Cython generates. I 
thought it was when I hit this problem ages ago (1 or 2 years?), but I can now 
assure you, it's not. To reproduce, run:

python3.2 runtests.py --no-cpp --no-pyregr --no-doctest \
  --no-fork --cython-only --no-refnanny -vv 'run\.'

The "--cython-only" switch makes sure the modules are not run through the C 
compiler, so no binary modules are built and only the pure Python code of the 
Cython compiler runs here. The output is a little badly formatted, but it 
basically prints the name of the modules it compiles and crashes after a while 
(also without the patch).

You don't have to do anything for cleanup, the test runner does that.

Writing a shorter code snippet is really not easy as there seem to be various 
things involved here, apparently including exception handling, recursion and 
generators.

--

___
Python tracker 

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