Skip to content

Commit 90f0cc0

Browse files
committed
fixing missing open from builtins, unicode details
1 parent a16b7eb commit 90f0cc0

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

nipype/caching/memory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def __init__(self, base_dir):
178178
elif not os.path.isdir(base_dir):
179179
raise ValueError('base_dir should be a directory')
180180
self.base_dir = base_dir
181-
open(os.path.join(base_dir, 'log.current'), 'w')
181+
open(os.path.join(base_dir, 'log.current'), 'a').close()
182182

183183
def cache(self, interface):
184184
""" Returns a callable that caches the output of an interface

nipype/interfaces/slicer/generate_classes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def add_class_to_package(class_codes, class_names, module_name, package_dir):
3434
module_python_filename = os.path.join(package_dir, "%s.py" % module_name)
3535
f_m = open(module_python_filename, 'w')
3636
f_i = open(os.path.join(package_dir, "__init__.py"), 'a+')
37-
f_m.write("""# -*- coding: utf8 -*-
37+
f_m.write("""# -*- coding: utf-8 -*-
3838
\"\"\"Autogenerated file - DO NOT EDIT
3939
If you spot a bug, please report it on the mailing list and/or change the generator.\"\"\"\n\n""")
4040
imports = """from __future__ import print_function, division, unicode_literals, absolute_import

nipype/interfaces/slicer/legacy/filtering.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# -*- coding: utf8 -*-
32
"""Autogenerated file - DO NOT EDIT
43
If you spot a bug, please report it on the mailing list and/or change the generator."""
54

@@ -28,7 +27,7 @@ class OtsuThresholdImageFilter(SEMLikeCommandLine):
2827
2928
The original reference is:
3029
31-
N.Otsu, ‘‘A threshold selection method from gray level histograms,’’ IEEE Trans.Syst.ManCybern.SMC-9,62–66 1979.
30+
N.Otsu, A threshold selection method from gray level histograms, IEEE Trans.Syst.ManCybern.SMC-9,62–66 1979.
3231
3332
version: 0.1.0.$Revision: 19608 $(alpha)
3433

nipype/utils/misc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ def natural_keys(text):
3232

3333

3434
def trim(docstring, marker=None):
35+
if isinstance(docstring, bytes):
36+
docstring = str(docstring, 'utf-8')
37+
3538
if not docstring:
3639
return ''
3740
# Convert tabs to spaces (following the normal Python rules)

tools/make_examples.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
44
This also creates the index.rst file appropriately, makes figures, etc.
55
"""
6-
from __future__ import unicode_literals
7-
6+
from __future__ import print_function, division, unicode_literals, absolute_import
87
from builtins import open
98
from past.builtins import execfile
109
# -----------------------------------------------------------------------------

0 commit comments

Comments
 (0)