Fix display of errors in compiled code on Python 3 #1106

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@takluyver
Member

takluyver commented Dec 5, 2011

@juliantaylor, I've checked this, and it appears to solve the issue in Python 3.

Closes gh-1100

@@ -879,7 +879,7 @@ def linereader(file=file, lnum=[lnum], getline=linecache.getline):
# enclosing scope.
for token in generate_tokens(linereader):
tokeneater(*token)
- except IndexError:
+ except (IndexError, UnicodeDecodeError):

This comment has been minimized.

@minrk

minrk Dec 6, 2011

Member

Is there any reason this should casta wider net? If not, go ahead and merge.

@minrk

minrk Dec 6, 2011

Member

Is there any reason this should casta wider net? If not, go ahead and merge.

This comment has been minimized.

@takluyver

takluyver Dec 6, 2011

Member

As far as I know, only these errors can be raised, but it's a part of the machinery I'm not familiar with.

My rationale would be: any other exceptions arising here are likely unusual corner cases, so they shouldn't have a big impact on day-to-day use. On the other hand, they might highlight something we're doing wrong.

@takluyver

takluyver Dec 6, 2011

Member

As far as I know, only these errors can be raised, but it's a part of the machinery I'm not familiar with.

My rationale would be: any other exceptions arising here are likely unusual corner cases, so they shouldn't have a big impact on day-to-day use. On the other hand, they might highlight something we're doing wrong.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Dec 6, 2011

Member

Looks good, merging now with rebase to avoid recursive merge on just one commit.

Member

fperez commented Dec 6, 2011

Looks good, merging now with rebase to avoid recursive merge on just one commit.

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Dec 6, 2011

Member

Pushed after rebase, closing.

Member

fperez commented Dec 6, 2011

Pushed after rebase, closing.

@fperez fperez closed this Dec 6, 2011

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