This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- virtualenv.orig 2011-04-26 20:27:02.557885000 -0700 | |
+++ virtualenv.py 2011-04-26 21:49:58.111075000 -0700 | |
@@ -394,6 +394,14 @@ | |
# Some bad symlink in the src | |
logger.warn('Cannot find file %s (bad symlink)', src) | |
return | |
+ if os.path.isdir(dest): | |
+ logger.debug('Directory %s already exists', dest) | |
+ logger.indent += 2 | |
+ try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisite: python2.7-dev | |
# Compile with: gcc -shared -fPIC -o liboverride.so override_pydict.c -ldl | |
# Run as: LD_PRELOAD=./liboverride.so python | |
#define _GNU_SOURCE 1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dlfcn.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Prerequisite: python2.7-dev | |
// Compile with: gcc -shared -fPIC -o liboverride.so override_pydict.c -ldl | |
// Run as: LD_PRELOAD=./liboverride.so python | |
#define _GNU_SOURCE 1 | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <dlfcn.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Objects/dictobject.c b/Objects/dictobject.c | |
index 5cf9ad1..d6b9c8d 100644 | |
--- a/Objects/dictobject.c | |
+++ b/Objects/dictobject.c | |
@@ -8,6 +8,7 @@ | |
*/ | |
#include "Python.h" | |
+#include "frameobject.h" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'x\x01uZ\t|\x1d\xc5y\xd7iIO\x87\x0f\xb0\xb0\xc1\x86\xb59,\x82%\xeb\xb0$\xcb\x04\xdb:|\xcaz6\xb6\x06\xcb\x10e3ow\xde\xdb\xb5\xf6\xed\xbe\x99\xdd\xd5\xd3\x13(\x01\x8a[?\xf5JH\x08\xa1@\xa1MH[\x12J\x93\xd2\x96\x84\xb6!!m\x1a\xda\x946!\xb4\x81\x84BhH\n=BB\x13\x8e\x94\xf4?\xb3\xef\x92l\xf4\xfby\xdf\xee7\xdf7\xf3\xcd\xf7}\xf3]\xe3\x9bk\x16xu\x07Y!h`\xbb)^\xb3\x7fO\xcd\xd5;o__\xfd\x06i\xb6}\xddv\xa9\x11\xd8\xb3\x8c\xd7\xe6\xc9\x1a|\'\xbcT\xe8\xebIO\xe8l\x96\xb9\x01\xaf\xcb\x93:\x93Q\x87\xd7\xc7\xc9\x8a4\xcd\x90c\x87\xf9\nr\xd4\n\x82\xcc\xcem\xdb\x00\xf0\xbbR\x9e\x97rX\x97\xe1\xa5\xd5\xf7n~M\xcf\xe5\xbd\xdd\'<\xe1\x98\xf2\x97\xe6.\xef\x1d\xc5\xcba\xcf\xc7s\xd8M1\x87\xe1M\x82F\x87\xf1\x18\xea\xee\xde\xde\xcf\x1bH\xcc\xf2B\xe1\xeb\xc2\xcb\xfa\xbcq\x9a7u,\xf0X\x07i\xf22\xcc\xd5\x03;\xcdx\xf3b\x15\x89\x19\x8e\xe7\xb3\xe8\xbbe\xb1\xe6\xfezR\x9fth\xca\xe7\xad\x18\xac\xb1M\xde\xb6X;wd\x17iN\x84\xbe\xed2\x1f\x1b4\xf9\xca\xc5\xba\x07\xd7<Z\x15.\xf0U\x1dV\xb3\xa4\xb2@\xbb\xa7\xd9\x02\x91\x05\x82\xec\x91]V\x19g\xb5\xc2\xc1(p^XU\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pylibmc.test import make_test_client | |
class Foo(object): | |
def __getstate__(self): | |
return dict(a=1) | |
def __setstate__(self, d): | |
assert d['a'] == 1 | |
def break_pickling(): | |
global Foo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reproduce bug: https://gist.github.com/1503176 | |
from pylibmc.test import make_test_client | |
class Foo(object): | |
def __getstate__(self): | |
return dict(a=1) | |
def __setstate__(self, d): | |
assert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
def decorator(func): | |
def wrapper(*args, **kwargs): | |
return func(*args, **kwargs) | |
wrapper.__name__ += '_' + func.__name__ | |
return wrapper | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProcessingPipeline(object): | |
def __init__(self, *functions, **kwargs): | |
self.functions = functions | |
self.data = kwargs.get('data') | |
def __call__(self, data): | |
return ProcessingPipeline(*self.functions, data=data) | |
def __iter__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import lxml.html.defs | |
lxml.html.defs.empty_tags = lxml.html.defs.empty_tags.union(['wbr']) | |
reload(lxml.html) | |
reload(lxml) | |
print '<wbr> is empty tag:', 'wbr' in lxml.html.defs.empty_tags | |
from lxml import etree |
OlderNewer