Update search.py

sanitize file name to avoid write error in somes specials cases