Skip to content

Instantly share code, notes, and snippets.

"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff:
@nybbles
nybbles / no_starvation.py
Created December 6, 2011 07:53
Solution to readers-writer problem
# Implement this!
# Look here for answer: http://www.rfc1149.net/blog/2011/01/07/the-third-readers-writers-problem/