[issue8194] Incompatible API change in xmlrpclib.Transport.parse_response() of Python 2.7 and 3.2

2010-12-08 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

py3k fixed in r87128

--

___
Python tracker 

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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2010-12-08 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Yet another prove of how much Tk sucks on OSX.

I'm not too happy about only binding Ctrl+, because users will expect 
that this is means that  works as well. But if we cannot disable the 
default  binding we'll have to live with this crap.

--

___
Python tracker 

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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2010-12-08 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

Oops, 's/prove/proof/'

--

___
Python tracker 

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



[issue10404] IDLE on OS X popup menus do not work: cannot set/clear breakpoints

2010-12-08 Thread Ned Deily

Ned Deily  added the comment:

It could be worse.  As I noted in Issue10405, the IDLE breakpoint facility 
appears to be officially undocumented on any platform so it's hard to know what 
users' expectations are.  And there are still Macs out there with only one 
button.  As a side note, there are still OS X X11 versions of Tkinter for 
current Python releases; for example, the default MacPorts Tk configuration is 
X11-based; it does have the advantage of working without quirks in 64-bit 
builds.

--

___
Python tracker 

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



[issue10644] socket loses data, calling send()/sendall() on invalid socket does not report error and returns all bytes as written

2010-12-08 Thread diekmann

diekmann  added the comment:

The Documentation states:

socket.sendall(bytes[, flags])¶
Send data to the socket. The socket must be connected to a remote socket. 
The optional flags argument has the same meaning as for recv() above. Unlike 
send(), this method continues to send data from bytes until either all data has 
been sent or an error occurs. None is returned on success. On error, an 
exception is raised, and there is no way to determine how much data, if any, 
was successfully sent.

This is not consistent with the results reproduced above, however, the results 
from above are exactly what should happen. Maybe there should be a remark, that 
the return value of sendall (and send) may be system dependent. Or a patch 
which enforces the documented behviour of sendall, regardless of the operating 
system would be a nice future feature?

--

___
Python tracker 

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



[issue10548] Error in setUp not reported as expectedFailure (unittest)

2010-12-08 Thread Michael Foord

Michael Foord  added the comment:

Well, the original report is here:

http://code.google.com/p/unittest-ext/issues/detail?id=21

I copied all the details provided into this issue though. Obviously the 
original reporter feels that they have a genuine use case.

There is also issue 9857 where Antoine is asking for test skipping in a 
tearDown. His use case works just as well for wanting to mark an expected fail 
in a tearDown (or a clean up function). As soon as we allow skips in tearDown / 
cleanUp functions it seems wise to also allow them in setUps for consistency 
(otherwise it becomes difficult to remember which parts of the test can skip, 
which can be expected fail etc):

http://bugs.python.org/issue9857

Raising SkipTest when in a tearDown method is reported as an error, rather than 
a skipped test.
Now doing this sounds like a weird use case, but it would be actually useful 
when you have a worker thread, and the tearDown method collects the exception 
raised in that thread and raises it again. For the worker thread to be able to 
use skipTest(), a SkipTest exception raised in tearDown should be properly 
reported as a skip.

--

___
Python tracker 

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



[issue10644] socket loses data, calling send()/sendall() on invalid socket does not report error and returns all bytes as written

2010-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> This is not consistent with the results reproduced above, however, the
> results from above are exactly what should happen. Maybe there should
> be a remark, that the return value of sendall (and send) may be system
> dependent.

Pretty much all the socket module is system-dependent, and it is
actually stated at the top of the documentation:

“Some behavior may be platform dependent, since calls are made to the
operating system socket APIs.”
http://docs.python.org/dev/library/socket.html

> Or a patch which enforces the documented behviour of sendall,
> regardless of the operating system would be a nice future feature?

How could it work?

--

___
Python tracker 

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



[issue10644] socket loses data, calling send()/sendall() on invalid socket does not report error and returns all bytes as written

2010-12-08 Thread diekmann

diekmann  added the comment:

> How could it work?
Before sending the actual data to the socket, send an empty packet to the 
socket and check if it is still alive. This may be a large performance issue on 
a lower level (if the connection is TCP, we want to wait for the ACK), but on a 
higher level, when using sendall() with larger arguments, it may be very 
convenient and the performance overhead may be barely noticeable.
I guess when using high-level functions like sendall(), the bare funcionality 
is preferred over this performance issue.

--

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2010-12-08 Thread R. David Murray

R. David Murray  added the comment:

Here is a patch that causes _assert_python to remove the refcount lines from 
stderr.

--
keywords: +patch
Added file: http://bugs.python.org/file19975/script_helper_del_refcount.patch

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2010-12-08 Thread R. David Murray

R. David Murray  added the comment:

Hmm.  Having posted that it occurs to me that it could be useful to have the 
_remove_refcount function in test.support as remove_refcount instead.

--

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2010-12-08 Thread Stefan Krah

New submission from Stefan Krah :

I'm not sure if this is a documentation issue or a bug. If watchexp=0,
quantize() also allows any number of digits:


>>> x = Decimal("6885998238912213556789006667970467609814")
>>> y = Decimal("1e2")
>>> x.quantize(y)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.2/decimal.py", line 2488, in quantize
'quantize result has too many digits for current context')
  File "/usr/local/lib/python3.2/decimal.py", line 3925, in _raise_error
raise error(explanation)
decimal.InvalidOperation: quantize result has too many digits for current 
context
>>> 
>>> x.quantize(y, watchexp=0)
Decimal('6.8859982389122135567890066679704676098E+39')

--
components: Library (Lib)
messages: 123603
nosy: mark.dickinson, rhettinger, skrah
priority: normal
severity: normal
status: open
title: decimal.py: quantize(): excess digits with watchexp=0
type: behavior
versions: 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



[issue10517] test_concurrent_futures crashes with "Fatal Python error: Invalid thread state for this thread"

2010-12-08 Thread Ray.Allen

Ray.Allen  added the comment:

Couldn't repro this on my debian 5.

--
nosy: +ysj.ray

___
Python tracker 

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



[issue8533] regrtest: use backslashreplace error handler for stdout

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Well, can this go into Python3.2?

--

___
Python tracker 

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



[issue10566] gdb debugging support additions (Tools/gdb/libpython.py)

