bluesky / suitcase-specfile

write text file such as output by SPEC
Other
1 stars 9 forks source link

Resolve file mode issue from CHX #7

Open danielballan opened 5 years ago

danielballan commented 5 years ago

From this workaround on Slack:


class MultiFileManagerHack(MultiFileManager):

    def open(self, label, postfix, mode, **kwargs):
        mode = 'a' if mode=='x' else mode
        f = super().open(label, postfix, mode, **kwargs)
        return f

    def reserve_name(self, label, postfix):
        name = (self._directory / Path(postfix)).expanduser().resolve()
        if name in self._reserved_names:
            return name
        return super().reserve_name(label, postfix)

it appears that this code path isn't working as intended:

https://github.com/bluesky/suitcase-specfile/blob/284e87b6866c855e661335b42146bb6426c7271d/suitcase/specfile/__init__.py#L458-L472

danielballan commented 5 years ago

Lacking a traceback, it's hard to guess what the problem might be. Per conversation on Slack, it seems that this might actually not be an issue, and that this was a red herring that eventually led to #6. Action item is to confirm that CHX runs without this workaround.