[issue6201] test_winreg fails

2009-06-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Fixed with r73325.
2.7 really introduces an incompatibility here; I added an entry in the 
whatsnew file.

--
nosy: +amaury.forgeotdarc
resolution:  - fixed
status: open - closed

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



[issue6201] test_winreg fails

2009-06-05 Thread James Abbatiello

New submission from James Abbatiello abb...@gmail.com:

test_winreg fails with:
==
ERROR: testLocalMachineRegistryWorks (test.test_winreg.WinregTests)
--
Traceback (most recent call last):
snip
  File C:\Projects\python-trunk\lib\test\test_winreg.py, line 86, in
ReadTestData
with OpenKey(key, sub_key) as sub_key:
AttributeError: __exit__

--

_winreg.OpenKey() returns a PyHKEY.  This type can no longer be used in
a with statement after r72912 introduced the SETUP_WITH opcode.  The
old way used PyObject_GetAttr() to get __enter__ and __exit__ which
works fine with PyHKEY since it has a tp_getattr function.  The new way
uses _PyObject_LookupSpecial() which uses the MRO and the dict of the
object.

I guess the right fix here is to update PyHKEY so it uses the modern
APIs but I don't know how to do this without breaking the special casing
for the handle member.  Using T_INT isn't quite correct since it is a
pointer not an int.

--
components: Tests, Windows
messages: 88926
nosy: abbeyj
severity: normal
status: open
title: test_winreg fails
versions: Python 2.7

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



[issue6201] test_winreg fails

2009-06-05 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +benjamin.peterson

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