2010-12-08 Thread Dave Malcolm

Dave Malcolm  added the comment:

This is very interesting work - thank you!

Sorry for not commenting earlier (very busy), so here are my thoughts so far.

The baseline for the diff appears to be against the py3k branch, in that it 
adds back in classes from 2.*: PyIntObject.

There's currently some deliberate divergence between the code in the 2.7 branch 
and the py3k branch.  For example, in the 2.7 branch, we pretty-print 
PyUnicodeObject instances with a u'' prefix, whereas in the py3k branch we 
pretty-print them plainly: the code is trying to mimic the underlying syntax of 
a particular version of the python language in the inferior process.  (In both 
cases though, the gdb code is for python 2)

Are you attempting to support both python 2 and python 3 (in the inferior 
process) from the same code?

Going through the individual parts of the patch:

Do the changes to "pretty_printer_lookup" slow things down, I wonder?  (It has 
to be called every time gdb print a pointer)

"py-globals" looks like a nice addition, though I feel there should be an 
abstract base class for PyLocals and PyGlobals to inherit from 
("PyNamespaceCommand", perhaps, though that sucks as a name).

The "py-break" command looks very useful  Unfortunately, AIUI we're in feature 
freeze for 3.2 now (sorry not to get to this earlier), and I have some fears 
about compatibility with all of the different versions of gdb 7 that are out 
there.  What versions of gdb have you tested this with?

_LoggingState looks interesting; getting the various versions of gdb to capture 
output as a python string can be challenging.  In particular, I've run into 
problems with buffering of large amounts of output; see: 
https://bugzilla.redhat.com/show_bug.cgi?id=620930

get_selected_inferior() clearly is impacted by gdb bugs, so I'm warying about 
merging that
Likewise for GenericCodeStepper.init_breakpoints (probably should refrain from 
swearing in comments, if nothing else, it's a dead give away that the code 
needs more work :)  I don't know if we have any rules about it, but I don't 
remember seeing such "colorful" language before in python's sources)

I notice that the selftests use skip_unless_7_2_decorator on the tests for 
py-break, py-step, py-next and py-exec.  If these commands only work on a 
sufficiently recent version of gdb, should the commands themselves also be 
wrapped in a conditional?   Either not registering them if gdb doesn't have the 
support, or perhaps registering a fallback that says "gdb not recent enough", 
or somesuch.  Part of gdb's UI is tab-completion, and it's nice for "py-[TAB]" 
to present all useful options.  That makes me think that we shouldn't register 
commands that are known to be incompatible with the running gdb version.

This is exciting work, in that gdb seems to be getting significantly more 
powerful, and the debug hooks are advancing to take advantage of it.  
Unfortunately, given that Tools/gdb/libpython.py is part of the python source 
tree, it's arguably governed by the same feature freeze rules as the rest of 
Python (e.g. no new features in 2.7).  I wonder if an exception can be made for 
it, given that this code is a support tool that runs in a different process to 
the main python build, potentially for a different major-release of python.   
(At some point we'll want to port gdb to python 3, which I'm not looking 
forward to...)

--

___
Python tracker 

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



[issue10650] decimal.py: quantize(): excess digits with watchexp=0

2010-12-08 Thread Stefan Krah

Stefan Krah  added the comment:

NaNs, however, are decapitated:

>>> x = Decimal("NaN5357671565858315212612021522416387828577")
>>> y = 0
>>> x.quantize(y, watchexp=0)
Decimal('NaN8315212612021522416387828577')

--

___
Python tracker 

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



[issue10651] chr(13) is added before chr(10) when issuing ".write" under windows

2010-12-08 Thread Vladimir K

New submission from Vladimir K :

The following code (see attached file) was intended to remove chr(13) from 
end-of-lines under Windows to make the file Unix-compliant but it always 
appends chr(13) before chr(10).

I'm under Windows XP.

--
components: IO, Windows
files: chr13remove.py
messages: 123608
nosy: KZM
priority: normal
severity: normal
status: open
title: chr(13) is added before chr(10) when issuing ".write" under windows
versions: Python 2.7
Added file: http://bugs.python.org/file19976/chr13remove.py

___
Python tracker 

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



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

2010-12-08 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

