jafeha / parabird

Simple script written in python to build an os independent truecrypt encrypted usb-stick containing a portable thunderbird, enigmail, torbirdy and vidalia.
GNU General Public License v3.0
11 stars 7 forks source link

creating folders: folder exists #39

Closed jafeha closed 11 years ago

jafeha commented 11 years ago

we're having a nasty bug and i have no idea where it comes from:

[INFO::main]: Creating Folders in Truecrypt Container:
[ERROR::main]: [ERROR] Folder already exists
[ERROR::main]: [ERROR] Folder already exists
Traceback (most recent call last):
  File "parabird_build.py", line 225, in <module>
    os.makedirs(tc_mountpoint+"/data/profile")
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 17] File exists: '/tmp/tmplbil4N/data/profile'

it does not do any harm, it would be worse if the folder wouldn't get created at all. but can't figure out why it fails all the time...

The code looks like this:

try:
    for prog in suite("all"):
        os.makedirs(parser.get(prog, 'path'))
        os.makedirs(tc_mountpoint+"/data/profile")
        os.makedirs(tc_mountpoint+"/data/gpg")

except OSError:
    mainLogger.error("[ERROR] Folder already exists")
    mainLogger.exception("[ERROR] Folder already exists")
jafeha commented 11 years ago

other than i expected, this won't fix the issue:

        os.makedirs(os.path.join(tc_mountpoint+"/data/profile"))
        os.makedirs(os.path.join(tc_mountpoint+"/data/gpg"))
jafeha commented 11 years ago

fixed