mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-13 01:20:24 +02:00
create NamedTemporaryFile with delete=False for Windows compatibilty
This commit is contained in:
@ -36,8 +36,7 @@ class PBPlist(object):
|
||||
|
||||
def __init__(self, file_path):
|
||||
self.root = None
|
||||
# don't use __checkFile since we can only open the file once in Windows
|
||||
# if self.__checkFile(file_path) is True:
|
||||
if self.__checkFile(file_path) is True:
|
||||
self.file_path = file_path
|
||||
parser = PBParser(self.file_path)
|
||||
self.root = parser.read()
|
||||
|
@ -166,7 +166,7 @@ def parse(
|
||||
# Try parsing as an old-style NeXTSTEP Plist format
|
||||
# pbPlist library only works on file paths, not strings :(
|
||||
import tempfile
|
||||
with tempfile.NamedTemporaryFile(mode='w+b') as plist_file:
|
||||
with tempfile.NamedTemporaryFile(mode='w+b', delete=False) as plist_file:
|
||||
plist_file.write(data)
|
||||
plist_file.seek(0)
|
||||
parsed_plist = PBPlist(plist_file.name)
|
||||
|
Reference in New Issue
Block a user