<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I've added it at <a href="http://ironpython.codeplex.com/workitem/33341">http://ironpython.codeplex.com/workitem/33341</a><div><br></div><div>The formatting is screwed up now because I didn't relies it wouldn't preserve any spacing (even returns!). I'm trying to fix it up, but the site seems very slow at the moment - about a minute between any requests to the site.</div><div><br></div><div>For now, importing directly seems to work, or I'll play around with removing the call/warning to see if that works - it's only a deprecation.</div><div><br></div><div>Many thanks,</div><div><br></div><div>Nick</div><div><br><div><div>On 12 Nov 2012, at 16:05, Jeff Hardy <<a href="mailto:jdhardy@gmail.com">jdhardy@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">On Mon, Nov 12, 2012 at 2:03 AM, Nicholas Devenish <<a href="mailto:misnomer@gmail.com">misnomer@gmail.com</a>> wrote:<br><blockquote type="cite">Hi Jeff again,<br><br><blockquote type="cite">In inspect.py, just before line 758, it looks at co.co_argcount and<br>co.co_varnames and assumes that they are the same length, but my guess<br>is that they might not be when compiled with pyc. If you can figure<br>out exactly what getargspec is being called on, that might help make a<br>simpler reproduction that I can work off of.<br></blockquote><br><br>I spent some time this morning trying to reduce down to a standalone test case; I've got it down to the following, and don't understand what is going wrong so can't work out what else to remove; sorry about the large chain of functions, but it seems to somehow be involved. I hope it is helpful:<br><br><blockquote type="cite">from functools import update_wrapper<br>import inspect<br><br>def decorator(target):<br>    def decorate(fn):<br>        return inspect.getargspec(fn)<br>    return update_wrapper(decorate, target)<br><br>def _decorate_with_warning(func):<br>    @decorator<br>    def warned(fn):<br>      pass<br>    warned(func)<br><br>@_decorate_with_warning<br>def execute_at(self, event_name, target):<br>    def call_event(target, connection):<br>        if self._somefun(event_name, target, connection):<br>            pass<br></blockquote><br>As before, it runs fine as a standalone script<br>$ ipy testipy.py<br><br>But compiling with:<br><blockquote type="cite">pyc /out:TestIPy testily.py<br>ipy<br><blockquote type="cite">import clr<br>clr.AddReferenceToFileAndPath("TestIPy.dll")<br>import testipy<br></blockquote></blockquote><br>Gives the same traceback:<br><blockquote type="cite">Traceback (most recent call last):<br>  File "runtest.py", line 3, in <module><br>  File "testipy", line 3, in <module><br>  File "testipy", line 14, in _decorate_with_warning<br>  File "testipy", line 7, in decorate<br>  File "c:\Program Files\IronPython 2.7\Lib\inspect.py", line 820, in getargspec<br>  File "c:\Program Files\IronPython 2.7\Lib\inspect.py", line 762, in getargs<br>IndexError: index out of range: 2<br></blockquote><br>I hope this is helpful!<br></blockquote><br>Very, thank you. Do you think you could open an issue<br>(<a href="http://ironpython.codeplex.com/WorkItem/Create">http://ironpython.codeplex.com/WorkItem/Create</a>) and put the smaller<br>repro in it? I'll try to take a look at it soon because I'm working on<br>the compiler code anyway, but at least with an issue it won't get<br>completely forgotten.<br><br>- Jeff<br></blockquote></div><br></div></body></html>