Fix Python – Preferred (or most common) file extension for a Python pickle

At times, I’ve seen .pickle, .pck, .pcl, and .db for files that contain Python pickles, but I am unsure what is the most common or best practice. I know that the latter three extensions are also used for other things.
The related question is: What MIME type is preferred for sending pickles between systems using a REST API?
….

Fix Python – How can I replace (or strip) an extension from a filename in Python?

Is there a built-in function in Python that would replace (or remove, whatever) the extension of a filename (if it has one)?
Example:
print replace_extension(‘/home/user/somefile.txt’, ‘.jpg’)

In my example: /home/user/somefile.txt would become /home/user/somefile.jpg
I don’t know if it matters, but I need this for a SCons module I’m writing. (So….

Fix Python – Build the full path filename in Python

I need to pass a file path name to a module. How do I build the file path from a directory name, base filename, and a file format string?
The directory may or may not exist at the time of call.
For example:
dir_name=’/home/me/dev/my_reports’
base_filename=’daily_report’
format = ‘pdf’

I need to create a string ‘/home/me/dev/my_reports/daily_repo….