sqlmapproject/sqlmap · error · SqlmapSyntaxException

invalid character provided in option '--postprocess'

Error message

invalid character provided in option '--postprocess'

What it means

The path/extension checks for --postprocess are wrapped in a try block that also catches UnicodeDecodeError. This fires when the script argument contains bytes/characters that cannot be decoded — typically a path with an encoding sqlmap cannot handle (common on Windows with non-ASCII characters). The guard converts the undecodable input into this clear SqlmapSyntaxException naming the --postprocess option.

Solutions

  1. Retype the --postprocess path using only ASCII characters; avoid non-ASCII characters in directory or file names.
  2. Rename the script and/or its parent directories to ASCII-only names.
  3. Check the terminal/OS encoding (e.g. ensure a UTF-8 locale) so the argument reaches sqlmap undamaged.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at lib/core/option.py:1079 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/d137437ef7547622. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:1079

            found = False
            function = None

            script = safeFilepathEncode(script.strip())

            try:
                if not script:
                    continue

                if not os.path.exists(script):
                    errMsg = "postprocess script '%s' does not exist" % script
                    raise SqlmapFilePathException(errMsg)

                elif not script.endswith(".py"):
                    errMsg = "postprocess script '%s' should have an extension '.py'" % script
                    raise SqlmapSyntaxException(errMsg)
            except UnicodeDecodeError:
                errMsg = "invalid character provided in option '--postprocess'"
                raise SqlmapSyntaxException(errMsg)

            dirname, filename = os.path.split(script)
            dirname = os.path.abspath(dirname)

            infoMsg = "loading postprocess module '%s'" % filename[:-3]
            logger.info(infoMsg)

            if not os.path.exists(os.path.join(dirname, "__init__.py")):
                errMsg = "make sure that there is an empty file '__init__.py' "
                errMsg += "inside of postprocess scripts directory '%s'" % dirname
                raise SqlmapGenericException(errMsg)

            if dirname not in sys.path:
                sys.path.insert(0, dirname)

            try:
                getattr(importlib, "invalidate_caches", lambda: None)()  # Note: py3.3+ only; a script just written into an already-scanned dir is invisible to a cached FileFinder (Windows coarse mtime)
                module = __import__(safeFilepathEncode(filename[:-3]))

View on GitHub (pinned to 0a35b20e39)