thonny icon indicating copy to clipboard operation
thonny copied to clipboard

issue creating new directory on micropython device (unsupported operand type(s) for +: 'NoneType' and 'str')

Open echo-lalia opened this issue 1 year ago • 2 comments

Here's the error:

Traceback (most recent call last):
  File "C:\Users\Ethan\AppData\Local\Programs\Thonny\lib\tkinter\__init__.py", line 1921, in __call__
    return self.func(*args)
  File "C:\Users\Ethan\AppData\Local\Programs\Thonny\lib\site-packages\thonny\base_file_browser.py", line 885, in mkdir
    self.perform_mkdir(parent, name.strip())
  File "C:\Users\Ethan\AppData\Local\Programs\Thonny\lib\site-packages\thonny\base_file_browser.py", line 1262, in perform_mkdir
    path = (parent_dir + self.get_dir_separator() + name).replace("//", "/")
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

Error is popping up for me when trying to create a directory on the root of my esp32s3 device with MicroPython. I have done this before so I'm not certain what's triggering this issue now, but it's happening repeatedly. It seems to coincide with the files not showing up right away on the MicroPython device, but that might just be a coincidence.

echo-lalia avatar Feb 23 '24 08:02 echo-lalia

Thank you for the report!

It seems to coincide with the files not showing up right away on the MicroPython device, but that might just be a coincidence.

Does it mean you are trying to create the directory while the file browser is empty (and there actually are files or folders on the device)?

aivarannamaa avatar Feb 25 '24 15:02 aivarannamaa

I always refresh it until the I can see the files, but sometimes it takes a few tries to get them to load, and if that happens, the path above the files usually does not load (on the MicroPython device only)

echo-lalia avatar Feb 25 '24 15:02 echo-lalia