Fix for #406 (ascii issue) #536

Merged
merged 10 commits into from Nov 25, 2016

Conversation

Projects
None yet
5 participants
@hakonsbm
Contributor

hakonsbm commented Nov 1, 2016

PyNEST will now raise a NESTError when trying to use non-ascii characters under Python 2.7.

We did not manage to find a way to make PyNEST work with non-ascii characters under Python 2.7. Note that this works under Python 3.

@mention-bot

This comment has been minimized.

Show comment
Hide comment
@mention-bot

mention-bot Nov 1, 2016

@hakonsbm, thanks for your PR! By analyzing the history of the files in this pull request, we identified @otizonaizit, @apeyser and @jougs to be potential reviewers.

@hakonsbm, thanks for your PR! By analyzing the history of the files in this pull request, we identified @otizonaizit, @apeyser and @jougs to be potential reviewers.

@jougs

This comment has been minimized.

Show comment
Hide comment
@jougs

jougs Nov 2, 2016

Contributor

@hakonsbm: can you please remove the trailing whitespace in pynest/pynestkernel.pyx? Thanks!

Contributor

jougs commented Nov 2, 2016

@hakonsbm: can you please remove the trailing whitespace in pynest/pynestkernel.pyx? Thanks!

@jougs

jougs approved these changes Nov 2, 2016

LGTM.

@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Nov 17, 2016

Contributor

@apeyser Could you have a look at this one and see if it is ready for a second thumb up?

Contributor

heplesser commented Nov 17, 2016

@apeyser Could you have a look at this one and see if it is ready for a second thumb up?

@apeyser

This comment has been minimized.

Show comment
Hide comment
@apeyser

apeyser Nov 17, 2016

Contributor

I'd suggest wrapping up

if python3_test:
    def encode(s): return s.encode('utf-8')
    def decode(s): return s.decode('utf-8')
else:
    ... for python2.7

just to remove the repeated ifs scattered through the code.

Contributor

apeyser commented Nov 17, 2016

I'd suggest wrapping up

if python3_test:
    def encode(s): return s.encode('utf-8')
    def decode(s): return s.decode('utf-8')
else:
    ... for python2.7

just to remove the repeated ifs scattered through the code.

@hakonsbm

This comment has been minimized.

Show comment
Hide comment
@hakonsbm

hakonsbm Nov 25, 2016

Contributor

@apeyser Something like this?

Contributor

hakonsbm commented Nov 25, 2016

@apeyser Something like this?

@apeyser

Just fix up the spacing and approved.

pynest/nest/__init__.py
- def decode(s): return s.decode('utf-8')
+ def decode(s):
+ return s.decode('utf-8')

This comment has been minimized.

@apeyser

apeyser Nov 25, 2016

Contributor

Add a newline after this

@apeyser

apeyser Nov 25, 2016

Contributor

Add a newline after this

pynest/nest/__init__.py
@@ -82,19 +82,21 @@ def catching_sli_run(cmd):
"""
if sys.version_info >= (3,):
- engine.run('{%s} runprotected' % cmd) # Python 3
+ def encode(s): return s

This comment has been minimized.

@apeyser

apeyser Nov 25, 2016

Contributor

Precisely like this. The rest of the code is simplified and clear.

@apeyser

apeyser Nov 25, 2016

Contributor

Precisely like this. The rest of the code is simplified and clear.

@hakonsbm

This comment has been minimized.

Show comment
Hide comment
@hakonsbm

hakonsbm Nov 25, 2016

Contributor

@apeyser Fixed.

Contributor

hakonsbm commented Nov 25, 2016

@apeyser Fixed.

@apeyser apeyser merged commit 870d23b into nest:master Nov 25, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@hakonsbm hakonsbm deleted the hakonsbm:non_ascii_handling branch Nov 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment