Quantcast

IPython Notebook save problem caused by HTTP PUT

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

IPython Notebook save problem caused by HTTP PUT

Lars Bojsen-Møller
Hi IPython developers

I have found a bug and a way to solve it: Sometimes I can not save an IPython Notebook. The bigger the notebook is, the more likely saving is to fail. The problem occurs on Windows but not on Mac.

Problem details:

When using the Chrome browser under windows a notebook containing only this single line
for i in xrange(1234): print i
can always be saved. But if I make the notebook bigger by changing the line to
for i in xrange(123456): print i
saving usually fails.

Solution:

I found out that the problem disappeared, if I modified IPython to use HTTP POST instead of HTTP PUT. I don't know if it's a bug in the Chrome browser or a bug in the Tornado server, but it can be solved by modifying these three lines

C:\Python26\Lib\site-packages\IPython\frontend\html\notebook\static\js\notebook.js:
            //type : "PUT",
            type : "POST",

C:\Python26\Lib\site-packages\IPython\frontend\html\notebook\handlers.py:
    #SUPPORTED_METHODS = ('GET', 'PUT', 'DELETE')
    SUPPORTED_METHODS = ('GET', 'POST', 'DELETE')
    ...
    def post(self, notebook_id):
    #def put(self, notebook_id):

Kind Regards
Lars Bojsen-Møller
Innohead
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPython Notebook save problem caused by HTTP PUT

Matthias Bussonnier

Le 27 août 2012 à 11:09, Lars-Innohead a écrit :

> Hi IPython developers
>
> I have found a bug and a way to solve it: Sometimes I can not save an
> IPython Notebook. The bigger the notebook is, the more likely saving is to
> fail. The problem occurs on Windows but not on Mac.
>
> Problem details:
>
> When using the Chrome browser under windows a notebook containing only this
> single line
> for i in xrange(1234): print i
> can always be saved. But if I make the notebook bigger by changing the line
> to
> for i in xrange(123456): print i
> saving usually fails.
>
> Solution:
>
> I found out that the problem disappeared, if I modified IPython to use HTTP
> POST instead of HTTP PUT. I don't know if it's a bug in the Chrome browser
> or a bug in the Tornado server, but it can be solved by modifying these
> three lines
>
> C:\Python26\Lib\site-packages\IPython\frontend\html\notebook\static\js\notebook.js:
>            //type : "PUT",
>            type : "POST",
>
> C:\Python26\Lib\site-packages\IPython\frontend\html\notebook\handlers.py:
>    #SUPPORTED_METHODS = ('GET', 'PUT', 'DELETE')
>    SUPPORTED_METHODS = ('GET', 'POST', 'DELETE')
>    ...
>    def post(self, notebook_id):
>    #def put(self, notebook_id):
>

That's good to know,
Could you one an issue on github ?
I don't think we'll change it without warning because some other project might now rely on PUT.

--
Matthias

> Kind Regards
> Lars Bojsen-Møller
> Innohead
>
>
>
> --
> View this message in context: http://python.6.n6.nabble.com/IPython-Notebook-save-problem-caused-by-HTTP-PUT-tp4986570.html
> Sent from the IPython - Development mailing list archive at Nabble.com.
> _______________________________________________
> IPython-dev mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/ipython-dev

_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IPython Notebook save problem caused by HTTP PUT

Brian Granger-3
We definitely want to keep this a PUT, but we should figure out what
is going on with it.

On Mon, Aug 27, 2012 at 4:39 AM, Matthias BUSSONNIER
<[hidden email]> wrote:

>
> Le 27 août 2012 à 11:09, Lars-Innohead a écrit :
>
>> Hi IPython developers
>>
>> I have found a bug and a way to solve it: Sometimes I can not save an
>> IPython Notebook. The bigger the notebook is, the more likely saving is to
>> fail. The problem occurs on Windows but not on Mac.
>>
>> Problem details:
>>
>> When using the Chrome browser under windows a notebook containing only this
>> single line
>> for i in xrange(1234): print i
>> can always be saved. But if I make the notebook bigger by changing the line
>> to
>> for i in xrange(123456): print i
>> saving usually fails.
>>
>> Solution:
>>
>> I found out that the problem disappeared, if I modified IPython to use HTTP
>> POST instead of HTTP PUT. I don't know if it's a bug in the Chrome browser
>> or a bug in the Tornado server, but it can be solved by modifying these
>> three lines
>>
>> C:\Python26\Lib\site-packages\IPython\frontend\html\notebook\static\js\notebook.js:
>>            //type : "PUT",
>>            type : "POST",
>>
>> C:\Python26\Lib\site-packages\IPython\frontend\html\notebook\handlers.py:
>>    #SUPPORTED_METHODS = ('GET', 'PUT', 'DELETE')
>>    SUPPORTED_METHODS = ('GET', 'POST', 'DELETE')
>>    ...
>>    def post(self, notebook_id):
>>    #def put(self, notebook_id):
>>
>
> That's good to know,
> Could you one an issue on github ?
> I don't think we'll change it without warning because some other project might now rely on PUT.
>
> --
> Matthias
>
>> Kind Regards
>> Lars Bojsen-Møller
>> Innohead
>>
>>
>>
>> --
>> View this message in context: http://python.6.n6.nabble.com/IPython-Notebook-save-problem-caused-by-HTTP-PUT-tp4986570.html
>> Sent from the IPython - Development mailing list archive at Nabble.com.
>> _______________________________________________
>> IPython-dev mailing list
>> [hidden email]
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> [hidden email]
> http://mail.scipy.org/mailman/listinfo/ipython-dev



--
Brian E. Granger
Cal Poly State University, San Luis Obispo
[hidden email] and [hidden email]
_______________________________________________
IPython-dev mailing list
[hidden email]
http://mail.scipy.org/mailman/listinfo/ipython-dev
Loading...