PMunch / mpfshell

A simple shell based file explorer for ESP8266 Micropython based devices
MIT License
8 stars 2 forks source link

getr command not working in Python2 #4

Closed fredrikhr closed 5 years ago

fredrikhr commented 7 years ago

When executing the getr command with a directory name that exists and contains files, the getr fails fatally.

>mpfshell

** Micropython File Shell v0.7.6, sw@kaltpost.de ** 
-- Running on Python 2.7 using PySerial 3.2.1 --

mpfs [/]> open ...
Connected to LoPy
mpfs [/]> ls

Remote files in '/':

 <dir> flash

mpfs [/]> getr flash
global name 'FileNotFoundError' is not defined

Environment:

Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (AMD64)] on win32
PMunch commented 7 years ago

FileNotFoundError was introduced in Python 3, you're using Python 2. The original mpfshell is made to support both Python 2 and Python 3. This version has only been tested with Python 3. Whether or not legacy Python should be supported is open for questioning, but certainly not a priority.