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

nbstripout --uninstall fails #40

Closed
AllanLRH opened this issue Nov 15, 2016 · 1 comment
Closed

nbstripout --uninstall fails #40

AllanLRH opened this issue Nov 15, 2016 · 1 comment
Assignees
Milestone

Comments

@AllanLRH
Copy link

$ nbstripout --uninstall
Traceback (most recent call last):
  File "/lscr_paper/allan/miniconda3/envs/msth/bin/nbstripout", line 11, in <module>
    sys.exit(main())
  File "/lscr_paper/allan/miniconda3/envs/msth/lib/python3.5/site-packages/nbstripout.py", line 248, in main
    sys.exit(uninstall(args.attributes))
  File "/lscr_paper/allan/miniconda3/envs/msth/lib/python3.5/site-packages/nbstripout.py", line 191, in uninstall
    f.write(''.join(lines))
ValueError: I/O operation on closed file.

I've added a few comments to the file, and they disappeared along with the line added by nbstripout --install, so I guess the file was overwritten with a blank file.

The problem happens on Linux running Bash and on OS X running Zsh.

I'm using the Anaconda Python Distribution, Python 3.5.2, inside a conda environment, and I installed using pip install nbstripout.

@kynan
Copy link
Owner

kynan commented Nov 15, 2016

Thanks for the report! I was able to reproduce this on Anaconda Python 3.5.2, will push a fix.

Not sure why it fails though: the attributes file was opened twice, once for reading and once for writing.

@kynan kynan closed this as completed in 44aa01f Nov 15, 2016
@kynan kynan added this to the 0.2.9 milestone Nov 15, 2016
@kynan kynan self-assigned this Nov 15, 2016
@kynan kynan added the type:bug label Nov 15, 2016
@kynan kynan mentioned this issue Dec 11, 2016
ooiM added a commit to ooiM/nbstripout that referenced this issue Jun 2, 2020
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

2 participants