jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.7k stars 4.94k forks source link

Download as .py doesn't work on Safari. #3014

Open arjun921 opened 6 years ago

arjun921 commented 6 years ago

I am on the latest 10.13 High Sierra, and jupyter notebook fails to save as .py file. I get a .html file instead.

Using Intel Python distribution, if that makes any difference.

mpacer commented 6 years ago

What version of notebook are you using?

arjun921 commented 6 years ago

5.0.0

mpacer commented 6 years ago

Did you try upgrading?

pip install -U notebook

What version of nbconvert are you using?

arjun921 commented 6 years ago

I didn't have nbconvert or notebook installed. Even after installing, the option under File> Download as> .py in the web GUI doesn't work. Currently I am on nbconvert==5.3.1 notebook==5.2.1

takluyver commented 6 years ago

Does the content of the file look like Python or HTML? I've got a vague memory that maybe Safari ignores the content type we send.

arjun921 commented 6 years ago

No, it doesn't look any where close to a .py file I've attached what the file that it downloads

Here's the content of what it downloaded:

# coding: utf-8

# In[1]:

import pandas
arjun921 commented 6 years ago

The file name that gets downloaded is saved as Untitled.py-2.html

takluyver commented 6 years ago

Attachments don't work through Github issues, but the content you pasted in looks like a .py file to me.

arjun921 commented 6 years ago

Okay wait, yeah it does make sense, I guess safari downloads it with just the .html extension. Anyway to fix that? Temporarily I can manually rename it as .py, not an issue

takluyver commented 6 years ago

I don't know of a fix - there's no Safari on Linux, so someone else would need to investigate it.

txa commented 6 years ago

I have the same problem. Usually safari offers a dialogue where you can choose but this seems to be bypassed. Can I use chrome instead? How?