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

Allow %loadpy to load remote URLs that don't end in .py #1161

Merged
merged 5 commits into from Dec 16, 2011
Merged

Conversation

fperez
Copy link
Member

@fperez fperez commented Dec 15, 2011

Will also fix same encoding bug we found for notebooks next.

and not arg_s.endswith('.py'):
# Local files must be .py; for remote URLs it's possible that the
# fetch URL doesn't have a .py in it (many servers have an opaque
# URL, such as scipy-central.org).
raise ValueError('%%load only works with .py files: %s' % arg_s)
if arg_s.startswith('http'):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to change this one as well (same issue with local files like 'httpx.py')

@fperez
Copy link
Member Author

fperez commented Dec 16, 2011

Reviewed by @takluyver and @minrk on IRC in addition to what's here, merging now.

@fperez fperez closed this Dec 16, 2011
fperez added a commit that referenced this pull request Dec 16, 2011
Allow %loadpy to load remote URLs that don't end in .py.

Also strip encoding declarations from loaded files, which are invalid for interactively defined strings.
@fperez fperez merged commit 3deb45e into master Dec 16, 2011
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Allow %loadpy to load remote URLs that don't end in .py.

Also strip encoding declarations from loaded files, which are invalid for interactively defined strings.
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.

None yet

2 participants