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

FileNotFoundError history.py when running code in the IPython console #6431

Closed
Ausca opened this issue Feb 10, 2018 · 2 comments
Closed

FileNotFoundError history.py when running code in the IPython console #6431

Ausca opened this issue Feb 10, 2018 · 2 comments

Comments

@Ausca
Copy link

Ausca commented Feb 10, 2018

Description

What steps will reproduce the problem?

  1. Launch Spyder
  2. Typing into IPython Console and entering raises error
  3. Running code from a file raises error once after typing into IPython Console but then doesn't raise error until typing into IPython Console again

What is the expected output? What do you see instead?
Expected Output is still the same except error is raised in separate window

Please provide any additional information below
Code still works and outputs the correct output when typing into IPython Console

File "C:\Users\Name\Anaconda3\lib\site-packages\spyder\widgets\mixins.py", line 758, in add_to_history
encoding.write(text, self.history_filename, mode='ab')
File "C:\Users\Name\Anaconda3\lib\site-packages\spyder\utils\encoding.py", line 227, in write
with open(filename, mode) as textfile:
FileNotFoundError: [Errno 2] No such file or directory: '%USERPROFILE\.spyder-py3\history.py'

Version and main components

  • Spyder Version: 3.2.4
  • Python Version: 3.6.3
  • Qt Versions: 5.6.2, PyQt5 5.6 on Windows

Dependencies

pyflakes >=0.6.0 :  1.6.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pygments >=2.0   :  2.2.0 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
numpy >=1.7      :  1.13.3 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
rope >=0.9.4     :  0.10.5 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
sympy >=0.7.3    :  1.1.1 (OK)
cython >=0.21    :  0.26.1 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
IPython >=4.0    :  6.1.0 (OK)
pylint >=0.25    :  1.7.4 (OK)

@ccordoba12
Copy link
Member

Thanks for reporting. We'll fix this problem in our next release.

@ccordoba12 ccordoba12 changed the title Raising Error But Code Still Runs FileNotFoundError history.py when running code in the IPython console Feb 10, 2018
@ccordoba12
Copy link
Member

@dalthviz, please catch OSError and IOError in this line

https://github.com/spyder-ide/spyder/blob/3.x/spyder/widgets/mixins.py#L758

and pass in the except part.

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