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

Don't attempt to tokenize binary files for tracebacks #1341

Merged
merged 3 commits into from Jan 29, 2012

Conversation

takluyver
Copy link
Member

Previously we had been trying and just catching the exception, but in corner cases the tokenizer can run for several seconds before raising an exception (#1317). This skips tokenizing if the file has the extension .so, .pyd or .dll (should I add any more to this list?).

Closes gh-1317

@minrk
Copy link
Member

minrk commented Jan 29, 2012

Why blacklist binaries instead of whitelisting '.py'?

@takluyver
Copy link
Member Author

That's probably a better way to do it.

@takluyver
Copy link
Member Author

I think .py, .pyw, .pyc and .pyo cover all the files that we should attempt to tokenise.

@fperez
Copy link
Member

fperez commented Jan 29, 2012

Hold on, what about extensionless-files? It's perfectly valid to call %run foo if foo is a python script with no extension. Will this still work in that case?

@takluyver
Copy link
Member Author

It didn't - reverted to a blacklist.

@fperez
Copy link
Member

fperez commented Jan 29, 2012

Much better, merging. Thanks!

fperez added a commit that referenced this pull request Jan 29, 2012
Don't attempt to tokenize binary files for tracebacks.

Previously we had been trying and just catching the exception, but in corner cases the tokenizer can run for several seconds before raising an exception (#1317). This skips tokenizing if the file has the extension .so, .pyd or .dll.

Closes gh-1317.
@fperez fperez merged commit a1769ad into ipython:master Jan 29, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Don't attempt to tokenize binary files for tracebacks.

Previously we had been trying and just catching the exception, but in corner cases the tokenizer can run for several seconds before raising an exception (ipython#1317). This skips tokenizing if the file has the extension .so, .pyd or .dll.

Closes ipythongh-1317.
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

Successfully merging this pull request may close these issues.

Very slow traceback construction from Cython extension
3 participants