Skip to content
Permalink
Browse files

fix(setup): fix encoding problem in setup.py

  • Loading branch information...
hanxiao committed Aug 16, 2019
1 parent 42da24d commit 2f90516822a56c63833805c8b88f732007714b04
Showing with 2 additions and 2 deletions.
  1. +2 −2 gnes/base/__init__.py
@@ -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:

0 comments on commit 2f90516

Please sign in to comment.
You can’t perform that action at this time.