Yes, codeplex has issues with pasting code, horrible horrible issues.<div><br></div><div>slide</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Nov 12, 2012 at 11:32 AM, Nicholas Devenish <span dir="ltr"><<a href="mailto:misnomer@gmail.com" target="_blank">misnomer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I've added it at <a href="http://ironpython.codeplex.com/workitem/33341" target="_blank">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><div class="h5"><div><br><div><div>On 12 Nov 2012, at 16:05, Jeff Hardy <<a href="mailto:jdhardy@gmail.com" target="_blank">jdhardy@gmail.com</a>> wrote:</div><br><blockquote type="cite">On Mon, Nov 12, 2012 at 2:03 AM, Nicholas Devenish <<a href="mailto:misnomer@gmail.com" target="_blank">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" target="_blank">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>
</div></div></div><br>_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Website: <a href="http://earl-of-code.com" target="_blank">http://earl-of-code.com</a><br>
</div>