Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-1011

A unicode string is not an instance of basestring on Python 2.7.5

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • Environment:

      Python 2.7.5 on Centos 7.

      Description

      I've run into a problem with basestring defined in libcloud.utils.py3 for python. It does not recognize unicode as an instance of basestring. That doesn't sound right.

       

      Here's terminal output from a machine where I can consistently reproduce this issue.

       

      $ python
      Python 2.7.5 (default, Aug  4 2017, 00:39:18)
      [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> foo = u'my-unicode-string'
      >>> isinstance(foo, basestring)
      True
      >>> from libcloud.utils.py3 import basestring
      /srv/softserve/env/lib/python2.7/site-packages/libcloud/utils/py3.py:60: UserWarning: Missing backports.ssl_match_hostname package
        warnings.warn("Missing backports.ssl_match_hostname package")
      >>> isinstance(foo, basestring)
      False

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              nigelb Nigel B
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: