Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(setup): fix encoding problem in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Aug 16, 2019
1 parent 42da24d commit 2f90516
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnes/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ def dump_yaml(self, filename: str = None) -> None:
f = filename or self.yaml_full_path
if not f:
f = tempfile.NamedTemporaryFile('w', delete=False, dir=os.environ.get('GNES_VOLUME', None)).name
with open(f, 'w') as fp:
with open(f, 'w', encoding='utf8') as fp:
yaml.dump(self, fp)
self.logger.info('model\'s yaml config is dump to %s' % f)

@classmethod
def load_yaml(cls: Type[T], filename: Union[str, TextIO]) -> T:
if not filename: raise FileNotFoundError
if isinstance(filename, str):
with open(filename) as fp:
with open(filename, encoding='utf8') as fp:
return yaml.load(fp)
else:
with filename:
Expand Down

0 comments on commit 2f90516

Please sign in to comment.