Skip to content
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

Broken print output -- prepended by garbage #12492

Open
dain-xyz opened this issue Aug 12, 2020 · 3 comments
Open

Broken print output -- prepended by garbage #12492

dain-xyz opened this issue Aug 12, 2020 · 3 comments

Comments

@dain-xyz
Copy link

I installed Jupyter and Ipython in a virtual environment. Whenever I type something in the IPython REPL and press enter, the output is prepended with a bunch of repeated garbage:

In [2]: print("Hello, world!")
line='print("Hello, world!")\n', last_line=b'', encoding=None
print
(
"Hello, world!"
)


line=b'', last_line='print("Hello, world!")\n', encoding=None

line='print("Hello, world!")\n', last_line=b'', encoding=None
print
(
"Hello, world!"
)


line=b'', last_line='print("Hello, world!")\n', encoding=None

line='print("Hello, world!")\n', last_line=b'', encoding=None
print
(
"Hello, world!"
)


line=b'', last_line='print("Hello, world!")\n', encoding=None
Hello, world!
In [3]: 2 + 2
line='2 + 2\n', last_line=b'', encoding=None
2
+
2


line=b'', last_line='2 + 2\n', encoding=None

line='2 + 2\n', last_line=b'', encoding=None
2
+
2


line=b'', last_line='2 + 2\n', encoding=None

line='2 + 2\n', last_line=b'', encoding=None
2
+
2


line=b'', last_line='2 + 2\n', encoding=None

line='2 + 2', last_line=b'', encoding=None
2
+
2
line='', last_line='2 + 2', encoding=None
Out[3]: 4

This garbage output occurs in both IPython REPL in a terminal, and Jupyter notebooks in a browser.

I'm running Windows 10 with Python 3.8.1. The package versions are:

  • jupyter 1.0.0
  • ipython 7.17.0
  • notebook 6.1.1

These were installed via Poetry. I installed the exact same Python and package versions on a separate PC (running Linux) and the problem did not appear. Is this a bug with IPython, or is something configured wrong on my Windows PC?

@Carreau
Copy link
Member

Carreau commented Aug 15, 2020

probably a debug statement forgotten somewhere, good to know you are on windows.
Does it do the same if you install IPython 7.16.0 ?
If you get an earlier version of prompt_toolkit ?
If you get an earlier version of jedi ?

@dain-xyz
Copy link
Author

dain-xyz commented Aug 17, 2020

I downgraded my Python version back to 3.7.6, changing nothing else, and the problem went away, so it seems to be caused by something that changed between 3.7 and 3.8.

The full list of packages in the two environments:

backcall 0.2.0
colorama 0.4.3
decorator 4.4.2
ipython 7.17.0
ipython-genutils 0.2.0
jedi 0.17.2
parso 0.7.1
pickleshare 0.7.5
prompt-toolkit 3.0.6
pygments 2.6.1
six 1.15.0
traitlets 4.3.3
wcwidth 0.2.5

@dain-xyz
Copy link
Author

I upgraded to Python 3.8.6, that seems to have fixed it.

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

No branches or pull requests

2 participants