1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | from java.lang import Class, Object class D(Object): pass print D print Class.newInstance(D) def call(): class C(Object): pass print C print Class.newInstance(C) call() Output: <class '__main__.D'> org.python.proxies.__main__$D$1@3ff14318 <class '__main__.C'> Traceback (most recent call last): File "Lib/test/blah.py", line 11, in <module> call() File "Lib/test/blah.py", line 10, in call print Class.newInstance(C) AttributeError: 'module' object has no attribute 'C' |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | jython25 manage.py syncdb Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/__init__.py", line 340, in execute_manager utility.execute() File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/__init__.py", line 295, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/base.py", line 195, in run_from_argv self.execute(*args, **options.__dict__) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/base.py", line 222, in execute output = self.handle(*args, **options) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/base.py", line 222, in execute output = self.handle(*args, **options) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/base.py", line 351, in handle return self.handle_noargs(**options) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/core/management/commands/syncdb.py", line 48, in handle_noargs cursor = connection.cursor() File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/django/db/backends/__init__.py", line 56, in cursor cursor = self._cursor(settings) File "/home/smiguez/jython-dev/jython/dist/Lib/site-packages/doj/backends/zxjdbc/postgresql/base.py", line 68, in _cursor self.connection = Database.connect(conn_string, zxJDBC.DatabaseError: driver [org.postgresql.Driver] not found |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | jython25 manage.py runserver Traceback (most recent call last): File "manage.py", line 4, in <module> import settings # Assumed to be in the same directory. File "manage.py", line 4, in <module> import settings # Assumed to be in the same directory. java.lang.ArrayIndexOutOfBoundsException: 3916 at org.python.objectweb.asm.ClassReader.readClass(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.core.APIReader.<init>(APIReader.java:33) at org.python.core.imp.readCode(imp.java:115) at org.python.core.imp.createFromPyClass(imp.java:90) at org.python.core.imp.loadFromSource(imp.java:466) at org.python.core.imp.find_module(imp.java:379) at org.python.core.imp.import_next(imp.java:577) at org.python.core.imp.import_name(imp.java:677) at org.python.core.imp.importName(imp.java:737) at org.python.core.ImportFunction.__call__(__builtin__.java:1265) at org.python.core.PyObject.__call__(PyObject.java:339) at org.python.core.__builtin__.__import__(__builtin__.java:1236) at org.python.core.__builtin__.__import__(__builtin__.java:1219) at org.python.core.imp.importOne(imp.java:748) at org.python.pycode._pyx0.f$0(manage.py:11) at org.python.pycode._pyx0.call_function(manage.py) at org.python.core.PyTableCode.call(PyTableCode.java:199) at org.python.core.PyCode.call(PyCode.java:14) at org.python.core.Py.runCode(Py.java:1206) at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:152) at org.python.util.jython.run(jython.java:226) at org.python.util.jython.main(jython.java:112) java.lang.ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: 3916 |
1 2 3 | # make an exact copy of ElementTree's namespace here to support even # private API usage from xml.etree.ElementTree import Comment, Element, ElementPath, ElementTree, PI, ProcessingInstruction, QName, SubElement, TreeBuilder, VERSION, XML, XMLID, XMLParser, XMLTreeBuilder, _Element, _ElementInterface, _SimpleElementPath, __all__, __doc__, __file__, __name__, _encode, _encode_entity, _escape, _escape_attrib, _escape_cdata, _escape_map, _namespace_map, _raise_serialization_error, dump, fixtag, fromstring, iselement, iterparse, parse, re, string, sys, tostring |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | $ paster create -t pylons testpy Traceback (most recent call last): File "/usr/bin/paster", line 7, in ? sys.exit( File "/usr/lib/python2.3/site-packages/PasteScript-1.3.6-py2.3.egg/paste/script/command.py", line 78, in run invoke(command, command_name, options, args[1:]) File "/usr/lib/python2.3/site-packages/PasteScript-1.3.6-py2.3.egg/paste/script/command.py", line 117, in invoke exit_code = runner.run(args) File "/usr/lib/python2.3/site-packages/PasteScript-1.3.6-py2.3.egg/paste/script/command.py", line 212, in run result = self.command() File "/usr/lib/python2.3/site-packages/PasteScript-1.3.6-py2.3.egg/paste/script/create_distro.py", line 69, in command self.extend_templates(templates, tmpl_name) File "/usr/lib/python2.3/site-packages/PasteScript-1.3.6-py2.3.egg/paste/script/create_distro.py", line 233, in extend_templates tmpl = entry.load()(entry.name) File "/usr/lib/python2.3/site-packages/setuptools-0.6c9-py2.3.egg/pkg_resources.py", line 1913, in load entry = __import__(self.module_name, globals(),globals(), ['__name__']) File "/usr/lib/python2.3/site-packages/Pylons-0.9.6.2-py2.3.egg/pylons/__init__.py", line 4, in ? from pylons.config import config File "/usr/lib/python2.3/site-packages/Pylons-0.9.6.2-py2.3.egg/pylons/config.py", line 2, in ? from pylons.configuration import * File "/usr/lib/python2.3/site-packages/Pylons-0.9.6.2-py2.3.egg/pylons/configuration.py", line 16, in ? import pylons.legacy File "/usr/lib/python2.3/site-packages/Pylons-0.9.6.2-py2.3.egg/pylons/legacy.py", line 10, in ? import pylons.decorators File "/usr/lib/python2.3/site-packages/Pylons-0.9.6.2-py2.3.egg/pylons/decorators/__init__.py", line 9, in ? from decorator import decorator File "/usr/lib/python2.3/site-packages/decorator-3.0.0-py2.3.egg/decorator.py", line 127 @decorator ^ SyntaxError: invalid syntax |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/WebError-0.10-py2.5.egg/weberror/errormiddleware.py', line 162 in __call__ app_iter = self.application(environ, sr_checker) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/middleware.py', line 81 in __call__ return self.app(environ, start_response) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/middleware.py', line 159 in __call__ return self.wrap_app(environ, session_start_response) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Routes-1.10.1-py2.5.egg/routes/middleware.py', line 118 in __call__ response = self.app(environ, start_response) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/wsgiapp.py', line 117 in __call__ response = self.dispatch(controller, environ, start_response) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/wsgiapp.py', line 316 in dispatch return controller(environ, start_response) File '/home/live/projects/frontend/tineye/lib/base.py', line 253 in __call__ return WSGIController.__call__(self, environ, start_response) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/controllers/core.py', line 200 in __call__ response = self._inspect_call(self.__before__) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/controllers/core.py', line 95 in _inspect_call result = self._perform_call(func, args) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/controllers/core.py', line 58 in _perform_call return func(**args) File '/home/live/projects/frontend/tineye/lib/base.py', line 200 in __before__ if 'user' in session: File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/registry.py', line 172 in __contains__ return key in self._current_obj() File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/session.py', line 488 in __contains__ return self._session().has_key(key) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/session.py', line 459 in _session **params) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/session.py', line 103 in __init__ self.invalidate() File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/session.py', line 170 in invalidate namespace.acquire_write_lock() File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/container.py', line 113 in acquire_write_lock r = self.access_lock.acquire_write_lock(wait) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/synchronization.py', line 172 in acquire_write_lock x = self.do_acquire_write_lock(wait) File '/home/live/env/pylons-0.9.7/lib/python2.5/site-packages/Beaker-1.1.2-py2.5.egg/beaker/synchronization.py', line 260 in do_acquire_write_lock fcntl.flock(filedescriptor, fcntl.LOCK_EX) TypeError: argument must be an int, or have a fileno() method. |
1 2 3 4 5 6 7 8 9 10 11 12 | (pylons)sluggo@bovver:~/exp/pylons/pylons-sluggo/pylons/docs/en% sphinx-build -b html . /tmp/pylons-docs
Sphinx v0.5.1, building html
loading pickled environment... not found
building [html]: targets for 77 source files that are out of date
updating environment: 77 added, 0 changed, 0 removed
reading sources... advanced_pylons/creating_paste_templates advanced_pylons/entry_points_and_plugins advanced_pylons/index advanced_pylons/paster advanced_pylons/paster_commands caching concepts configuration controllers debugging deployment forms gettingstarted glossary helpers i18n index logging models modules/commands modules/configuration modules/controllers modules/controllers_core modules/controllers_util modules/controllers_xmlrpc modules/decorators modules/decorators_cache modules/decorators_rest modules/decorators_secure modules/error modules/i18n_translation modules/index modules/log modules/middleware modules/templating modules/test modules/util modules/wsgiapp python23_install security_policy_for_bugs sessions testing thirdparty/beaker Exception occurred:
File "/home/sluggo/hg/beaker/beaker/ext/google.py", line 15, in <module>
raise InvalidCacheBackendError("Datastore cache backend requires the "
InvalidCacheBackendError: Datastore cache backend requires the 'google.appengine.ext' library
The full traceback has been saved in /tmp/sphinx-err-kaYXff.log, if you want to report the issue to the author.
Please also report this if it was a user error, so that a better error message can be provided next time.
Send reports to sphinx-dev@googlegroups.com. Thanks!
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | C:\stuff\jython\jython5731>jython
Jython 2.5b0+ (trunk, Dez 10 2008, 10:41:33)
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_07
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.append("C:/stuff/temp/downloads/weka.jar")
>>> from weka.classifiers.trees.j48 import J48
*sys-package-mgr*: processing new jar, 'C:\stuff\temp\downloads\weka.jar'
>>> J48
<jclass weka.classifiers.trees.j48.J48 0x1>
>>>
Please note:
if you really have weka.jar on your classpath when the JVM is started,
the sys.path.append() line is not necessary
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Traceback (most recent call last): File "../uploader.py", line 86, in <module> resp, data = http.request(post_uri, 'POST', body=content, headers=headers) File "/opt/local/lib/python2.5/site-packages/PIL/__init__.py", line 1050, in request File "/opt/local/lib/python2.5/site-packages/PIL/__init__.py", line 854, in _request File "/opt/local/lib/python2.5/site-packages/PIL/__init__.py", line 823, in _conn_request File "/opt/local/lib/python2.5/httplib.py", line 866, in request self._send_request(method, url, body, headers) File "/opt/local/lib/python2.5/httplib.py", line 892, in _send_request self.send(body) File "/opt/local/lib/python2.5/httplib.py", line 711, in send self.sock.sendall(str) File "<string>", line 1, in sendall socket.error: (35, 'Resource temporarily unavailable') |
1 2 3 4 5 6 7 | >>> m = Mapper() >>> m.connect('/merge/{site}/*source/{patchid}') >>> m.create_regs([]) >>> m.match('/merge/numbers/bob/master/abcd1234') {'action': u'index', 'source': u'bob/master', 'controller': u'content', 'site': u'numbers', 'patchid': u'abcd1234'} >>> m.match('/merge/mantis/1234/abcd1234') {'action': u'index', 'source': u'1234', 'controller': u'content', 'site': u'mantis', 'patchid': u'abcd1234'} |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.python.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1268)
at org.python.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1243)
at org.python.objectweb.asm.Frame.merge(Frame.java:1373)
at org.python.objectweb.asm.Frame.merge(Frame.java:1280)
at org.python.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270)
at org.python.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189)
at org.python.objectweb.asm.ClassReader.accept(ClassReader.java:1447)
at org.python.objectweb.asm.ClassReader.accept(ClassReader.java:420)
at org.python.expose.generate.ExposedTypeProcessor.<init>(ExposedTypeProcessor.java:52)
at org.python.expose.generate.ExposeTask.execute(ExposeTask.java:84)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.Main.runBuild(Main.java:698)
at org.apache.tools.ant.Main.startAnt(Main.java:199)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.SecurityException: Unsafe
at sun.misc.Unsafe.getUnsafe(Unsafe.java:68)
at org.python.core.PyFrame.<clinit>(PyFrame.java:11)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import socket import sys hostname = socket.gethostname().split('.') while True: try: filename = '_'.join(hostname) sys.stderr.write('Looking for settings_%s.py...\n'%filename) setting = __import__("settings_%s" % filename) l = locals() for key in dir(setting): if key.startswith('_'): continue l[key] = getattr(setting, key) sys.stderr.write('Loaded settings_%s.py...\n'%filename) break except ImportError: if len(hostname) == 1: break hostname = hostname[:-1] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import socket import sys hostname = socket.gethostname().split('.') while True: try: filename = '_'.join(hostname) sys.stderr.write('Looking for settings_%s.py...\n'%filename) setting = __import__("settings_%s" % filename) for key in filter( lambda x: not x.startswith('_'),setting.__dict__.keys() ): locals[key] = setting.__dict__[key] sys.stderr.write('Loaded settings_%s.py...\n'%filename) break except ImportError: if len(hostname) == 1: break hostname = hostname[:-1] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | With trunk revision 5731, i get: C:\stuff\jython\virtualenv>..\jython5731\jython.bat virtualenv.py ENVs\double_check New jython executable in ENVs\double_check\bin\jython.bat Installing setuptools...........................done. C:\stuff\jython\virtualenv\ENVs\double_check>dir 10.12.2008 11:05 <DIR> bin 10.12.2008 11:04 <DIR> cachedir 10.12.2008 10:42 4'759'563 jython-complete.jar 10.12.2008 11:05 <DIR> Lib C:\stuff\jython\virtualenv\ENVs\double_check\bin>jython.bat Jython 2.5b0+ (trunk, Dez 10 2008, 10:41:33) [Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_07 Type "help", "copyright", "credits" or "license" for more information. >>> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | import logging from myapp.lib.base import * from mako.template import Template #uncomment the following if you want to serve a single repo #from mercurial.hgweb.hgweb_mod import hgweb from mercurial.hgweb.hgwebdir_mod import hgwebdir log = logging.getLogger(__name__) class HgController(BaseController): """ This is a rather simple implementation of a pylons mercurial controller. The following are the routes that I used: map.connect('/hg', controller='hg', action="view") map.connect('/hg/*path_info', controller='hg', action="view") """ def view(self, environ, start_response): #the following is only needed when using hgwebdir if environ["PATH_INFO"] == "/hg": environ["PATH_INFO"] = "" if environ["SCRIPT_NAME"] == "": environ["SCRIPT_NAME"] = "/hg" app = self._make_app() response = app(environ,start_response) if environ['HTTP_ACCEPT'].find("mercurial") >= 0: return response else: #wrap the murcurial response in a mako template. template = Template("".join(response), lookup=environ['pylons.pylons'].config['pylons.app_globals'].mako_lookup) return template.render(g=g,c=c,session=session, h=h) def _make_app(self): #for single a repo #return hgweb("/path/to/repo", "Name") return hgwebdir("/path/to/hgweb.config") |