Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

elf2bin.py objcopy cleanup#7351

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@mcspr
Copy link
Collaborator

Perhttps://docs.python.org/3/library/tempfile.html#tempfile.mkstemp

Unlike TemporaryFile(), the user of mkstemp() is responsible for deleting the temporary file when done with it.

read_segment()'sdumpfile was never deleted, producing 5 'segment' files each build.

Instead, this patch creates a temporary directory which is later used for objcopy output.TemporaryDirectory() context manager will handle the deletion.
Plus, some minor refactoring to reduce line length and add some pythonisms (hopefully, not too much)

Noticed this issue accidentally by inspecting a specific Windows PC install using WSL circa January./tmp was ~2.5GB and there was alot of files.

Copy link
Collaborator

@earlephilhowerearlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Good fix, but needs to have#7348 merged before it can go in. TheTemporaryDirectory method isn't available in Python2 (which is the only one installed on Macs until the very latest release AFAIK).

Using amkdtemp call and cleaning up afterward would allow it to go in even if#7348 isn't merged as that's available since Python2.

@earlephilhowerearlephilhower added this to the2.7.2 milestoneJun 6, 2020
@earlephilhowerearlephilhower merged commit23febc1 intoesp8266:masterJun 6, 2020
@mcsprmcspr deleted the elf2bin-objcopy-cleanup branchJune 8, 2020 12:49
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@earlephilhowerearlephilhowerearlephilhower approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

2.7.2

Development

Successfully merging this pull request may close these issues.

2 participants

@mcspr@earlephilhower

[8]ページ先頭

©2009-2025 Movatter.jp