Skip to content

Commit

Permalink
remove TextIOWrapper, use strig mode for load options
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed May 23, 2012
1 parent f9f2400 commit 195949e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions IPython/core/interactiveshell.py
Expand Up @@ -2774,10 +2774,7 @@ def find_user_code(self, target, raw=True, py_only=False):
except UnicodeDecodeError:
if not py_only :
response = urllib.urlopen(target)
buffer = BytesIO(response.read())
text = TextIOWrapper(buffer, 'latin1', errors='replace', line_buffering=True)
text.mode = 'r'
return text.read()
return response.read().decode('latin1')
raise ValueError(("'%s' seem to be unreadable.") % utarget)

potential_target = [target]
Expand Down
3 changes: 1 addition & 2 deletions IPython/core/magic.py
Expand Up @@ -2293,8 +2293,7 @@ def magic_load(self, arg_s):
%load myMacro
%load http://www.example.com/myscript.py
"""
opts,args = self.parse_options(arg_s,'y',mode='list')
args = " ".join(args)
opts,args = self.parse_options(arg_s,'y')

contents = self.shell.find_user_code(args)
l = len(contents)
Expand Down

0 comments on commit 195949e

Please sign in to comment.