On official Python3.2 beta1 windows binary, I noticed following
command fails. (test_tcl alone won't fail)

I couldn't reproduce this on binary built from source without
installation.

//

C:\Python32>.\python.exe -m test.regrtest -v test___all__ test_tcl

(snip)

[2/2] test_tcl
testCall (test.test_tcl.TclTest) ... ERROR
testCallException (test.test_tcl.TclTest) ... ERROR
testCallException2 (test.test_tcl.TclTest) ... ERROR
testEval (test.test_tcl.TclTest) ... ERROR
testEvalException (test.test_tcl.TclTest) ... ERROR
testEvalException2 (test.test_tcl.TclTest) ... ERROR
testEvalFile (test.test_tcl.TclTest) ... ERROR
testEvalFileException (test.test_tcl.TclTest) ... ERROR
testGetVar (test.test_tcl.TclTest) ... ERROR
testGetVarArray (test.test_tcl.TclTest) ... ERROR
testGetVarArrayException (test.test_tcl.TclTest) ... ERROR
testGetVarException (test.test_tcl.TclTest) ... ERROR
testLoadWithUNC (test.test_tcl.TclTest) ... ERROR
testPackageRequireException (test.test_tcl.TclTest) ... ERROR
testSetVar (test.test_tcl.TclTest) ... ERROR
testSetVarArray (test.test_tcl.TclTest) ... ERROR
testUnsetVar (test.test_tcl.TclTest) ... ERROR
testUnsetVarArray (test.test_tcl.TclTest) ... ERROR
testUnsetVarException (test.test_tcl.TclTest) ... ERROR
testFlattenLen (test.test_tcl.TkinterTest) ... ok

==
ERROR: testCall (test.test_tcl.TclTest)
--
Traceback (most recent call last):
  File "C:\Python32\lib\test\test_tcl.py", line 25, in setUp
self.interp = Tcl()
  File "C:\Python32\lib\tkinter\__init__.py", line 1768, in Tcl
return Tk(screenName, baseName, className, useTk)
  File "C:\Python32\lib\tkinter\__init__.py", line 1674, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
C:/Python32/lib/tcl8.5 C:/lib/tcl8.5 C:/lib/tcl8.5 C:/library C:/library C:/
tcl8.5.2/library C:/tcl8.5.2/library



This probably means that Tcl wasn't installed properly.


(snip)

--
Ran 20 tests in 1.752s

FAILED (errors=19)
test test_tcl failed -- multiple errors occurred
1 test failed:
test_tcl
1 test altered the execution environment:
test___all__

--
components: Tests, Windows
messages: 123609
nosy: ocean-city
priority: normal
severity: normal
status: open
title: test___all_ + test_tcl fails (Windows installed binary)
versions: Python 3.2

___
Python tracker 

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



[issue10651] chr(13) is added before chr(10) when issuing ".write" under windows

2010-12-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

On Windows, newlines in text files are always translated. Please read
http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files

--
nosy: +amaury.forgeotdarc
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



[issue1705520] API for excluding methods from unittest stack traces

2010-12-08 Thread Dave Malcolm

Changes by Dave Malcolm :


--
nosy: +dmalcolm

___
Python tracker 

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



[issue10649] Attempting to override special methods of a function object does not cause an error

2010-12-08 Thread Éric Araujo

Éric Araujo  added the comment:

More info:
http://docs.python.org/dev/reference/datamodel#special-method-names
http://docs.python.org/dev/reference/datamodel#special-method-lookup-for-new-style-classes

--
nosy: +eric.araujo

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

Following tests fails on official Python3.2 Windows binary.

I cannot reproduce this on VC6.

/

C:\Python32>.\python -m test.regrtest -v test_time test_strptime

[1/2] test_time
test_asctime (test.test_time.TimeTestCase) ... ok
test_asctime_bounding_check (test.test_time.TimeTestCase) ... ok
test_clock (test.test_time.TimeTestCase) ... ok
test_conversions (test.test_time.TimeTestCase) ... ok
test_ctime_without_arg (test.test_time.TimeTestCase) ... ok
test_data_attributes (test.test_time.TimeTestCase) ... ok
test_default_values_for_zero (test.test_time.TimeTestCase) ... ok
test_gmtime_without_arg (test.test_time.TimeTestCase) ... ok
test_insane_timestamps (test.test_time.TimeTestCase) ... ok
test_localtime_without_arg (test.test_time.TimeTestCase) ... ok
test_sleep (test.test_time.TimeTestCase) ... ok
test_strftime (test.test_time.TimeTestCase) ... ok
test_strftime_bounding_check (test.test_time.TimeTestCase) ... ok
test_strptime (test.test_time.TimeTestCase) ... FAIL
test_strptime_bytes (test.test_time.TimeTestCase) ... ok
test_tzset (test.test_time.TimeTestCase) ... ok
test_bug_3061 (test.test_time.TestLocale) ... ok

==
FAIL: test_strptime (test.test_time.TimeTestCase)
--
test test_time crashed -- : 'cp932' codec can't enco
de character '\x93' in position 495: illegal multibyte sequence
Traceback (most recent call last):
  File "C:\Python32\lib\test\regrtest.py", line 960, in runtest_inner
indirect_test()
  File "C:\Python32\lib\test\test_time.py", line 244, in test_main
support.run_unittest(TimeTestCase, TestLocale)
  File "C:\Python32\lib\test\support.py", line 1146, in run_unittest
_run_suite(suite)
  File "C:\Python32\lib\test\support.py", line 1120, in _run_suite
result = runner.run(suite)
  File "C:\Python32\lib\unittest\runner.py", line 173, in run
result.printErrors()
  File "C:\Python32\lib\unittest\runner.py", line 110, in printErrors
self.printErrorList('FAIL', self.failures)
  File "C:\Python32\lib\unittest\runner.py", line 117, in printErrorList
self.stream.writeln("%s" % err)
  File "C:\Python32\lib\unittest\runner.py", line 25, in writeln
self.write(arg)
UnicodeEncodeError: 'cp932' codec can't encode character '\x93' in position 495:
 illegal multibyte sequence
[2/2] test_strptime
test_basic (test.test_strptime.getlang_Tests) ... ok
test_am_pm (test.test_strptime.LocaleTime_Tests) ... ok
test_date_time (test.test_strptime.LocaleTime_Tests) ... ok
test_lang (test.test_strptime.LocaleTime_Tests) ... ok
test_month (test.test_strptime.LocaleTime_Tests) ... ok
test_timezone (test.test_strptime.LocaleTime_Tests) ... FAIL
test_weekday (test.test_strptime.LocaleTime_Tests) ... ok
test_blankpattern (test.test_strptime.TimeRETests) ... ok
test_compile (test.test_strptime.TimeRETests) ... FAIL
test_locale_data_w_regex_metacharacters (test.test_strptime.TimeRETests) ... ok
test_matching_with_escapes (test.test_strptime.TimeRETests) ... ok
test_pattern (test.test_strptime.TimeRETests) ... ok
test_pattern_escaping (test.test_strptime.TimeRETests) ... ok
test_whitespace_substitution (test.test_strptime.TimeRETests) ... ok
test_ValueError (test.test_strptime.StrptimeTests) ... ok
test_bad_timezone (test.test_strptime.StrptimeTests) ... ok
test_caseinsensitive (test.test_strptime.StrptimeTests) ... ok
test_date (test.test_strptime.StrptimeTests) ... ok
test_date_time (test.test_strptime.StrptimeTests) ... ok
test_day (test.test_strptime.StrptimeTests) ... ok
test_defaults (test.test_strptime.StrptimeTests) ... ok
test_escaping (test.test_strptime.StrptimeTests) ... ok
test_fraction (test.test_strptime.StrptimeTests) ... ok
test_hour (test.test_strptime.StrptimeTests) ... ok
test_julian (test.test_strptime.StrptimeTests) ... ok
test_minute (test.test_strptime.StrptimeTests) ... ok
test_month (test.test_strptime.StrptimeTests) ... ok
test_percent (test.test_strptime.StrptimeTests) ... ok
test_second (test.test_strptime.StrptimeTests) ... ok
test_time (test.test_strptime.StrptimeTests) ... ok
test_timezone (test.test_strptime.StrptimeTests) ... ERROR
test_unconverteddata (test.test_strptime.StrptimeTests) ... ok
test_weekday (test.test_strptime.StrptimeTests) ... ok
test_year (test.test_strptime.StrptimeTests) ... ok
test_twelve_noon_midnight (test.test_strptime.Strptime12AMPMTests) ... ok
test_all_julian_days (test.test_strptime.JulianTests) ... ok
test_day_of_week_calculation (test.test_strptime.CalculationTests) ... ERROR
test_gregorian_calculation (test.test_strptime.CalculationTests) ... ERROR
test_julian_calculation (test.test_strptime.CalculationTests) ... ERROR
test_week_of_year_and_day_of_week_calculation (test.test_strptime.CalculationTes
ts) ... ok
test_TimeRE_recreation (test.test_strptime.CacheTests) ... ok
test_new_localetime (test.test_

[issue10649] Attempting to override special methods of a function object does not cause an error

2010-12-08 Thread Éric Araujo

Éric Araujo  added the comment:

Oops, that second links has been renamed:
http://docs.python.org/dev/reference/datamodel#special-method-lookup

--

___
Python tracker 

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



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

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

test___all__ imports a lot of modules, but I found one of
following modules can bring same error.

# just import one of these in test_main(test___all__)

#import idlelib.AutoComplete
#import tkinter.scrolledtext
#import tkinter.ttk
#import turtle

//

And actually, "import tkinter" is enough.

--

___
Python tracker 

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



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

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I think this happens because 

1. test___all__.py imports tkinter module, and it
   imports tkinter/_fix.py
2. _fix.py sets TCL_LIBRARY etc as top level routine
3. regrtest.py resets os.environ after test___all__.py ends.
   so TCL_LIBRARY gone.
4. test_tcl.py tries to import tkinter module, but it won't
   be loaded twice, so TCL_LIBRARY won't be set.
5. tcl/tk cannot find its library

I think this can be fixed by save & restore sys.modules
before & after each tests, so that tkinter module can be
loaded again.

--

___
Python tracker 

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



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

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

How about this patch? Is this kind of *fix* acceptable?

# I hope this works.

--
keywords: +patch
Added file: 
http://bugs.python.org/file19977/py3k_restore_sys_modules_in_regrtest.patch

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

I'm not sure why this happens, I can see this on
official python3.2 beta1 windows binary.

C:\Python32>.\python -m test.regrtest test_datetime
[1/1] test_datetime
test test_datetime failed -- Traceback (most recent call last):
  File "c:\Python32\lib\test\datetimetester.py", line 1628, in test_computations

self.assertRaises(TypeError, lambda: a+i)
AssertionError: TypeError not raised by 

1 test failed:
test_datetime

--
components: Library (Lib), Windows
messages: 123617
nosy: ocean-city
priority: normal
severity: normal
status: open
title: test_datetime fails on Python3.2 windows binary
versions: Python 3.2

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Brian Curtin

Brian Curtin  added the comment:

I don't see this on a US/English version of Windows 7 with 3.2b1 installed. 
cp932 is the default on a Japanese version, correct?

(I'm not very good with all of this encoding stuff so I don't know how much 
help I can be)

--
nosy: +brian.curtin

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Brian Curtin

Brian Curtin  added the comment:

I don't see this on a US/English version of Windows 7 with 3.2b1 installed.

--
nosy: +brian.curtin

___
Python tracker 

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



[issue1705520] API for excluding methods from unittest stack traces

2010-12-08 Thread Michael Foord

Michael Foord  added the comment:

So from the stackframe you can only get to the code object not to the function 
object and although the code object is also reachable from a decorator it isn't 
mutable so we can't "mark it" in any way. We could in theory 're-build' the 
function and create a new code object (__code__ is assignable) by copying the 
original but adding a non-existent name to one of the code attributes. This is 
pretty horrible though.

So a *real* local variable (as suggested by Robert) would work, but the 
functionality wouldn't work on IronPython and would cause tools like pyflakes 
to complain about an unused name.

Another alternative is to use the docstring. This is available via 
code_object.co_consts[0], so we could use a marker in the docstring to indicate 
that this frame should be omitted from tracebacks. Unless we can make the 
marker either invisible (magic whitespace anyone?) or non-invasive this is also 
a not so pleasant idea. (And wouldn't work with -OO.)

Alternative suggestions welcomed.

--
nosy: +rhettinger

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +belopolsky

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +belopolsky

___
Python tracker 

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



[issue10453] Add -h/--help option to compileall

2010-12-08 Thread R. David Murray

R. David Murray  added the comment:

I'm still working on this, making sure the remaining options that aren't 
currently tested have tests and work.

--
assignee: eric.araujo -> r.david.murray

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Hirokazu,

Please rerun the test with a -v flag like this:

C:\Python32>.\python -m test.regrtest -v test_datetime

This should tell us whether the failure comes from C (Fast) implementation or 
Python (Pure) one.  The test in question simply tests that date(y, m, d) + 1 
and datetime(y, m, d) + 1 raise TypeError.  Please see if you can reproduce the 
problem outside of the unit tests.

--

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I think this is locale problem. With "C" locale on windows,
wcsftime doesn't return UTF16. (when non ascii characters
are contained)

It is just like 
char cbuf[] = ""; /* contains non ascii chars in MBCS */
wchar_t wbuf[sizeof(cbuf)];
for (size_t i = 0; i < sizeof(cbuf); ++i)
wbuf[i] = cbuf[i];
/* just copy it. non ascii chars in MBCS uses two bytes,
   but should use 1 char space in UTF16. But this case,
   it uses 2 chars space! (something strange encoding) */

In japanese, wcsftime returns non ascii characters for
timezone in this strange encoding. Python converts this
with

#ifdef HAVE_WCSFTIME
ret = PyUnicode_FromWideChar(outbuf, buflen);
#else

so Unicode object will contain data in this strange encoding.
This is cause of problem.

I investigated a little about locale, and I learned C
standard does not guarantee wchar_t is always UTF16.

--

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I'll attach workaround. I used to confirm this works on
VS8, but I don't have VS8 now. I hope this still works.

--
keywords: +patch
Added file: http://bugs.python.org/file19978/py3k_workaround_for_wcsftime.patch

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

> ValueError: time data '2010 14 58 01 3 342 \x93\x8c\x8b\x9e 
> (\x95W\x8f\x80\x8e\x9e)' does not match format '%Y %H %M %S %w %j %Z'

This looks like valid cp932 data to me
>>> b'2010 14 58 01 3 342 \x93\x8c\x8b\x9e 
>>> (\x95W\x8f\x80\x8e\x9e)'.decode('cp932')
'2010 14 58 01 3 342 東京 (標準時)'

Please help me with Japanese, but I think the above means Tokyo timezone.  
However, strftime should have produced decoded unicode strings, not raw cp932 
in a str.  What does time.strftime('%Z') return on your system?

--

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Here you are.

>>> import time
>>> time.strftime('%Z')
'\x93\x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)'

--

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

==
FAIL: test_computations (test.datetimetester.TestSubclassDateTime_Fast)
--
Traceback (most recent call last):
  File "c:\Python32\lib\test\datetimetester.py", line 1628, in test_computations

self.assertRaises(TypeError, lambda: a+i)
AssertionError: TypeError not raised by 

> Please see if you can reproduce the problem outside of the unit tests.

I'll try.

--

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Wed, Dec 8, 2010 at 1:12 PM, Hirokazu Yamamoto
 wrote:
..
 import time
 time.strftime('%Z')
> '\x93\x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)'

Thanks.  Please bear with me for one more question:  what is

>>> time.tzname

?

--

___
Python tracker 

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



[issue8754] ImportError: quote bad module name in message

2010-12-08 Thread Éric Araujo

Éric Araujo  added the comment:

> The patch looks same to me as far as I can judge.
Thanks.  Can you apply the patch on your Windows machine and run the test suite?

> I would have used .format instead of %, but you wrote it ;-).
I would have too, were I writing Python :)  Here I tried to do the simplest 
thing that could work.

