Skip to content

Fix: String-based error inspection on Python 3 #2092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2017

Conversation

mwaskom
Copy link
Member

@mwaskom mwaskom commented Jun 23, 2017

See #2091

@codecov-io
Copy link

codecov-io commented Jun 23, 2017

Codecov Report

Merging #2092 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2092      +/-   ##
==========================================
- Coverage   72.14%   72.13%   -0.01%     
==========================================
  Files        1139     1138       -1     
  Lines       57310    57271      -39     
  Branches     8215     8207       -8     
==========================================
- Hits        41344    41315      -29     
+ Misses      14673    14664       -9     
+ Partials     1293     1292       -1
Flag Coverage Δ
#smoketests 72.13% <0%> (-0.01%) ⬇️
#unittests 69.75% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/io.py 52.84% <0%> (ø) ⬆️
nipype/interfaces/afni/utils.py 77.09% <0%> (-0.81%) ⬇️
nipype/interfaces/afni/tests/test_auto_Edge3.py
nipype/interfaces/base.py 83.8% <0%> (+0.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94a11f0...7d71798. Read the comment docs.

@effigies
Copy link
Member

effigies commented Jun 25, 2017

Since these are OSErrors, can you do in why.strerror and in inst.strerror? While OSError.__str__() will probably always include strerror, it doesn't seem to be part of the documented API, so it seems better to me to check the strerror attribute.

@mwaskom
Copy link
Member Author

mwaskom commented Jun 25, 2017

I couldn't find anything in the docs one way or the other about the preferred API but I am trying it your way.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to merge with the following reversion.

@@ -86,7 +86,7 @@ def copytree(src, dst, use_hardlink=False):
copyfile(srcname, dstname, True, hashmethod='content',
use_hardlink=use_hardlink)
except (IOError, os.error) as why:
errors.append((srcname, dstname, str(why)))
errors.append((srcname, dstname, why.strerror))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IOError does not have a strerror attribute. I think here str() is the more appropriate choice.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@effigies effigies merged commit 1a76182 into nipy:master Jun 26, 2017
@satra satra added this to the 0.14.0 milestone Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants