pipeline.py: Fixes import for Python 3.
pipeline.py: Fixes str encoding for Python 3.