PyTango Problem related to "lsdev"

Hi

After install PyTango on python3.4, i have problem to execute "lsdev" command, but "lsdevclass", "lsserv" commands is ok. the error message is as:

$ itango

Running on top of Python 3.4, IPython 4.0 and PyTango 8.1.6
….
ITango [13]: lsdev
TypeError: 'str' does not support the buffer interface
(For more detailed information type: python_error)

ITango [14]: python_error
—————————————————————————
TypeError Traceback (most recent call last)
<ipython-input-13-b1202b0da354> in <module>()
—-> 1 get_ipython().magic('lsdev ')

/usr/local/lib/python3.4/dist-packages/IPython/core/interactiveshell.py in magic(self, arg_s)
2334 magic_name, _, magic_arg_s = arg_s.partition(' ')
2335 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2336 return self.run_line_magic(magic_name, magic_arg_s)
2337
2338 #————————————————————————-

/usr/local/lib/python3.4/dist-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line)
2255 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2256 with self.builtin_trap:
-> 2257 result = fn(*args,**kwargs)
2258 return result
2259

/usr/local/lib/python3.4/dist-packages/PyTango/ipython/ipython_10_00/ipython_10_00.py in lsdev(self, parameter_s)

/usr/local/lib/python3.4/dist-packages/IPython/core/magic.py in <lambda>(f, *a, **k)
191 # but it's overkill for just that one bit of state.
192 def magic_deco(arg):
–> 193 call = lambda f, *a, **k: f(*a, **k)
194
195 if callable(arg):

/usr/local/lib/python3.4/dist-packages/PyTango/ipython/ipython_10_00/ipython_10_00.py in lsdev(self, parameter_s)
278 templ = "{0:{l[0]}} {1:{l[1]}} {2:{l[2]}} {3:{l[3]}}"
279 msg = templ.format(*title, l=lengths)
–> 280 print(msg, file=s)
281 print(*map(operator.mul, lengths, len(lengths)*"-"), file=s)
282 for d, v in data.items():

TypeError: 'str' does not support the buffer interface

How can i to solve this problem?

Thanks
thanks
Edited 9 years ago
I confirm.
Would you be so kind as to make a bug report in sourceforge (http://sourceforge.net/p/tango-cs/bugs/)?

Thanks in advance.

Tiago
In the meantime I have fixed the bug.

The quick fix for you would be to replace in
/usr/local/lib/python3.4/dist-packages/PyTango/ipython/ipython_10_00/ipython_10_00.py line 280

the string BytesIO with StringIO

The fix is already available in github master branch (https://github.com/tiagocoutinho/PyTango)

Hope it helps

Cheers
Tiago
thanks TCoutinho

In my /usr/local/lib/python3.4/dist-packages/PyTango/ipython/ipython_10_00/ipython_10_00.py file, it's line 275

After replace "BytesIO" with StringIO, everything is ok
Edited 9 years ago
 
Register or login to create to post a reply.