mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-06 17:57:38 +02:00
Core: Change base class for FileHandlerInterface
Python 3.6 doesn't appear to support IO[bytes] (and this is also from the typing library), so we instead now inherit from RawIOBase. This provides read, but does not come with a constructor (like FileIO) so is suitable for our needs. Fixes issue #376.
This commit is contained in:
@@ -8,10 +8,11 @@ using objects constructed from symbols.
|
||||
"""
|
||||
|
||||
# Configuration interfaces must be imported separately, since we're part of interfaces and can't import ourselves
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import List, Tuple, Type, IO
|
||||
from typing import List, Tuple, Type
|
||||
|
||||
from volatility import framework
|
||||
from volatility.framework import exceptions, constants, interfaces
|
||||
@@ -19,7 +20,7 @@ from volatility.framework import exceptions, constants, interfaces
|
||||
vollog = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FileHandlerInterface(IO[bytes]):
|
||||
class FileHandlerInterface(io.RawIOBase):
|
||||
"""Class for storing Files in the plugin as a means to output a file when necessary.
|
||||
|
||||
This can be used as ContextManager that will close/produce the file automatically when exiting the context block
|
||||
|
||||
Reference in New Issue
Block a user