Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03dfd6b

Browse files
committed
Fixes #4214
1 parent d5a2ffc commit 03dfd6b

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

lib/core/convert.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,10 @@ def getBytes(value, encoding=None, errors="strict", unsafe=True):
256256
if unsafe:
257257
retVal = re.sub(r"%s([0-9a-f]{2})" % SAFE_HEX_MARKER, lambda _: decodeHex(_.group(1)), retVal)
258258
else:
259-
retVal = value.encode(encoding, errors)
259+
try:
260+
retVal = value.encode(encoding, errors)
261+
except UnicodeError:
262+
retVal = value.encode(UNICODE_ENCODING, errors="replace")
260263

261264
if unsafe:
262265
retVal = re.sub(b"\\\\x([0-9a-f]{2})", lambda _: decodeHex(_.group(1)), retVal)

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.4.5.28"
21+
VERSION = "1.4.5.29"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

0 commit comments

Comments
 (0)