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

Merged
merged 5 commits into from Dec 16, 2011

Conversation

Projects
None yet
2 participants
@fperez
Member

fperez commented Dec 15, 2011

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

IPython/core/magic.py
+ 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'):

This comment has been minimized.

@takluyver

takluyver Dec 15, 2011

Member

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

@takluyver

takluyver Dec 15, 2011

Member

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

@fperez

This comment has been minimized.

Show comment
Hide comment
@fperez

fperez Dec 16, 2011

Member

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

Member

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

Merge pull request #1161 from ipython/loadpy-fixes
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

Merge pull request #1161 from ipython/loadpy-fixes
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