diff options
Diffstat (limited to 'libmat')
| -rw-r--r-- | libmat/mat.py | 3 | ||||
| -rw-r--r-- | libmat/parser.py | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/libmat/mat.py b/libmat/mat.py index d0fd504..f116f54 100644 --- a/libmat/mat.py +++ b/libmat/mat.py | |||
| @@ -115,7 +115,7 @@ class XMLParser(xml.sax.handler.ContentHandler): | |||
| 115 | def secure_remove(filename): | 115 | def secure_remove(filename): |
| 116 | """ Securely remove the file | 116 | """ Securely remove the file |
| 117 | """ | 117 | """ |
| 118 | # I want the file removed, even if it's ro | 118 | # I want the file removed, even if it's read-only |
| 119 | try: | 119 | try: |
| 120 | os.chmod(filename, 220) | 120 | os.chmod(filename, 220) |
| 121 | except OSError: | 121 | except OSError: |
| @@ -159,7 +159,6 @@ def create_class_file(name, backup, **kwargs): | |||
| 159 | logging.error('%s is empty' % name) | 159 | logging.error('%s is empty' % name) |
| 160 | return None | 160 | return None |
| 161 | 161 | ||
| 162 | filename = '' | ||
| 163 | try: | 162 | try: |
| 164 | filename = hachoir_core.cmd_line.unicodeFilename(name) | 163 | filename = hachoir_core.cmd_line.unicodeFilename(name) |
| 165 | except TypeError: # get rid of "decoding Unicode is not supported" | 164 | except TypeError: # get rid of "decoding Unicode is not supported" |
diff --git a/libmat/parser.py b/libmat/parser.py index eed3140..43de6d6 100644 --- a/libmat/parser.py +++ b/libmat/parser.py | |||
| @@ -36,8 +36,7 @@ class GenericParser(object): | |||
| 36 | except TypeError: # get rid of "decoding Unicode is not supported" | 36 | except TypeError: # get rid of "decoding Unicode is not supported" |
| 37 | self.filename = filename | 37 | self.filename = filename |
| 38 | self.basename = os.path.basename(filename) | 38 | self.basename = os.path.basename(filename) |
| 39 | _, output = tempfile.mkstemp() | 39 | self.output = hachoir_core.cmd_line.unicodeFilename(tempfile.mkstemp()[1]) |
| 40 | self.output = hachoir_core.cmd_line.unicodeFilename(output) | ||
| 41 | 40 | ||
| 42 | def __del__(self): | 41 | def __del__(self): |
| 43 | """ Remove tempfile if it was not used | 42 | """ Remove tempfile if it was not used |
