Hi,
I'm trying to include a module within my __init__.py which results in a compile_restricted error...
2014-01-22 16:28:07,310 (7f29298a4700) : CRITICAL (core:602) - Exception starting plug-in (most recent call last):
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/core.py", line 595, in start
self.sandbox.execute(self.init_code)
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 259, in execute
exec(code) in self.environment
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/tvheadend-ng.bundle/Contents/Code/__init__.py", line 1, in
import urllib2, base64, simplejson, time, pyq
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 336, in __import__
return mod.load_module(_name)
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/sandbox.py", line 44, in load_module
module = RestrictedModule(name, path, sandbox)
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 20, in __init__
code = sandbox._core.loader.load(filename, sandbox.policy.elevated_execution)
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 47, in load
code = self.compile(str(source), str(uni(filename)), elevated)
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/2/Python/Framework/code/loader.py", line 52, in compile
return RestrictedPython.compile_restricted(source, name, 'exec', elevated=elevated)
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 115, in compile_restricted
gen.compile()
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 68, in compile
tree = self._get_tree()
File "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Platforms/Shared/Libraries/RestrictedPython/RCompile.py", line 62, in _get_tree
raise SyntaxError, self.rm.errors[0]
SyntaxError: Line 68: "_gnquery" is an invalid variable name because it starts with "_"
The module works fine in a local testscript.
The module is located within the same directory as the __init__.py script and imported via "import "
Any hints?
Greets
Sascha