> Seeing how many of our tests had to be patched convinced me that we
> should treat this like a feature request and only apply to 3.2.
Yes, as an incompatible behaviour change I cannot go into released versions, as 
Brett stated in msg105994.

--

___
Python tracker 

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



[issue10453] Add -h/--help option to compileall

2010-12-08 Thread Éric Araujo

Éric Araujo  added the comment:

Thank you for stepping up.  I plead guilty too for letting bugs slip.  I’ll be 
here for pre- or post-commit review.

--

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I got readable result. ;-)

>>> import time
>>> time.tzname
('東京 (標準時)', '東京 (標準時)')

--

___
Python tracker 

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



[issue10644] socket loses data, calling send()/sendall() on invalid socket does not report error and returns all bytes as written

2010-12-08 Thread Charles-Francois Natali

Charles-Francois Natali  added the comment:

>  it may be very convenient and the performance overhead may be barely 
> noticeable.

Convenient for what ?
If the remote end doesn't send a FIN or RST packet, then the TCP/IP stack has 
no way of knowing the remote end is down.
Successfull return of send(2) never meant a succesfull delivery to the other 
end, see man page :
"No indication of failure to deliver is implicit in a send(). Locally detected 
errors are indicated by a return value of -1. "

If your remote application doesn't close its socket cleanly, then your 
application is broken.
To guard against that, you could use TCP keepalive...

