Skip to content

micropython-shutil: patch rmtree#15

Merged
dwalton76 merged 2 commits intoev3dev:masterfrom
dwalton76:master
May 30, 2019
Merged

micropython-shutil: patch rmtree#15
dwalton76 merged 2 commits intoev3dev:masterfrom
dwalton76:master

Conversation

@dwalton76
Copy link
Copy Markdown
Collaborator

os.walk (which is used by shutil.rmtree) is broken in 1.9.4 and thinks that the directories are files so when we try to os.unlink them it barfs. In v1.10 os.walk correctly IDs them as directories.

@dwalton76
Copy link
Copy Markdown
Collaborator Author

@WasabiFan I am able to verify that this fixes clean_arena() for micropython

@WasabiFan
Copy link
Copy Markdown
Member

Nice find! Ideally we'd just bump the version of Micropython we install on Travis, but given that ev3dev images come with v1.9.4 I figure we should probably keep that. Any idea why this changed suddenly?

@dwalton76
Copy link
Copy Markdown
Collaborator Author

I'm not sure what it is about the Buttons pull request that exposes this (didn't dig that far once I found the os.walk bug). Agreed on sticking with v1.9.4 since that is what is shipping on ev3dev.

@WasabiFan
Copy link
Copy Markdown
Member

It wasn't the buttons that broke it; it was time. I'd still ideally like to know what it was that changed, because the version of Micropython that we are testing with hasn't changed. So something else caused the failures.

@dwalton76
Copy link
Copy Markdown
Collaborator Author

time?

@WasabiFan
Copy link
Copy Markdown
Member

The same build that passed a week ago failed when we re-ran it. Something in our dependency tree changed between then and now to cause it to stop working.

@dwalton76
Copy link
Copy Markdown
Collaborator Author

This is a head scratcher

If I use a version of ev3dev-lang-fake-sys without our recent shutil.rmtree patch I am unable to find any commit in ev3dev-lang-python where I can get ~/micropython/ports/unix/micropython tests/api_tests.py to pass (I deleted micropython, ~/.micropython/, and installed per our travis install-micropython.sh). I went all the way back to when we first added micropython support in Sept 2018.

Maybe we were somehow hitting this part of install-micropython.sh and were using a cached version of micropython that did not have the os.walk bug that causes shutil.rmtree to fail?

if [ -e ~/micropython/ports/unix/micropython ]; then
    # the micropython binary already exists, which means that the cached folder was restored
    exit 0
fi

I don't know enough about travis to know if that is possible but that is the only reasonable theory I can come up with so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants