The quotefunction is available for quite some time (Python 2.7?) -- the major drawback is it moved from pipe module to shlex between 3.2 and 3.3.
You have to be prepared to handle both cases while importing that function:
try:
from shlex import quote
except ImportError:
from pipes import quote