def sanitize_filename(s):
	"""Sanitizes a string so it could be used as part of a filename."""
	def replace_insane(char):
		if char in u' .\\/|?*<>:"' or ord(char) < 32:
			return '_'
		return char
	return u''.join(map(replace_insane, s)).strip('_')