Skip to content

unicode support for string type checks, fixes #929 #930

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 4 commits into from
Sep 30, 2014

Conversation

belevtsoff
Copy link
Contributor

str comparisons cause exceptions with unrelated error messages when using e.g. unicode port names (see #929 for concrete example).

I just ran for f in grep -rle "isinstance([^)]*str)" .; do sed -i.old "s/isinstance(\([^)]*\)str)/isinstance(\1basestring)/g" $f; done in the nipype directory. Let's see what Travis says...

@mwaskom
Copy link
Member

mwaskom commented Sep 25, 2014

It might make sense to be proactive about the eventual movement to Python 3 and use six.string_types here.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 55b7d33 on belevtsoff:master into 7afedad on nipy:master.

@belevtsoff
Copy link
Contributor Author

@mwaskom but that would introduce another dependency... isn't it something automatic code converters can handle easily?

@satra
Copy link
Member

satra commented Sep 26, 2014

+1 for @mwaskom suggestion.

@belevstoff - six can be included as a single file in nipype.externals.

@mwaskom
Copy link
Member

mwaskom commented Sep 26, 2014

Generally projects package six internally (I think it's a single file exactly for this reason). But the other devs should weigh in before we make that decision.

@mwaskom
Copy link
Member

mwaskom commented Sep 26, 2014

isn't it something automatic code converters can handle easily?

The idea is that you use six so that you can have a single codebase that runs on Python 2 and Python 3. This is becoming the preferred way to handle supporting Python 3 over using an automatic converter than runs at package time.

@belevtsoff
Copy link
Contributor Author

alright, so let's see if there are no objections and then I'll add those commits

@belevtsoff
Copy link
Contributor Author

not sure why build failed, looks like an unrelated error

@satra
Copy link
Member

satra commented Sep 30, 2014

retrying on travis.

@belevtsoff
Copy link
Contributor Author

Ok, the new problem seems to be caused by a66018a

@satra
Copy link
Member

satra commented Sep 30, 2014

fixed upstream - if you merge and push this should now go through.

pulled updates from the main repo
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 9c2a9b0 on belevtsoff:master into * on nipy:master*.

@belevtsoff
Copy link
Contributor Author

uugh, this server connection...

chrisgorgo added a commit that referenced this pull request Sep 30, 2014
unicode support for string type checks, fixes #929
@chrisgorgo chrisgorgo merged commit 0069aa3 into nipy:master Sep 30, 2014
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.

5 participants