Changeset 706d308 in trunk


Ignore:
Timestamp:
2020-12-14T20:42:51Z (4 years ago)
Author:
meejah <meejah@…>
Branches:
master
Children:
bf799c1
Parents:
ca5a642
Message:

create directories on save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/allmydata/util/configutil.py

    rca5a642 r706d308  
    6767    Write a configuration to a file.
    6868
    69     :param FilePath tahoe_cfg: The path to which to write the config.
     69    :param FilePath tahoe_cfg: The path to which to write the
     70        config. The directories are created if they do not already exist.
    7071
    7172    :param ConfigParser config: The configuration to write.
     
    7475    """
    7576    tmp = tahoe_cfg.temporarySibling()
     77    try:
     78        tahoe_cfg.parent().makedirs()
     79    except OSError:
     80        pass
    7681    # FilePath.open can only open files in binary mode which does not work
    7782    # with ConfigParser.write.
Note: See TracChangeset for help on using the changeset viewer.