Anthony-

In looking at your test, it appears you named the file copy.py and this s causing the issue.  Try to rename it to test.py and re-run.  I think you'll see the correct output in doing so.

Best

Josh Juneau
juneau001@gmail.com
http://jj-blogger.blogspot.com
http://www.jythonpodcast.com
Twitter ID:  javajuneau


On Mon, Feb 15, 2010 at 1:51 PM, Anthony Kong <anthony.hw.kong@gmail.com> wrote:
Hi, Josh,

Sorry, for hijacking the thread. But I have a question related to issue 1551, and you probably already have some insight into the root cause.

For me, I just want to understand this issue a bit better.

If I repeated what is in the bug description, I can reproduce the SystemError

But if I have the same code in a script, says

def test():
        from java.util import ArrayList
        gList = ArrayList()

        import copy
        copyList = copy.copy(gList)
        print copyList


if __name__ == "__main__":
    test()


Then I got an entirely different exception:

Traceback (most recent call last):
  File "tests/python/copy.py", line 11, in <module>
    test()
  File "tests/python/copy.py", line 6, in test
    copyList = copy.copy(gList)
AttributeError: 'module' object has no attribute 'copy'

Why the difference in behavior?

Cheers



On Tue, Feb 16, 2010 at 3:41 AM, Josh Juneau <juneau001@gmail.com> wrote:
I'm trying to submit a patch to copy.py for http://bugs.jython.org/issue1551 and I'm unable to create a file.  I believe that I used to be able to submit files via the bug tracker.  Is anyone else having issues or have privileges changed?

Thanks