After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789637 - glib-mkenums: Fails when --ouput file does not exist
glib-mkenums: Fails when --ouput file does not exist
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.53.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-10-30 02:42 UTC by Sam Spilsbury
Modified: 2017-10-31 15:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mkenums: Don't raise when unlinking a file that doesn't exist (901 bytes, patch)
2017-10-30 02:43 UTC, Sam Spilsbury
committed Details | Review

Description Sam Spilsbury 2017-10-30 02:42:08 UTC
glib-mkenums attempts to unlink a file that may not exist exist when used with --output:

    if tmpfile is not None:
        tmpfilename = tmpfile.name
        tmpfile.close()
        os.unlink(options.output)
        os.rename(tmpfilename, options.output)


This raises an exception when the file can't be found.
Comment 1 Sam Spilsbury 2017-10-30 02:43:23 UTC
Created attachment 362502 [details] [review]
mkenums: Don't raise when unlinking a file that doesn't exist
Comment 2 Philip Withnall 2017-10-30 11:23:28 UTC
Review of attachment 362502 [details] [review]:

Looks good to me. Thanks for the patch.