--
nosy: +neologix

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2010-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Having posted that it occurs to me that it could be useful to have the 
> _remove_refcount function in test.support

There's already strip_python_stderr() :)

--

___
Python tracker 

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



[issue1705520] API for excluding methods from unittest stack traces

2010-12-08 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Maybe a global registry... implemented with a WeakKeyDictionary?

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue1705520] API for excluding methods from unittest stack traces

2010-12-08 Thread Michael Foord

Michael Foord  added the comment:

Global registry of code objects, hmmm... Could work. I'll prototype it and test 
it with IronPython / Jython / pypy.

--

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

This is shortest code to reproduce. But strange,
I can see TypeError on VC6(both Debug and Release)

E:\>e:\python-dev\py3k\pc\VC6\python.exe x.py
Traceback (most recent call last):
  File "x.py", line 10, in 
a+i
TypeError: unsupported operand type(s) for +: 'SubclassDatetime' and 'int'

/

from datetime import datetime

class SubclassDatetime(datetime):
sub_var = 1

a = SubclassDatetime(2002, 3, 2, 17, 6)
# Add/sub ints or floats should be illegal
for i in 1, 1.0:
a+i

--

___
Python tracker 

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2010-12-08 Thread R. David Murray

R. David Murray  added the comment:

Oh, good, I'll use that then.  I could have sworn I looked for that 
functionality a couple weeks ago and couldn't find it.

--

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

By changing
  from datetime import datetime
to
  from _datetime import datetime
I can see same behavior.

--

___
Python tracker 

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



[issue10653] test_time test_strptime fails on windows

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Wed, Dec 8, 2010 at 1:50 PM, Hirokazu Yamamoto
 wrote:
..
> I got readable result. ;-)
>
You mean readable to *you*. :-)

 import time
 time.tzname
> ('東京 (標準時)', '東京 (標準時)')

This makes sense now.   There are two issues here:

1.  Decoding the output of wcsftime().  Python expects mbcs (which I
believe is an UTF16-like wide char encoding) while Windows apparently
puts cp932 there in your locale.  I don't have expertise to address
this issue.

