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

Problem with string containing two or more question marks #6689

Closed
selasley opened this issue Oct 13, 2014 · 7 comments · Fixed by #6693
Closed

Problem with string containing two or more question marks #6689

selasley opened this issue Oct 13, 2014 · 7 comments · Fixed by #6693
Milestone

Comments

@selasley
Copy link

If I have a notebook with a code cell containing a string with two or more question marks I see a
SyntaxError: Unexpected token ':'. Parse error.
message in orange near the top of the window and ipython says Autosave Failed!
If I close and halt, then reopen the notebook the ?? in the string is replaced by a string such as jQuery203021335813379846513_1413224722980. So

s = "??"

s = "jQuery20306843485713470727_1413224771225"

s = "????"
->
s = "jQuery20303224137818906456_1413225105052??"

I am seeing this with ipython 3.0.0-dev ddc0593 and the Safari web browser

@takluyver
Copy link
Member

Not seeing this in Firefox.

@selasley
Copy link
Author

I see it in FireFox 32.0.3 under OS X. I am using python installed with python 3.4.2. The jQuery string appears in the ipynb file when I use the Save and Checkpoint menu item. If I change the jQuery string to ???? in the ipynb file when it is not open, then open it in the notebook I see s = "????" After I Save and Checkpoint again I see the warning about a syntax error and the jQuery string appears in the ipynb file.

@Carreau
Copy link
Member

Carreau commented Oct 14, 2014

Can you share one of these notebook ?

@selasley
Copy link
Author

Here is a notebook I created using ipython 2.3.0 http://pastebin.com/iesdxv0Y
I can open, Save and Checkpoint, close and reopen this notebook using ipython 2.3.0 with no problems
If I open the notebook with ipython 3.0.0 dev commit f958ffa, select File->Save and Checkpoint, then look at the ipynb file in a text editor "s = "??"\n", is replaced by "s = "jQuery203042744921061269603_1413308473753"\n",
If I Close and halt then open the notebook again I see s = "jQuery20305214854673710887_1413308784993" in the notebook but z = "??" is not changed.
After I Save and Chekpoint the file a second time, close it and open it again I see z = "jQuery20304426873527968228_1413308796891"
Save, close and a third time and Out[1] is now 'jQuery203016830453436175863_1413308850862' instead of '??'
I'm running python 3.4.2 from python.org in OS X 10.9.5. I see this problem in Firefox 32.0.3 and Safari 7.1 with extensions disabled. When I look at the Error console in Safari after loading the notebook I see these two errors
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (jquery.min.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (underscore-min.map, line 0)
I don't see these errors in the Firefox Debugger console so they may not be relevant.
If nobody else can reproduce this problem I'll just chalk it up to a quirk in my setup.

@takluyver
Copy link
Member

I've tried again with your notebook, and I still don't see the bug (Firefox 32, Python 3.4.2, Linux). Someone with a Mac should try to reproduce this.

@minrk minrk added this to the 2.4 milestone Oct 14, 2014
@minrk
Copy link
Member

minrk commented Oct 14, 2014

I can reproduce it. It's jQuery's implicit JSONP logic, which is super weird. Fix in #6693.

@aflaxman
Copy link

I just ran into this bug, and I have an IPython from the git repo that was updated one day before this fix was merged! Lucky me?

image

Thanks for being so on it, folks! You rock.

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 a pull request may close this issue.

5 participants