Skip to content

Instantly share code, notes, and snippets.

View vortec's full-sized avatar

Fabian Kochem vortec

View GitHub Profile
015-10-30 15:55:02,891 ERROR Exception when serving /cat/test
Traceback (most recent call last):
File "/opt/devpi/local/lib/python2.7/site-packages/waitress/channel.py", line 336, in service
task.service()
File "/opt/devpi/local/lib/python2.7/site-packages/waitress/task.py", line 169, in service
self.execute()
File "/opt/devpi/local/lib/python2.7/site-packages/waitress/task.py", line 388, in execute
app_iter = self.channel.server.application(env, start_response)
File "/opt/devpi/local/lib/python2.7/site-packages/devpi_server/views.py", line 126, in __call__
return self.app(environ, start_response)
connection = psycopg2.connect("dbname=foo")
pool = psycopg2.pool.ThreadedConnectionPool(maxconn=4, "dbname=foo")
tree = Tree(connection=connection)
tree = Tree(pool=pool, prefix='fabian_')
with tree() as transaction:
node = transaction.get_root_node()
node.position = 12
node.save()
import psycopg2
import psycopg2.extras
import time
conn = psycopg2.connect('dbname=tree user=fkochem')
factory = psycopg2.extras.RealDictCursor
cursor = conn.cursor(cursor_factory=factory)
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
sh-3.2# dtruss -n python2.7 > xx.log 2>&1
[run pip in other terminal]
sh-3.2# grep 'pip.conf' xx.log
13955/0x10011: stat64("/Users/xxxxx/workspace/instances/zope/pip.conf\0", 0x7FFF5E00B168, 0x7FFF5E00AD50) = -1 Err#2
13955/0x10011: open_nocancel("/Library/Application Support/pip/pip.conf\0", 0x0, 0x1B6) = -1 Err#2
13955/0x10011: open_nocancel("/Users/xxxxx/.pip/pip.conf\0", 0x0, 0x1B6) = -1 Err#2
13955/0x10011: open_nocancel("/Users/xxxxx/Library/Application Support/pip/pip.conf\0", 0x0, 0x1B6) = -1 Err#2
13955/0x10011: stat64("/Users/xxxxx/workspace/instances/zope/pip.conf\0", 0x7FFF5E00AD38, 0x7FFF5E00A920) = -1 Err#2
13955/0x10011: open_nocancel("/Library/Application Support/pip/pip.conf\0", 0x0, 0x1B6) = -1 Err#2
13955/0x10011: open_nocancel("/Users/xxxxx/.pip/pip.conf\0", 0x0, 0x1B6) = -1 Err#2
sh-3.2# dtruss -f pip search Django 2>&1|grep pip.conf
sh-3.2# dtruss -f pip search Django 2>&1|grep pip
sh-3.2# dtruss -f pip search Django 2>&1
PID/THRD SYSCALL(args) = return
10649/0xc53d: thread_selfid(0x0, 0x0, 0x0) = 50493 0
10649/0xc53d: csops(0x0, 0x0, 0x7FFF54AAE238) = 0 0
10649/0xc53d: issetugid(0x0, 0x0, 0x7FFF54AAE238) = 0 0
10649/0xc53d: shared_region_check_np(0x7FFF54AAC178, 0x0, 0x7FFF54AAE238) = 0 0
10649/0xc53d: stat64("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x7FFF54AAD308, 0x7FFF54AAE238) = 0 0
10649/0xc53d: open("/usr/lib/dtrace/libdtrace_dyld.dylib\0", 0x0, 0x0) = 3 0
class Dependency:
def get_cheese_from_singleton(self):
from foobar_controller import FoobarController
liked = FoobarController.foo_the_bar()
return 'I like {}'.format(liked)
def get_cheese_from_di(self, foobar_controller):
liked = foobar_controller.foo_the_bar()
return 'I like {}'.format(liked)
mysql> SELECT 'hi' SOUNDS LIKE 'hai';
+------------------------+
| 'hi' SOUNDS LIKE 'hai' |
+------------------------+
| 1 |
+------------------------+
1 row in set (0.00 sec)
mysql> SELECT 'hi' SOUNDS LIKE 'no';
+-----------------------+
(sentry)[root@ci] ~sentry # ./bin/sentry --config=etc/conf.py migrate
Running migrations for djcelery:
- Nothing to migrate.
- Loading initial data for djcelery.
Installed 0 object(s) from 0 fixture(s)
Running migrations for django:
- Nothing to migrate.
- Loading initial data for django.
Installed 0 object(s) from 0 fixture(s)
Running migrations for sentry:
(temp2)[root@ci] /opt/temp2 # devpi-server --import=/opt/temp/bin/data --serverdir /opt/devpi/var/server
2014-10-23 17:09:06,957 INFO NOCTX DB: Creating schema
2014-10-23 17:09:07,219 INFO [Wtx-1] setting password for user u'root'
2014-10-23 17:09:07,220 INFO [Wtx-1] created user u'root' with email None
2014-10-23 17:09:07,220 INFO [Wtx-1] created root user
2014-10-23 17:09:07,220 INFO [Wtx-1] created root/pypi index
2014-10-23 17:09:07,300 INFO [Wtx-1] fswriter0: committed: keys: u'.config',u'root/.config'
2014-10-23 17:09:07,302 INFO NOCTX retrieving initial name/serial list
2014-10-23 17:09:12,510 INFO [Wtx0] fswriter1: committed: keys: u'root/pypi/initiallinks'
reading json: /opt/temp/bin/data/dataindex.json
vfs_python.c:6:9: error: unknown field ‘disconnect_fn’ specified in initializer
vfs_python.c:7:9: error: unknown field ‘mkdir_fn’ specified in initializer
vfs_python.c:7:9: warning: initialization from incompatible pointer type [enabled by default]
vfs_python.c:7:9: warning: (near initialization for ‘vfs_python_fns.disk_free’) [enabled by default]
vfs_python.c:8:9: error: unknown field ‘rmdir_fn’ specified in initializer
vfs_python.c:8:9: warning: initialization from incompatible pointer type [enabled by default]
vfs_python.c:8:9: warning: (near initialization for ‘vfs_python_fns.get_quota’) [enabled by default]
vfs_python.c:9:9: error: unknown field ‘create_file_fn’ specified in initializer
vfs_python.c:9:9: warning: initialization from incompatible pointer type [enabled by default]
vfs_python.c:9:9: warning: (near initialization for ‘vfs_python_fns.set_quota’) [enabled by default]