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

raw_input borks with '!' #1568

Closed
spyder-bot opened this issue Feb 17, 2015 · 8 comments
Closed

raw_input borks with '!' #1568

spyder-bot opened this issue Feb 17, 2015 · 8 comments

Comments

@spyder-bot
Copy link
Collaborator

From jradaven...@gmail.com on 2013-09-19T13:48:09Z

Spyder Version: 2.2.4
Python Version: 2.7.5
Qt Version : 4.7.4, PySide 1.1.2 on Darwin
pyflakes >=0.5.0: 0.7.2 (OK)
pep8 >=0.6 : 1.4.5 (OK)
IPython >=0.13 : 1.0.0 (OK)
rope >=0.9.2 : 0.9.4 (OK)
sphinx >=0.6.6 : 1.1.3 (OK)
matplotlib >=1.0: 1.2.1 (OK)
sympy >=0.7.0 : 0.7.2 (OK)
pylint >=0.25 : None (NOK)

What steps will reproduce the problem?

  1. f=raw_input('enter a ! ')
    1. !
    2. print f What is the expected output? What do you see instead? I expect to see a "!" returned.

Instead I get:
evalsc(r"!")

Please provide any additional information below

.

Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1568

@spyder-bot
Copy link
Collaborator Author

From nickolay...@gmail.com on 2014-12-02T07:58:20Z

Same issue with python 3.3.5, spyder 2.3.beta2

print(input())
!hello
evalsc(r"!hello")

print(input())
%hello
evalsc(r"%hello")

As far as I understood, this is due to pair of functions:

  • spyderlib.widgets.externalshell.pythonshell.ExternalPythonShell.send_to_process(self, text)
  • spyderlib.widgets.externalshell.sitecustomize.evalsc(command)

First one forcedly envelopes !- and %-started strings with 'evalsc', and second runs these strings as commands.
Particularly, %pwd should print working directory.

Why this appears in the input, instead of top level of REPL cycle, - I don't know yet.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-12-02T13:27:26Z

issue #2071 has been merged into this issue.

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2014-12-02T13:27:57Z

Status: Accepted
Labels: MS-v2.3.3 Cat-Console

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-01-08T15:18:07Z

Labels: -MS-v2.3.3 MS-v2.3.4

@spyder-bot
Copy link
Collaborator Author

From doug.t...@gmail.com on 2015-01-29T10:00:39Z

Also happens with "%"

Spyder 2.3.2
Python 2.7.6, 32 bit
Windows 7 Professional

IPython >=0.13 : 1.1.0 (OK)
coverage >=0.25 : 3.7.1 (OK)
matplotlib >=1.0: 1.3.1 (OK)
pandas >=0.13.1 : 0.14.1 (OK)
pep8 >=0.6 : 1.4.6 (OK)
pyflakes >=0.5.0: 0.7.3 (OK)
pygments >=1.6 : 1.6 (OK)
pylint >=0.25 : 1.0.0 (OK)
rope >=0.9.2 : 0.10.2 (OK)
sphinx >=0.6.6 : 1.2 (OK)
sympy >=0.7.0 : 0.7.4.1 (OK)
zmq >=2.1.11 : 14.0.1 (OK)

Example:

raw_input()
%hello%
'evalsc(r"%hello%")'

@spyder-bot
Copy link
Collaborator Author

From doug.t...@gmail.com on 2015-01-29T11:07:07Z

Oops, I didn't notice nickolay...@gmail.com 's comment that said the same thing. Sorry for the duplicate!

@spyder-bot
Copy link
Collaborator Author

From ccordoba12 on 2015-01-30T14:36:18Z

Thanks for letting us know about it.

@dougthor42
Copy link
Contributor

Adding comment so that I get notifications and so that I can find my issues/comments more easily.

@dougthor42

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

3 participants