bartdag/py4j — Issue #94: Collections returned from py4J are not copyable 
Author: jbzdak
Created: 2011-12-10 17:35:04+00:00
State: open

I wanted to copy a dictionary returned from Java side using copy.copy method and it resulted in exception:

```
_copy = copy(self._descriptor.getRenderedMetadata())
File "/usr/lib/python2.6/copy.py", line 87, in copy
rv = reductor(2)
File "/usr/local/lib/python2.6/dist-packages/py4j-0.7-py2.6.egg/py4j/java_gateway.py", line 432, in __call__
self.target_id, self.name)
File "/usr/local/lib/python2.6/dist-packages/py4j-0.7-py2.6.egg/py4j/protocol.py", line 271, in get_return_value
raise Py4JError('An error occurred while calling %s%s%s. Trace:\n%s\n' % (target_id, '.', name, value))
Py4JError: An error occurred while calling o56.__getnewargs__. Trace:
py4j.Py4JException: Method __getnewargs__([]) does not exist
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:346)
at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:355)
at py4j.Gateway.invoke(Gateway.java:247)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:124)
at py4j.commands.CallCommand.execute(CallCommand.java:81)
at py4j.GatewayConnection.run(GatewayConnection.java:175)
at java.lang.Thread.run(Thread.java:662)```

This due to py4j routing all (even special python methods) methods to java side.