GithubHelp home page GithubHelp logo

Comments (7)

jni avatar jni commented on June 14, 2024

Just to clarify, this is a regression between 1.4.0 and 1.4.1, caused by this commit. Would be worth writing a test specifically to catch this when it's fixed.

On 1.4.0:

notedown --match fenced --run markdown/preface.markdown > build_ipynb/preface.ipynb

(no error)

On 1.4.1:

notedown --match fenced --run markdown/preface.markdown > build_ipynb/preface.ipynb
Traceback (most recent call last):
  File "/Users/nuneziglesiasj/anaconda/envs/elegant/bin/notedown", line 9, in <module>
    load_entry_point('notedown==1.4.1', 'console_scripts', 'notedown')()
  File "/Users/nuneziglesiasj/anaconda/envs/elegant/lib/python3.4/site-packages/notedown/main.py", line 265, in cli
    writer.write(notebook, codecs.getwriter('utf-8')(sys.stdout))
  File "/Users/nuneziglesiasj/anaconda/envs/elegant/lib/python3.4/site-packages/ipython-3.1.0-py3.4.egg/IPython/nbformat/__init__.py", line 161, in write
    fp.write(s)
  File "/Users/nuneziglesiasj/anaconda/envs/elegant/lib/python3.4/codecs.py", line 374, in write
    self.stream.write(data)
TypeError: must be str, not bytes

from notedown.

aaren avatar aaren commented on June 14, 2024

Thanks both.

@takluyver I've just imported from IPython since that's a strong dependency anyway.

@jni yes more tests would be great. I need to be a bit more vigilant about python 3. I don't use it everyday so simple things like this can slip through.

from notedown.

aaren avatar aaren commented on June 14, 2024

I've released 1.4.2 with this fix.

from notedown.

jni avatar jni commented on June 14, 2024

@aaren, thanks for the really quick fix!

I don't use it everyday

Maybe you should! I made the switch just a couple of months ago and I've been pretty happy. =)

from notedown.

aaren avatar aaren commented on June 14, 2024

@jni I'll switch once thesis is finished...

There is lots of good stuff in python 3 so I want to switch, but at the same time I can't afford to go into a conversion rabbit hole right now!

from notedown.

takluyver avatar takluyver commented on June 14, 2024

Be aware that that function is moving in the reorganisation for IPython/Jupyter 4.0. We've left it exposed at the old import location for backwards compatibility, so your fix should be fine through 4.x releases, but at some point we'll remove it from IPython.utils.io. We're still discussing naming conventions for the new packages, but at present that's located in jupyter_nbconvert.utils.io.

from notedown.

aaren avatar aaren commented on June 14, 2024

Thanks. When Jupyter is consolidated I'll switch to that.

from notedown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.