#
#   Pyrex -- Things that don't belong
#            anywhere else in particular
#

import os, sys

def replace_suffix(path, newsuf):
    base, _ = os.path.splitext(path)
    return base + newsuf

def open_new_file(path):
    #  Open and truncate existing file to
    #  preserve metadata on the Mac.
    return open(path, "w+")



syntax highlighted by Code2HTML, v. 0.9.1