Skip to content

ipython3 set_next_input() failure #1051

hpaulj opened this Issue Nov 27, 2011 · 1 comment

2 participants

hpaulj commented Nov 27, 2011

IPython0.11, running under Python 3.2.2

magic_rep and magic_loadpy do not set the next input as expected under Python2

The problem is in core/ set_next_input(self, s) where:

if isinstance(s, str):
s = s.encode(self.stdin_encoding, 'replace')

works fine under Python2; but in Python3 converts str to bytes

self.rl_next_input = s does not work bytes

Removing the encode makes ipython3 work as expected. However I have not tested it
on a case where the encode matters when using python2. Older versions of ipython do not have this encode statement.

Apparently only these 2 magic functions use set_next_input(), and their failure does not trigger any kind of error message.

IPython member
@takluyver takluyver closed this Nov 27, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.