Fix bug I introduced in ascii.py that is only hit
when writing p.  Also modify a test so that it would
detect this kind of bug in the future.
Merge pull request #380 from ketch/bugfix_write_p

Fix bug I introduced in ascii.py that is only hit when writing p.