Minor improvement of BigArray

This commit is contained in:
Miroslav Stampar
2026-01-28 18:31:14 +01:00
parent 683c258600
commit 600823f7c1
3 changed files with 11 additions and 4 deletions

View File

@@ -93,6 +93,10 @@ class BigArray(list):
>>> _ = __
>>> _[-1]
1
>>> _.pop()
1
>>> len(_)
100001
>>> len([_ for _ in BigArray(xrange(100000))])
100000
"""
@@ -148,8 +152,11 @@ class BigArray(list):
if not self.chunks[-1] and len(self.chunks) > 1:
self.chunks.pop()
try:
with open(self.chunks[-1], "rb") as f:
filename = self.chunks[-1]
with open(filename, "rb") as f:
self.chunks[-1] = pickle.loads(zlib.decompress(f.read()))
self._os_remove(filename)
self.filenames.discard(filename)
except IOError as ex:
errMsg = "exception occurred while retrieving data "
errMsg += "from a temporary file ('%s')" % ex

View File

@@ -19,7 +19,7 @@ from lib.core.enums import OS
from thirdparty import six
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.10.1.64"
VERSION = "1.10.1.65"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)