2. strptime() cannot parse strftime() output when strftime('%Z') is
different from time.tzname[dst].  This issue we can address.  Note
that for most of the locale information such as day of the week or
month names, strptime() relies on strftime() output, so the
round-tripping should work even when strftime() results are
nonsensical.  On the other hand, tz spellings are taken from
time.tzname.I think we can make strptime() more robust by adding
[time.strftime('%Z', (2000,1,1,0,0,0,0,0,dst) for dst in (0,1)] to the
list of recognized tz names if they differ from time.tzname.

--

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Wed, Dec 8, 2010 at 2:21 PM, Hirokazu Yamamoto
 wrote:
..
> /
>
> from datetime import datetime
>
> class SubclassDatetime(datetime):
>    sub_var = 1
>
> a = SubclassDatetime(2002, 3, 2, 17, 6)
> # Add/sub ints or floats should be illegal
> for i in 1, 1.0:
>    a+i
>

What is the output here?  If you do this at the '>>>' prompt, you
should see the results, if you do it in a script, please add a
print().

Does this also happen with plain datetime or only a subclass?  What
about time, date, or their subclasses?

--

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2010-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

#3267 did not expose endless loop possibility and was closed as won't fix.
Rather than reopen that and close this and move nosy list back, I added to nosy 
list here.

--
nosy: +brett.cannon, erickt, terry.reedy

___
Python tracker 

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



[issue3267] yield in list comprehensions possibly broken in 3.0

2010-12-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
superseder:  -> yield expression inside generator expression does nothing

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

"NotImplementedError" was printed. This happened
when subclass of date or subclass of datetime.
(plain classes and subclass of time didn't print this)


// Code

from _datetime import date, datetime

class SubclassDate(date):
sub_var = 1

a = SubclassDate(2002, 3, 2)
for i in 1, 1.0:
print(a+i)  # "NotImplemented"

class SubclassDateTime(datetime):
sub_var = 1

a = SubclassDateTime(2002, 3, 2, 3, 5)
for i in 1, 1.0:
print(a+i)  # "NotImplemented"
a-i # TypeError: unsupported operand type(s) for -: 'SubclassDateTime' and 
'float'


// Result

E:\python-dev\py3k>c:\Python32\python.exe \x.py
NotImplemented
NotImplemented
NotImplemented
NotImplemented
Traceback (most recent call last):
  File "\x.py", line 17, in 
a-i # TypeError
TypeError: unsupported operand type(s) for -: 'SubclassDateTime' and 'float'



I hope this helps.

--

___
Python tracker 

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



[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom

2010-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

In #10545, 'rurpy2' gives a similar critique of this section and suggests that 
it be improved or removed. I agree that it needs change and will try to think 
of what would be better.

--
nosy: +rurpy2, terry.reedy
versions:  -Python 3.0, Python 3.1

___
Python tracker 

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



[issue10545] remove or rewrite "Using Backslash to Continue Statements" anti-idiom

2010-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is essentially a duplicate of #7391 where it is already agreed that a 
change should be made to that section.

--
nosy: +terry.reedy
resolution:  -> duplicate
status: open -> closed
superseder:  -> Re-title the "Using Backslash to Continue Statements" anti-idiom

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Sorry, 
- "NotImplementedError" was printed
+ "NotImplemented" was printed

--

___
Python tracker 

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



[issue7391] Re-title the "Using Backslash to Continue Statements" anti-idiom

2010-12-08 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I'll take that section out.

--
assignee: d...@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue10566] gdb debugging support additions (Tools/gdb/libpython.py)

2010-12-08 Thread Mark Florisson

Mark Florisson  added the comment:

Indeed, I'm trying to make the code Python 2 and Python 3 (for the inferior) 
compatible, it's not really hard but indeed, the 'u' (Python 2) and 'b' (Python 
3) stuff need special casing. Python 2 compatibility was also the reason why 
the PyIntObjectPtr class was merged back. I will make a patch that's compatible 
with both Python 2 and 3 (and without any "colorful" code :)) as this would be 
most preferably I think (even if it's shipped with Python 3, users might still 
want to use it for Python 2, and it's also easier for the Cython debugger which 
wants to be compatible with 2.5+).

As for the gdb version, I have tested with 7.1 (in which case the introduced 
commands won't work as they use stuff from the 7.2 API, in which case 
test_gdb.py also skips those tests) and 7.2. I agree that the functionality 
should be left out if it cannot work properly.

Indeed, the _LoggingState redirects logging to a file and then reads the output 
after the command returns, I've been using it successfully with big amounts of 
output and I don't think there should be a problem as redirection and 
pagination should be unrelated. The good thing about _LoggingState is that it 
actually captures *all* output (and it's fully reentrant), which the 
'to_string' argument was not taking care of properly in 7.2 (it's fixed in the 
archer branch).

Indeed, gdb.get_selected_thread() is entirely broken in 7.2 (again, fixed in 
archer) but as you can see, it's not used (gdb.inferiors()[0] "works").

I'm currently looking into making stepping over faster and by extension 
stepping which we discussed earlier (I also discussed it with Tom Tromey 
previously). As you know, currently stepping over (and stepping) works with a 
"step-over loop" which might be turned into a "set a conditional breakpoint or 
watchpoint + continue" solution, which would mean a lot less context switches. 
I've not looked too serious into this matter, but I'll hope to get around to 
that soonish and I'll provide a new patch with all the corrections and 
improvements.
Another issue I'm fixing is the determination of the type of an arbitrary 
Python object, which was previously done with the Py_TPFLAGS_INT_SUBCLASS flags 
and friends. This is because they are new in 2.6 and I'd prefer to be 2.5 
compatible (again, because I'm trying to keep the Cython debugger 2.5 
compatible).

As for porting the gdb API to Python 3, I'm quite convinced that the API can be 
written in Cython, in which case it would mostly be a change in the build 
process rather than a serious code-refactoring issue. But I'll get around to 
that later...

Anyway, should I diff against the original libpython or against the original 
libpython + my previous diff?

--

___
Python tracker 

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



[issue10654] test_datetime fails on Python3.2 windows binary

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

> + "NotImplemented" was printed

Hmm, looks like a compiler bug to me.  Can anyone reproduce this on a debug 
build?  In any case, someone with a Windows setup will have to troubleshoot 
this further.

Note that the code in abstract.c is supposed to convert NotImplemented returns 
to type errors:

static PyObject *
binary_op(PyObject *v, PyObject *w, const int op_slot, const char *op_name)
{
PyObject *result = binary_op1(v, w, op_slot);
if (result == Py_NotImplemented) {
Py_DECREF(result);
return binop_type_error(v, w, op_name);
}
return result;
}

It should be possible to find out why this is not happening by stepping through 
this code with a debugger.

--
nosy: +loewis

___
Python tracker 

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



[issue10544] yield expression inside generator expression does nothing

2010-12-08 Thread Georg Brandl

Georg Brandl  added the comment:

FWIW, the "endless loop possibility" is not of issue here, and is simply an 
artifact of the specific generator function the OP uses.

--

___
Python tracker 

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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Marc or Alexander, can you confirm that the patch is correct?

--
assignee: d...@python -> cgw
nosy: +belopolsky, cgw, lemburg, terry.reedy
stage:  -> commit review

___
Python tracker 

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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee: cgw -> 

___
Python tracker 

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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> d...@python

___
Python tracker 

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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

If Victor says so ...

Someone needs to check that it works on a UCS4 build, but on a narrow build I 
don't think UTF-16-XX encodings need to do anything special - they just encode 
the surrogates as ordinary code units.


>>> '\U0001'.encode('UTF-16-BE').decode('UTF-16-BE') == '\U0001'
True
>>> '\U0001'.encode('UTF-16-LE').decode('UTF-16-LE') == '\U0001'
True

--

___
Python tracker 

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



[issue10655] Wrong powerpc define in Python/ceval.c

2010-12-08 Thread adrian

New submission from adrian :

In Python/ceval.c is following line:

#if defined(__ppc__) /* <- Don't know if this is the correct symbol; this
   section should work for GCC on any PowerPC
   platform, irrespective of OS.
   POWER?  Who knows :-) */

