{"action":"created","issue":{"url":"https://api.github.com/repos/irmen/Pyro4/issues/79","labels_url":"https://api.github.com/repos/irmen/Pyro4/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/irmen/Pyro4/issues/79/comments","events_url":"https://api.github.com/repos/irmen/Pyro4/issues/79/events","html_url":"https://github.com/irmen/Pyro4/issues/79","id":85817732,"number":79,"title":"Flame createModule - Problems with unicode","user":{"login":"alexsilva","id":2024086,"avatar_url":"https://avatars.githubusercontent.com/u/2024086?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsilva","html_url":"https://github.com/alexsilva","followers_url":"https://api.github.com/users/alexsilva/followers","following_url":"https://api.github.com/users/alexsilva/following{/other_user}","gists_url":"https://api.github.com/users/alexsilva/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsilva/subscriptions","organizations_url":"https://api.github.com/users/alexsilva/orgs","repos_url":"https://api.github.com/users/alexsilva/repos","events_url":"https://api.github.com/users/alexsilva/events{/privacy}","received_events_url":"https://api.github.com/users/alexsilva/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-06-06T22:18:48Z","updated_at":"2015-06-07T19:51:08Z","closed_at":"2015-06-07T19:51:08Z","body":"Python 2.7 x64\r\nPyro4\r\n\r\nClient Lua\r\nhttps://github.com/alexsilva/luaPyro\r\n\r\nClient code:\r\n\r\n```\r\nlocal python = plugin.Python:new()\r\nlocal os = python.module({'os'})\r\nlocal lua_mod = python.sendmodule{'lua.mod', [[\r\ndef openfile(filename, data):\r\n    with open(filename, 'w') as f:\r\n        f.write(data)\r\n\r\ndef getfile(filename):\r\n    with open(filename, 'r') as f:\r\n        return f.read()\r\n]]}\r\n```\r\n\r\nYou can not send a module whose name is unicode (who generated a unicode name was Python).\r\n\r\n```\r\ntraceback: {\r\n  1: Traceback (most recent call last):\r\n  2: File \"...\\Pyro4\\core.py\", line 966, in handleRequest data = method(*vargs, **kwargs) # this is the   actual method call to the Pyro object\r\n  3: File \"...\\Pyro4\\utils\\flame.py\", line 226, in sendmodule createModule(modulename, modulesource)\r\n  4: File \"...\\Pyro4\\utils\\flame.py\", line 289, in createModule setattr(module, component, types.ModuleType(real_path))\r\n  5: TypeError: module.__init__() argument 1 must be string, not unicode\r\n}\r\nargs: {\r\n  1: module.__init__() argument 1 must be string, not unicode\r\n}\r\nclass: exceptions.TypeError\r\n```\r\n\r\nMemory dump (components)\r\n\r\n```\r\ncomponents = {list} [u'lua', u'mod']\r\nfilename = {str} '<dynamic-module>'\r\nmodule = {module} <module 'pyro-flame-module-context' (built-in)>\r\nname = {unicode} u'lua.mod'\r\nnamespace = {NoneType} None\r\npath = {str} ''\r\nsource = {unicode} u'\\ndef openfile(filename, data):\\n    with open(filename, \\\\'w\\\\') as f:\\n        for line in data:\\n            f.write(line)\\n\\ndef getfile(filename):\\n    with open(filename, \\\\'w\\\\') as f:\\n        return f.read()\\n'\r\n```\r\n\r\nError location\r\nhttps://github.com/irmen/Pyro4/blob/master/src/Pyro4/utils/flame.py#L289"},"comment":{"url":"https://api.github.com/repos/irmen/Pyro4/issues/comments/109793038","html_url":"https://github.com/irmen/Pyro4/issues/79#issuecomment-109793038","issue_url":"https://api.github.com/repos/irmen/Pyro4/issues/79","id":109793038,"user":{"login":"irmen","id":1771820,"avatar_url":"https://avatars.githubusercontent.com/u/1771820?v=3","gravatar_id":"","url":"https://api.github.com/users/irmen","html_url":"https://github.com/irmen","followers_url":"https://api.github.com/users/irmen/followers","following_url":"https://api.github.com/users/irmen/following{/other_user}","gists_url":"https://api.github.com/users/irmen/gists{/gist_id}","starred_url":"https://api.github.com/users/irmen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/irmen/subscriptions","organizations_url":"https://api.github.com/users/irmen/orgs","repos_url":"https://api.github.com/users/irmen/repos","events_url":"https://api.github.com/users/irmen/events{/privacy}","received_events_url":"https://api.github.com/users/irmen/received_events","type":"User","site_admin":false},"created_at":"2015-06-07T19:51:08Z","updated_at":"2015-06-07T19:51:08Z","body":"Closing this because it seems you're trying to work around the limitations of Flame as they are (and they won't be changed).\r\n\r\n- Flame requires pickle serializer exclusively. This is not something that can/will be changed.\r\n- The flameserver sets this correctly and won't accept other serilalizers, see https://github.com/irmen/Pyro4/blob/master/src/Pyro4/utils/flameserver.py#L40     I'm not sure how you are able to submit a json serialized message to the flame server without modifying this?\r\n- Your particular problem disappears when using python 3.\r\n"}}