call the function codecs.open with 3 arguments: sql_file, string 'r' and encoding set to settings.FILE_CHARSET, with the result renamed to fp,
with codecs . open ( sql_file , 'r' , encoding = settings . FILE_CHARSET ) as fp :