pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
199 stars 167 forks source link

float() does not work with byte strings #147

Open JardarM opened 6 years ago

JardarM commented 6 years ago

Hi

Seems like float does not work wity byte strings.

Working:

>>>int(b'10')
>>>10

Not working:

>>>float(b'10.1') 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't convert bytes to float

Working:

>>>float(b'10.1'.decode())
>>>10.1

(sysname='GPy', nodename='GPy', release='1.16.0.b1', version='v1.8.6-849-055728a on 2018-02-13', machine='GPy with ESP32')

robert-hh commented 6 years ago

Works with the micropython.org version. The Python engine 1.8.6 of Pycom is a little outdated.