Skip to content

Sqlmap API exception #2691

Closed
Closed

Description

@Ekultek

Getting a deprecation warning exception from the API.

[09:26:25] [DEBUG] [672f3e0a357d3896] Retrieved scan status
[09:26:25] [DEBUG] [672f3e0a357d3896] Retrieved scan log messages
[09:26:42] [DEBUG] [672f3e0a357d3896] Retrieved scan status
/home/baal/bin/python/sqlmap/lib/core/common.py:4426: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  if getattr(ex, "message", None):
/home/baal/bin/python/sqlmap/lib/core/common.py:4427: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  retVal = ex.message
[09:26:46] [DEBUG] [672f3e0a357d3896] Retrieved scan log messages

Activity

  1. Ekultek commented on Sep 9, 2017

    @Ekultek
    ContributorAuthor

    Comes from here:

    def getSafeExString(ex, encoding=None):
        """
        Safe way how to get the proper exception represtation as a string
        (Note: errors to be avoided: 1) "%s" % Exception(u'\u0161') and 2) "%s" % str(Exception(u'\u0161'))
        >>> getSafeExString(Exception('foobar'))
        u'foobar'
        """
    
        retVal = ex
    
        if getattr(ex, "message", None):
            retVal = ex.message
        elif getattr(ex, "msg", None):
            retVal = ex.msg
    
    return getUnicode(retVal or "", encoding=encoding).strip()
    

    It's not really a bug, but eventually it will be deprecated so thought I'd bring it to your attention

  2. stamparm commented on Sep 9, 2017

    @stamparm
    Member

    "Patched" with latest commit. Don't you worry for deprecation as you can see in code that there is a check for the existence of message before its usage.

  3. self-assigned this
    on Sep 9, 2017
  4. added this to the 1.2 milestone on Sep 9, 2017
  5. Ekultek commented on Sep 9, 2017

    @Ekultek
    ContributorAuthor

    Yeah I saw that, just thought I'd bring it to your attention just in case, thank you for the 'patch'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions