[setuptools] install data-file in users home-dir

Chris Angelico rosuav at gmail.com
Sat Jul 11 02:40:35 CEST 2015

On Sat, Jul 11, 2015 at 10:01 AM,  <c.buhtz at posteo.jp> wrote:
> On 2015-07-10 09:39 Chris Warrick <kwpolska at gmail.com> wrote:
>> And you should not create the files in your install script.  Instead,
>> install them to a different data dir (somewhere in 'share/appname', or
>> alongside your package). When someone runs your app, only then you
>> should copy this file to user’s config directory
> I have to check if there still is a user config file.
> When doing this with the app itself, the check would be done while each
> start - what is quite unnecessary.

Wrong. It is completely necessary. What happens if (a) the user
deletes the config file? (b) a different user runs the app? (c) a hard
drive melt-down wipes out all home directories, and the sysadmin
restores from last night's backup (which was before the app was
installed)? You MUST check for the absence of the user config file.
Most programs will be expected to function correctly after having
their configs wiped out - it's a standard way of saying "go back to
all defaults".


More information about the Python-list mailing list