which seems wrong and aborts the build on powerpc. Changing it to __powerpc__ 
fixes it for me.

The following output of gcc confirms it:

$ gcc -dM -E -x c /tmp/foo.c  | grep powerpc
#define __powerpc__ 1
#define __powerpc 1
#define powerpc 1

Whereas there are no defines containing "ppc"

--
components: Build
messages: 123652
nosy: adrian
priority: normal
severity: normal
status: open
title: Wrong powerpc define in Python/ceval.c
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



[issue10655] Wrong powerpc define in Python/ceval.c

2010-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

How about accepting either of these symbols? Do you want to provide a patch?

--
nosy: +pitrou
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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I have verified that UTF-16-XX encodings work on wide build.  The doc change 
LGTM.  Bonus points for checking that we have unit tests for these encodings 
that include non-BMP characters.

--

___
Python tracker 

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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
components: +Unicode

___
Python tracker 

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



[issue9738] Document the encoding of functions bytes arguments of the C API

2010-12-08 Thread Dave Malcolm

Dave Malcolm  added the comment:

A (probably crazy) idea that just occurred to me:
  typedef char utf8_bytes;
  typedef char iso8859_1_bytes;
  typedef char fsenc_bytes;

then specify the encoding in the type signature of the API e.g.:
- int PyRun_SimpleFile(FILE *fp, const char *filename)
+ int PyRun_SimpleFile(FILE *fp, const fsenc_bytes *filename)

--

___
Python tracker 

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



[issue10655] Wrong powerpc define in Python/ceval.c

2010-12-08 Thread Dave Malcolm

Dave Malcolm  added the comment:

What version of the compiler was this with?

(For reference, I see that you also filed this downstream in Fedora's bug 
tracker as:
 https://bugzilla.redhat.com/show_bug.cgi?id=661510 )

--
nosy: +dmalcolm

___
Python tracker 

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



[issue10546] UTF-16-LE and UTF-16-BE support non-BMP characters

2010-12-08 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed by r87135.

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



[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base

2010-12-08 Thread Dave Malcolm

Dave Malcolm  added the comment:

Forgot to close this one out

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



[issue9518] PyModuleDef_HEAD_INIT does not explicitly initialize all fields of m_base

2010-12-08 Thread Dave Malcolm

Changes by Dave Malcolm :


--
stage: patch review -> committed/rejected

___
Python tracker 

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



[issue10399] AST Optimization: inlining of function calls

2010-12-08 Thread Dave Malcolm

Changes by Dave Malcolm :


--
assignee:  -> dmalcolm

___
Python tracker 

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



[issue9738] Document the encoding of functions bytes arguments of the C API

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

> A (probably crazy) idea that just occurred to me:
>  typedef char utf8_bytes;
>  typedef char iso8859_1_bytes;
>  typedef char fsenc_bytes;

I like it!  Let's see how far we can get without iso8859_1_bytes, though.  (It 
is likely to be locale_bytes anyways.)  There are a few places where we'll need 
ascii_bytes.

The added benefit is that we can make these typedefs unsigned char and avoid 
char signness being ambiguous.  We will also need to give the typedefs the Py_ 
prefix.

And an obligatory bikesheding comment: if we typedef char, we should use 
singular form.  Or we can typedef char* Py_utf8_bytes.

--

___
Python tracker 

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



[issue10655] Wrong powerpc define in Python/ceval.c

2010-12-08 Thread Dave Malcolm

Dave Malcolm  added the comment:

One of RH's gcc gurus told me in IRC that:
  __ppc__ is not a standard powerpc*-linux macro
  __PPC__ or __powerpc__ is

--

___
Python tracker 

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



[issue10655] Wrong powerpc define in Python/ceval.c

2010-12-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le mercredi 08 décembre 2010 à 23:06 +, Dave Malcolm a écrit :
> Dave Malcolm  added the comment:
> 
> One of RH's gcc gurus told me in IRC that:
>   __ppc__ is not a standard powerpc*-linux macro
>   __PPC__ or __powerpc__ is

Keep in mind that we have currently working PPC buildbots (under OS X).

--

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Committed revision 87137.  Needs backporting.  Also as Victor suggested, 
_lsprof.c code can be refactored to avoid roundtrips of unicode through utf8 
char*.

--

___
Python tracker 

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



[issue8426] multiprocessing.Queue fails to get() very large objects

2010-12-08 Thread Brian Cain

Brian Cain  added the comment:

I don't think the problem is limited to when hundreds of megabytes are being 
transmitted.  I believe I am experiencing a problem with the same root cause 
whose symptoms are slightly different.  It seems like there's a threshhold 
which causes not merely poor performance, but likely an unrecoverable fault.

Here's the output when I run my example on SLES11.1:

$ ./multiproc.py $((8*1024)) 2
on 2.6 (r26:66714, May  5 2010, 14:02:39) 
[GCC 4.3.4 [gcc-4_3-branch revision 152973]] - Linux linux 
2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64
0 entries in flight, join() took 5949.97 usec, get() did 0.00 items/sec
2 entries in flight, join() took 1577.85 usec, get() did 42581.766497 items/sec
4 entries in flight, join() took 1966.00 usec, get() did 65536.00 items/sec
6 entries in flight, join() took 1894.00 usec, get() did 105296.334728 items/sec
8 entries in flight, join() took 1420.02 usec, get() did 199728.761905 items/sec
10 entries in flight, join() took 1950.03 usec, get() did 163840.00 
items/sec
12 entries in flight, join() took 1241.92 usec, get() did 324720.309677 
items/sec
...
7272 entries in flight, join() took 2516.03 usec, get() did 10983427.687432 
items/sec
7274 entries in flight, join() took 1813.17 usec, get() did 10480717.037444 
items/sec
7276 entries in flight, join() took 1979.11 usec, get() did 11421315.832335 
items/sec
7278 entries in flight, join() took 2043.01 usec, get() did 11549808.744608 
items/sec
^C7280 entries: join() ABORTED by user after 83.08 sec
...

I see similar results when I run this test with a larger step, I just wanted to 
get finer resolution on the failure point.

--
nosy: +Brian.Cain
versions: +Python 2.6
Added file: http://bugs.python.org/file19979/multiproc.py

___
Python tracker 

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



[issue6697] Check that _PyUnicode_AsString() result is not NULL

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I am attaching an untested rewrite of normalizeUserObj() in _lsprof.c for 
comments on whether it is worth the effort.  There might be other places where 
PyModule_GetName() can be profitably replaced with PyModule_GetNameObject().

--
Added file: http://bugs.python.org/file19980/issue6697-lsprof.diff

___
Python tracker 

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



[issue10367] "python setup.py sdist upload --show-response" can fail with "UnboundLocalError: local variable 'result' referenced before assignment"

2010-12-08 Thread Daniel Tavares

Daniel Tavares  added the comment:

Here goes the test. Feel free to make any comments, critiques or suggestions, 
since this is my first take on this code base.

--
versions:  -3rd party
Added file: http://bugs.python.org/file19981/test_10367.diff

___
Python tracker 

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



[issue8426] multiprocessing.Queue fails to get() very large objects

2010-12-08 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

2.6.6 was the last bugfix release

--
type: crash -> behavior
versions:  -Python 2.6

___
Python tracker 

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



[issue10154] locale.normalize strips "-" from UTF-8, which fails on Mac

2010-12-08 Thread MunSic JEONG

MunSic JEONG  added the comment:

Ubuntu 10.4.1 LTS 
 also work fine with both "UTF8" and "UTF-8"

--

___
Python tracker 

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



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

2010-12-08 Thread Perry Smith

New submission from Perry Smith :

I do "out of tree" builds (I think that is the right term).  I make an
empty directory, cd into it, and then do: 

/configure

followed by make.  This works on most open source pages.  It appears to
be very close to working with Python 2.7.1 but the problem is that it assumes 
ld_so_aix is in the source tree but it is in the build tree.

I did an "in tree" build using basically just ./configure && make and so far 
(I'm still testing) that has worked fine.

--
components: Build
messages: 123668
nosy: pedz
priority: normal
severity: normal
status: open
title: "Out of tree" build fails on AIX 5.3
type: compile error
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



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

2010-12-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue1706039] Added clearerr() to clear EOF state

2010-12-08 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

The tests need to be cleaned up a little.  The setup code should go to setUp() 
method and instead of calling different methods in a loop with a switch over 
method names, it should just have a separate test_ method for each method 
tested.  A "with" statement can also reduce some boilerplate.

--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue1353344] python.desktop

