Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web Workflow uploads file to wrong folder if default folder has been changed using os.chdir() #9053

Closed
RetiredWizard opened this issue Mar 15, 2024 · 2 comments · Fixed by #9311
Assignees
Milestone

Comments

@RetiredWizard
Copy link

CircuitPython version

Adafruit CircuitPython 9.0.0-rc.0-4-g04843e8597 on 2024-03-11; M5 Stack Cardputer with ESP32S3
Adafruit CircuitPython 9.0.0-rc.1 on 2024-03-14; Adafruit HUZZAH32 Breakout with ESP32

Code/REPL

import os
os.chdir('/')
if not 'test' in os.listdir():
    os.mkdir('test')

os.chdir('/test')
print('Directory set to test folder:',os.getcwd())

Behavior

Using Web Workflow to upload a file to the root folder when the indicated code.py has been executed causes the file to uploaded to the /test folder rather than the root folder.

Description

No response

Additional information

No response

@RetiredWizard
Copy link
Author

I have been having intermittent issues moving the web workflow to subdirectories but hadn't been able to reliably reproduce the issue. I'm now thinking it's related to this issue and the web workflow file listing is also using the current folder of the device to look for selected target folders when attempting to change to a subfolder. Essentially the Web Worfklow file listing and the devices current folder are at different locations.

@tannewt tannewt added this to the 9.x.x milestone Mar 18, 2024
@dhalbert dhalbert modified the milestones: 9.x.x, 9.1.0 May 29, 2024
@dhalbert
Copy link
Collaborator

dhalbert commented Jun 5, 2024

#9224 (merged after this issue was reported) forces a chdir to top level when the VM is restarted. So that fixes it being "sticky", if that's the problem. But if you are using the web workflow while the program is running and has done an os.chdir(), I guess we need to fix that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants