[IPython-User] %paste "TypeError: Type str doesn't support the buffer API".

Fernando Perez fperez.net@gmail....
Tue Oct 29 19:16:31 CDT 2013


ok, care to reopen the issue then? It looks like it's a real bug...


On Tue, Oct 29, 2013 at 5:13 PM, Thomas Kluyver <takowl@gmail.com> wrote:

> Yep, I just replicated it first try on my Windows VM. Knowing how our
> clipboard machinery works, it probably depends whether you have pywin32
> installed. I do in my VM.
>
>
> On 29 October 2013 17:08, Fernando Perez <fperez.net@gmail.com> wrote:
>
>> Mmh, I just replied to your previous post.  Can anyone else confirm this
>> is happening on Windows?
>>
>> Mark, does it happen always for you, or only if you copy certain specific
>> content to the clipboard?
>>
>> Thanks
>>
>> f
>>
>>
>> On Mon, Oct 28, 2013 at 11:08 AM, Mark Lawrence <breamoreboy@yahoo.co.uk>wrote:
>>
>>> It's only 70 lines so hope this is okay.
>>>
>>> option_string_indices {}
>>> arg_strings_pattern
>>> Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32
>>> bit (In
>>> tel)]
>>> Type "copyright", "credits" or "license" for more information.
>>>
>>> IPython 1.1.0 -- An enhanced Interactive Python.
>>> ?         -> Introduction and overview of IPython's features.
>>> %quickref -> Quick reference.
>>> help      -> Python's own help system.
>>> object?   -> Details about 'object', use 'object??' for extra details.
>>>
>>> In [1]: %paste
>>>
>>> ---------------------------------------------------------------------------
>>> TypeError                                 Traceback (most recent call
>>> last)
>>> <ipython-input-1-86b9186405a3> in <module>()
>>> ----> 1 get_ipython().magic('paste')
>>>
>>> c:\python33\lib\site-packages\IPython\core\interactiveshell.py in
>>> magic(self, arg_s)
>>>     2171         magic_name, _, magic_arg_s = arg_s.partition(' ')
>>>     2172         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
>>> -> 2173         return self.run_line_magic(magic_name, magic_arg_s)
>>>     2174
>>>     2175
>>>
>>> #-------------------------------------------------------------------------
>>>
>>> c:\python33\lib\site-packages\IPython\core\interactiveshell.py in
>>> run_line_magic(self, magic_name, line)
>>>     2092                 kwargs['local_ns'] =
>>> sys._getframe(stack_depth).f_locals
>>>     2093             with self.builtin_trap:
>>> -> 2094                 result = fn(*args,**kwargs)
>>>     2095             return result
>>>     2096
>>>
>>> c:\python33\lib\site-packages\IPython\terminal\interactiveshell.py in
>>> paste(self, parameter_s)
>>>
>>> c:\python33\lib\site-packages\IPython\core\magic.py in <lambda>(f, *a,
>>> **k)
>>>      190     # but it's overkill for just that one bit of state.
>>>      191     def magic_deco(arg):
>>> --> 192         call = lambda f, *a, **k: f(*a, **k)
>>>      193
>>>      194         if isinstance(arg, collections.Callable):
>>>
>>> c:\python33\lib\site-packages\IPython\terminal\interactiveshell.py in
>>> paste(self, parameter_s)
>>>      228         if 'q' not in opts:
>>>      229             write = self.shell.write
>>> --> 230             write(self.shell.pycolorize(block))
>>>      231             if not block.endswith('\n'):
>>>      232                 write('\n')
>>>
>>> c:\python33\lib\site-packages\IPython\core\interactiveshell.py in
>>> <lambda>(src)
>>>      595         # Python source parser/formatter for syntax highlighting
>>>      596         pyformat = PyColorize.Parser().format
>>> --> 597         self.pycolorize = lambda src:
>>> pyformat(src,'str',self.colors)
>>>      598
>>>      599     def init_pushd_popd_magic(self):
>>>
>>> c:\python33\lib\site-packages\IPython\utils\PyColorize.py in
>>> format(self, raw, out, scheme)
>>>      130
>>>      131     def format(self, raw, out = None, scheme = ''):
>>> --> 132         return self.format2(raw, out, scheme)[0]
>>>      133
>>>      134     def format2(self, raw, out = None, scheme = ''):
>>>
>>> c:\python33\lib\site-packages\IPython\utils\PyColorize.py in
>>> format2(self, raw, out, scheme)
>>>      177         lines_append = self.lines.append
>>>      178         while 1:
>>> --> 179             pos = raw_find('\n', pos) + 1
>>>      180             if not pos: break
>>>      181             lines_append(pos)
>>>
>>> TypeError: Type str doesn't support the buffer API
>>>
>>>
>>>
>>> On 28/10/2013 16:16, Thomas Kluyver wrote:
>>> > Can you post the traceback you get in a pastebin somewhere?
>>> >
>>> > Thanks,
>>> > Thomas
>>> >
>>> >
>>> > On 24 October 2013 10:52, Mark Lawrence <breamoreboy@yahoo.co.uk
>>> > <mailto:breamoreboy@yahoo.co.uk>> wrote:
>>> >
>>> >     Hi all,
>>> >
>>> >     I've seen this problem with Python 3.3.2 and Ipython 1.1.0 on
>>> Windows 7.
>>> >        It was originally reported as issue 3386 but the issue has been
>>> >     closed
>>> >     as fixed.  There's also a comment that the problem is OS X only.
>>>  Can
>>> >     someone take a look please, thanks.
>>> >
>>> >     --
>>> >     Python is the second best programming language in the world.
>>> >     But the best has yet to be invented.  Christian Tismer
>>> >
>>> >     Mark Lawrence
>>> >
>>>
>>> --
>>> Python is the second best programming language in the world.
>>> But the best has yet to be invented.  Christian Tismer
>>>
>>> Mark Lawrence
>>>
>>> _______________________________________________
>>> IPython-User mailing list
>>> IPython-User@scipy.org
>>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>>
>>
>>
>>
>> --
>> Fernando Perez (@fperez_org; http://fperez.org)
>> fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
>> fernando.perez-at-berkeley: contact me here for any direct mail
>>
>> _______________________________________________
>> IPython-User mailing list
>> IPython-User@scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-user
>>
>>
>
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
>


-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20131029/8b3f51d3/attachment-0001.html 


More information about the IPython-User mailing list