Skip to content

Commit 612e9ee

Browse files
sunqmsokolov-group
authored andcommitted
Explicit file encoding for cuda mixed environment due to issue NVIDIA/cuda-python#29
1 parent f07dfcc commit 612e9ee

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎pyscf/gto/mole.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,7 +2100,7 @@ def tofile(mol, filename, format=None):
21002100
if format is None: # Guess format based on filename
21012101
format = os.path.splitext(filename)[1][1:]
21022102
string = tostring(mol, format)
2103-
with open(filename, 'w') as f:
2103+
with open(filename, 'w', encoding='utf-8') as f:
21042104
f.write(string)
21052105
f.write('\n')
21062106
return string
@@ -2516,9 +2516,9 @@ def build(self, dump_input=True, parse_arg=ARGPARSE,
25162516
print('output file: %s' % self.output)
25172517

25182518
if self.output == '/dev/null':
2519-
self.stdout = open(os.devnull, 'w')
2519+
self.stdout = open(os.devnull, 'w', encoding='utf-8')
25202520
else:
2521-
self.stdout = open(self.output, 'w')
2521+
self.stdout = open(self.output, 'w', encoding='utf-8')
25222522

25232523
if self.verbose >= logger.WARN:
25242524
self.check_sanity()

0 commit comments

Comments
 (0)