fixing path for log file using python magic