mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'bugfix/open-method-typeerror-win' into 'dev'
Fix duplicate encoding argument on windows migration read See merge request crafty-controller/crafty-commander!149
This commit is contained in:
commit
d884cac5d7
@ -392,11 +392,9 @@ class MigrationManager():
|
|||||||
"""
|
"""
|
||||||
Reads a migration from a file.
|
Reads a migration from a file.
|
||||||
"""
|
"""
|
||||||
call_params = {}
|
|
||||||
if helper.is_os_windows() and sys.version_info >= (3, 0):
|
if helper.is_os_windows() and sys.version_info >= (3, 0):
|
||||||
# if system is windows - force utf-8 encoding
|
# if system is windows - force utf-8 encoding
|
||||||
call_params['encoding'] = 'utf-8'
|
with open(os.path.join(helper.migration_dir, name + '.py'), encoding='utf-8') as f:
|
||||||
with open(os.path.join(helper.migration_dir, name + '.py'), **call_params, encoding='utf-8') as f:
|
|
||||||
code = f.read()
|
code = f.read()
|
||||||
scope = {}
|
scope = {}
|
||||||
code = compile(code, '<string>', 'exec', dont_inherit=True)
|
code = compile(code, '<string>', 'exec', dont_inherit=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user