suvarchal / IPyNCL

NCAR Command Language Kernel for Jupyter/IPython
MIT License
19 stars 11 forks source link

Python3 edits #3

Closed abrammer closed 7 years ago

abrammer commented 7 years ago

Tested in Jupyter 4.3.0 and also with Python2.7 (Jupyter 4.2.1) and all seems to function correctly.

Not entirely sure what was going on with my line 119 (your 115) in ncl_kernal.py. I was getting this error:

 output = ''.join([line for line in output.splitlines()[1::] if line.strip()])
TypeError: sequence item 0: expected str instance, bytes found

Made a small change based on this and it seems to work correctly in both 3.5 (4.3.0) and 2.7 (4.2.1) https://stackoverflow.com/questions/39673901/typeerror-sequence-item-0-expected-str-instance-bytes-found

I screwed up the branch on the previous pull request. Sorry about that.

Still some issues with the returned output, but it mostly works.

suvarchal commented 7 years ago

thanks, will checkout tomorrow

On Sat, Aug 19, 2017 at 12:21 PM, abrammer notifications@github.com wrote:

Tested in Jupyter 4.3.0 and also with Python2.7 (Jupyter 4.2.1) and all seems to function correctly.

Not entirely sure what was going on with my line 119 (your 115) in ncl_kernal.py. I was getting this error:

output = ''.join([line for line in output.splitlines()[1::] if line.strip()]) TypeError: sequence item 0: expected str instance, bytes found

Made a small change based on this and it seems to work correctly in both 3.5 (4.3.0) and 2.7 (4.2.1) https://stackoverflow.com/ questions/39673901/typeerror-sequence-item-0-expected-str- instance-bytes-found

I screwed up the branch on the previous pull request. Sorry about that.

Still some issues with the returned output, but it mostly works.

You can view, comment on, or merge this pull request online at:

https://github.com/suvarchal/IPyNCL/pull/3 Commit Summary

  • Make print statement py3 friendly
  • make cPickle import python3 happy
  • switch a bunch of tabs for spaces, so script is consistent
  • Had issues with this line, this fixes json decode errors

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/suvarchal/IPyNCL/pull/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AOnPT04ATh1HIMubuEYzZp2mfgbBrOVGks5sZwuRgaJpZM4O8YGX .