Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"cannot set attribute" exception on %paste #2623

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

Closed
wants to merge 1 commit into from

Conversation

craustin
Copy link

Repro: use the %paste magic on lines with inconsistent spacing on
all-whitespace lines.

Repro: use the %paste magic on lines with inconsistent spacing on
all-whitespace lines.
@bfroehle
Copy link
Contributor

Yes, looks correct to me!

@bfroehle
Copy link
Contributor

@craustin Can you give a concrete example of a %paste which fails? That way we can add it to a test routine.

@craustin
Copy link
Author

Clipboard: """
print 'test'

"""
[not sure if this will come through in the comment, but the middle whitespace line contains two spaces]

@bfroehle
Copy link
Contributor

Unfortunately, I cannot reproduce this with your example in the terminal in Ubuntu 12.04.

Can any other devs chime in as to whether this bit of code should even exist in the first place? i.e., is the correct fix instead just to remove this line?

@takluyver
Copy link
Member

I think it's aiming to cancel out the incremented prompt number when you hit return on an empty cell - but it's not actually triggered in that case, or we would have seen the error long ago. I suspect it can go, but I want to think through what's going on in different cases to convince myself it's not required.

@bfroehle
Copy link
Contributor

@takluyver Any more thought as to whether or not the correct fix is as proposed or just removing the case? I cannot reproduce the exception and am not familiar with the logic of this section.

@takluyver
Copy link
Member

I'm pretty sure now that we can just remove it. See PR #2783.

@bfroehle
Copy link
Contributor

@craustin Can you check out PR #2783 and run it though the test case that you had for this bug? Please also make sure that your prompt numbers don't change in unexpected ways.

@takluyver
Copy link
Member

Closed in favour of #2783.

@takluyver takluyver closed this Jan 14, 2013
minrk added a commit that referenced this pull request Mar 5, 2013
Having gone through the various things that can call it, I'm pretty sure that there's no need for prefilter to be modifying the execution/prompt counter. And in testing, I can't construct an example that hits this bit of code.

If we agree on this, it supersedes #2623.
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.

3 participants