2010-12-08 Thread Éric Araujo

Éric Araujo  added the comment:

Apart from the desktop file itself, which should be a merged version of the 
last attachment to this report and the files in Debuntu/Fedora/whatever, there 
is the issue of installation.  Someone has to track the desktop file spec or 
menu spec and edit one of the files involved in the Python build process.

I don’t know if having missed beta1 means that this will be deferred to 3.3.

--

___
Python tracker 

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



[issue1745761] Bad attributes/data handling in SGMLib

2010-12-08 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, r.david.murray -BreamoreBoy

___
Python tracker 

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



[issue8426] multiprocessing.Queue fails to get() very large objects

2010-12-08 Thread Brian Cain

Brian Cain  added the comment:

I was able to reproduce the problem on a more recent release.

7279 entries fails, 7278 entries succeeds.


$ ./multiproc3.py 
on 3.1.2 (r312:79147, Apr 15 2010, 12:35:07) 
[GCC 4.4.3] - Linux mini 2.6.32-26-generic #47-Ubuntu SMP Wed Nov 17 15:59:05 
UTC 2010 i686 
7278 entries in flight, join() took 12517.93 usec, get() did 413756.736588 
items/sec
7278 entries in flight, join() took 19458.06 usec, get() did 345568.562217 
items/sec
7278 entries in flight, join() took 21326.07 usec, get() did 382006.563784 
items/sec
7278 entries in flight, join() took 14937.16 usec, get() did 404244.835554 
items/sec
7278 entries in flight, join() took 18877.98 usec, get() did 354435.878968 
items/sec
7278 entries in flight, join() took 20811.08 usec, get() did 408343.738456 
items/sec
7278 entries in flight, join() took 14394.04 usec, get() did 423727.055218 
items/sec
7278 entries in flight, join() took 18940.21 usec, get() did 361012.624762 
items/sec
7278 entries in flight, join() took 19073.96 usec, get() did 367559.024118 
items/sec
7278 entries in flight, join() took 16229.87 usec, get() did 424764.763755 
items/sec
7278 entries in flight, join() took 18527.03 usec, get() did 355546.367937 
items/sec
7278 entries in flight, join() took 21500.11 usec, get() did 390429.802164 
items/sec
7278 entries in flight, join() took 13646.84 usec, get() did 410468.669903 
items/sec
7278 entries in flight, join() took 18921.14 usec, get() did 355873.819767 
items/sec
7278 entries in flight, join() took 13582.94 usec, get() did 287553.877353 
items/sec
7278 entries in flight, join() took 21958.11 usec, get() did 405549.873285 
items/sec
^C7279 entries: join() ABORTED by user after 5.54 sec
^CError in atexit._run_exitfuncs:
Segmentation fault

--
Added file: http://bugs.python.org/file19982/multiproc3.py

___
Python tracker 

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



[issue8426] multiprocessing.Queue fails to get() very large objects

2010-12-08 Thread Brian Cain

Brian Cain  added the comment:

Detailed stack trace when the failure occurs (gdb_stack_trace.txt)

--
Added file: http://bugs.python.org/file19983/gdb_stack_trace.txt

___
Python tracker 

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