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

Extra newline before input #5242

Closed
arcanemutterings opened this issue Sep 15, 2017 · 5 comments
Closed

Extra newline before input #5242

arcanemutterings opened this issue Sep 15, 2017 · 5 comments

Comments

@arcanemutterings
Copy link

Description

This code https://gist.github.com/Nixerrr/6ab82500b7995a1b1dc70998fdf5a893 produces an unexpected output, because there's an extra newline before the input line.
image
Meanwhile, this is what the same code produces in the Cloud9 IDE:
image

What steps will reproduce the problem?

  1. Run that code in Spyder.
  2. Run it in a different IDE
  3. The output is different

What is the expected output? What do you see instead?
I expected:
foo!
bar? h
baz!

Instead I got:
foo!

bar? h
baz!

Please provide any additional information below

Version and main components

  • Spyder Version: 3.1.4
  • Python Version: 3.6.1
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.5.0 (OK)
pep8 >=0.6       :  1.7.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
pandas >=0.13.1  :  0.20.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
sphinx >=0.6.6   :  1.5.6 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
matplotlib >=1.0 :  2.0.2 (OK)
sympy >=0.7.3    :  1.0 (OK)
pylint >=0.25    :  1.6.4 (OK)

@ccordoba12
Copy link
Member

Thanks for reporting. Although annoying, this is a simple bug and we don't have time to fix it right now. Sorry.

@mjpieters
Copy link

The linked gist is no longer available. Can the issue be updated with an inline case? From this Stack Overflow question, I surmise it is something as simple as:

print('foo!')
input('bar? ')
print('baz!')

@ccordoba12
Copy link
Member

It seems an input statement, combined with other print ones generates this error.

@ccordoba12 ccordoba12 modified the milestones: wishlist, important Nov 3, 2018
@TCJulian
Copy link

Hey, I am a complete stranger here, but wanted to give my 2 cents since I stumbled upon this thread.

I found a small work around to this bug by modifying the leading print function's end= parameter to ''.

The following code results in the desired output:

print('foo!', end='')
input('bar? ')
print(bax!')

Output

foo!
bar? h
baz!

Maybe this will help in squashing this bug? Best of luck!

@ccordoba12 ccordoba12 removed this from the important milestone Jun 14, 2022
@ccordoba12
Copy link
Member

Closing as a duplicate of issue #16504, which was fixed on Spyder 5.3.1.

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

No branches or pull requests

4 participants