[Ironpython-users] PyTest incompatible: Unsupported param dictionary type: IronPython.Runtime.PythonDictionary

Daniel Fernandez fernandez_dan2 at hotmail.com
Sun Jul 14 01:11:41 CEST 2013


Hi All,
I was just playing with this and it looks like the in class ApiModule in __apipkg the attributes not being looked up correctly with __makeattr
I was able to reproduce this issue with the snippet of code (tried to make it as small as possible)
from types import ModuleTypeclass ApiModule(ModuleType):	def __init__(self, name="", importspec="", implprefix=None, attr=None):		pass	def __makeattr(self, name):		return name	__getattr__ = __makeattr
t = ApiModule()t.Std
Python 2.7.5 returned this
Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> from types import ModuleType>>> class ApiModule(ModuleType):...     def __init__(self, name="", importspec="", implprefix=None, attr=None):...             pass...     def __makeattr(self, name):...             return name...     __getattr__ = __makeattr...>>> t = ApiModule()>>> t.Std'Std'
IronPython 2.7.3 returned this
IronPython 2.7.3 (2.7.0.40) on .NET 4.0.30319.18051 (32-bit)Type "help", "copyright", "credits" or "license" for more information.>>> from types import ModuleType>>> class ApiModule(ModuleType):...     def __init__(self, name="", importspec="", implprefix=None, attr=None):...         pass...     def __makeattr(self, name):...         return name...     __getattr__ = __makeattr...>>> t = ApiModule()>>> t.StdTraceback (most recent call last):  File "<stdin>", line 1, in <module>AttributeError: 'PythonModule_4$4' object has no attribute 'Std'

if I inherit from object instead of ModuleType it works in IronPython not sure if with inheritance of ModuleType
Danny
From: timoteo1097 at gmail.com
Date: Thu, 11 Jul 2013 17:51:00 -0700
Subject: Re: [Ironpython-users] PyTest incompatible: Unsupported param dictionary type: IronPython.Runtime.PythonDictionary
To: fernandez_dan2 at hotmail.com
CC: slide.o.mix at gmail.com; ironpython-users at python.org

Someone just informed me that a fix for this issue has shipped with the latest Beta. I have verified the fix.
However, I’m getting a new issue now. Is there a good way to manually install third party libraries onto IronPython? When I use PyTest’s setup.py on pure Python, it creates pytest.exe in C:\Python27\Scripts, but PyTest’s setup.py does not do this when I execute it with the IronPython interpreter.



I’m not sure if manually compiling it would get me around the current issue:

IronPython 2.7.4b1 (2.7.0.40) on .NET 4.0.30319.18052 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.


>>> import pytest
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Program Files (x86)\IronPython 2.7\lib\site-packages\pytest-2.3.5-py2.7.egg\pytest.py", line 15, in <module>


  File "c:\Program Files (x86)\IronPython 2.7\lib\site-packages\pytest-2.3.5-py2.7.egg\_pytest\core.py", line 462, in _preloadplugins
  File "c:\Program Files (x86)\IronPython 2.7\lib\site-packages\pytest-2.3.5-py2.7.egg\_pytest\core.py", line 95, in __init__


  File "c:\Program Files (x86)\IronPython 2.7\lib\site-packages\pytest-2.3.5-py2.7.egg\_pytest\core.py", line 221, in import_plugin
AttributeError: 'PythonModule_6$6' object has no attribute 'std' 



On Thu, Jul 11, 2013 at 7:17 AM, Daniel Fernandez <fernandez_dan2 at hotmail.com> wrote:





Travis already created a issue I just added code snippet to the comments. The code snippet is not formatted correctly shouldn't have copied and pasted from my email but it works. 


Danny

Date: Thu, 11 Jul 2013 07:02:30 -0700
Subject: Re: [Ironpython-users] PyTest incompatible: Unsupported param dictionary type: IronPython.Runtime.PythonDictionary
From: slide.o.mix at gmail.com


To: fernandez_dan2 at hotmail.com
CC: timoteo1097 at gmail.com; ironpython-users at python.org



Looks like a bug then, please file it on Codeplex and put in the test to reproduce it.

On Thu, Jul 11, 2013 at 6:59 AM, Daniel Fernandez <fernandez_dan2 at hotmail.com> wrote:






I was able to reproduce this issue with this snippet of code. 
>>> from types import ModuleType>>> class A(ModuleType):...     def __init__(self, d):


...         pass...>>> t = dict()>>> A(d = t)Traceback (most recent call last):  File "<stdin>", line 1, in <module>


SystemError: Unsupported param dictionary type: IronPython.Runtime.PythonDictionary
I could only reproduce it when the class inherits from ModuleType. 

Danny
Date: Wed, 10 Jul 2013 21:17:55 -0700
From: slide.o.mix at gmail.com
To: timoteo1097 at gmail.com



CC: ironpython-users at python.org
Subject: Re: [Ironpython-users] PyTest incompatible: Unsupported param dictionary type: IronPython.Runtime.PythonDictionary




Can you show what line 33 in _apipkg.py is? 

On Wed, Jul 10, 2013 at 4:34 PM, Travis Lee <timoteo1097 at gmail.com> wrote:




I'm trying to use PyTest on IronPython. I haven't looked thoroughly but I've been told that PyTest does not use C extensions so it should theoretically work normally. 









c:\>"c:\Program Files (x86)\IronPython 2.7\ipy.exe"IronPython 2.7.3 (2.7.0.40) on .NET 4.0.30319.18047 (32-bit)







Type "help", "copyright", "credits" or "license" for more information.>>> import pytestTraceback (most recent call last):  File "<stdin>", line 1, in <module>







  File "C:\Users\***\AppData\Roaming\Python\IronPython27\site-packages\pytest-2.3.5-py2.7.egg\pytest.py", line 12, in <module>  File "C:\Users\***\AppData\Roaming\Python\IronPython27\site-packages\pytest-2.3.5-py2.7.egg\_pytest\core.py", line 7, in <module>







  File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\py\__init__.py", line 19, in <module>  File "C:\Program Files (x86)\IronPython 2.7\Lib\site-packages\py\_apipkg.py", line 33, in initpkg







SystemError: Unsupported param dictionary type: IronPython.Runtime.PythonDictionary








I think it's expecting a standard Python dictionary. Is there any way around this?
Thanks.









_______________________________________________

Ironpython-users mailing list

Ironpython-users at python.org

http://mail.python.org/mailman/listinfo/ironpython-users




-- 
Website: http://earl-of-code.com


_______________________________________________
Ironpython-users mailing list
Ironpython-users at python.org
http://mail.python.org/mailman/listinfo/ironpython-users 		 	   		  


-- 
Website: http://earl-of-code.com
 		 	   		  

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130713/bd3eea23/attachment.html>


More information about the Ironpython-users mailing list