Skip to content

Commit

Permalink
Merge pull request #282 from EddieTheHead/master
Browse files Browse the repository at this point in the history
Check permision on write to file even if .BAC0 directory exists
  • Loading branch information
ChristianTremblay committed Jul 28, 2021
2 parents c363d02 + cc35bfe commit fef37bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions BAC0/core/utils/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,17 +204,17 @@ def note_and_log(cls):
logSaveFilePath = join(logUserPath, ".BAC0")

logFile = join(logSaveFilePath, "BAC0.log")
if not os.path.exists(logSaveFilePath):
try:
os.makedirs(logSaveFilePath)
except:
_PERMISSION_TO_WRITE = False
if _PERMISSION_TO_WRITE:
try:
if not os.path.exists(logSaveFilePath):
os.makedirs(logSaveFilePath)
fh = FileHandler(logFile)
fh.set_name("file_handler")
fh.setLevel(file_level)
fh.setFormatter(formatter)

except OSError:
_PERMISSION_TO_WRITE = False

ch.setFormatter(formatter)
ch2.setFormatter(formatter)
# Add handlers the first time only...
Expand Down
2 changes: 1 addition & 1 deletion BAC0/infos.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__email__ = "christian.tremblay@servisys.com"
__url__ = "https://github.com/ChristianTremblay/BAC0"
__download_url__ = "https://github.com/ChristianTremblay/BAC0/archive/master.zip"
__version__ = "21.05.28dev"
__version__ = "21.07.27dev"
__license__ = "LGPLv3"

0 comments on commit fef37bf

Please sign in to comment.