Uploaded image for project: 'CUBRID APIs'
  1. CUBRID APIs
  2. APIS-423

[Python] There is a error when running setup.py in Python2.6, 3.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Python-Aprium
    • Component/s: Python Driver
    • Labels:
      None

      Description

      There is a error when running setup.py in Python2.6, 3.0

      Traceback (most recent call last):
      File "setup.py", line 41, in <module>
      if sys.version_info.major == 2 and sys.version_info.minor >= 5:
      AttributeError: 'tuple' object has no attribute 'major'

        Activity

        Hide
        jinhu 李金虎 added a comment -

        Solution:
        In Python 2.6 and 3.0, sys.version_info is a tuple and it's elements can only be access by the index.
        In the Python 2.7, 3.1 and later version of Python, sys.version_info was add named component attributes and can be use the following forms:
        sys.version_info.major
        Using the index to access the elements.

        Reference:

        In Python 2.6:

        sys.version_info

        A tuple containing the five components of the version number: major, minor, micro, releaselevel, and serial. All values except releaselevel are integers; the release level is 'alpha', 'beta', 'candidate', or 'final'. The version_info value corresponding to the Python version 2.0 is (2, 0, 0, 'final', 0).

        In Python 2.7:

        sys.version_info

        A tuple containing the five components of the version number: major, minor, micro, releaselevel, and serial. All values except releaselevel are integers; the release level is 'alpha', 'beta', 'candidate', or 'final'. The version_info value corresponding to the Python version 2.0 is (2, 0, 0, 'final', 0). The components can also be accessed by name, so sys.version_info[0] is equivalent to sys.version_info.major and so on.

        New in version 2.0.

        Changed in version 2.7: Added named component attributes

        Show
        jinhu 李金虎 added a comment - Solution: In Python 2.6 and 3.0, sys.version_info is a tuple and it's elements can only be access by the index. In the Python 2.7, 3.1 and later version of Python, sys.version_info was add named component attributes and can be use the following forms: sys.version_info.major Using the index to access the elements. Reference: In Python 2.6: sys.version_info A tuple containing the five components of the version number: major, minor, micro, releaselevel, and serial. All values except releaselevel are integers; the release level is 'alpha', 'beta', 'candidate', or 'final'. The version_info value corresponding to the Python version 2.0 is (2, 0, 0, 'final', 0). In Python 2.7: sys.version_info A tuple containing the five components of the version number: major, minor, micro, releaselevel, and serial. All values except releaselevel are integers; the release level is 'alpha', 'beta', 'candidate', or 'final'. The version_info value corresponding to the Python version 2.0 is (2, 0, 0, 'final', 0). The components can also be accessed by name, so sys.version_info [0] is equivalent to sys.version_info.major and so on. New in version 2.0. Changed in version 2.7: Added named component attributes
        Hide
        jinhu 李金虎 added a comment -

        Fixed in trunk. Revision: 1304
        Merged into RB-8.4.1. Revision: 1305
        Merged into RB-8.4.3. Revision: 1306
        Merged into RB-8.4.4. Revision: 1307

        Show
        jinhu 李金虎 added a comment - Fixed in trunk. Revision: 1304 Merged into RB-8.4.1. Revision: 1305 Merged into RB-8.4.3. Revision: 1306 Merged into RB-8.4.4. Revision: 1307
        Hide
        cn14130 欧明宝[Bom Owen] added a comment -

        Test Build: 9.1.0.0204
        Test OS: Windows and Linux
        python driver: 9.1.0.0001
        Test Result: pass
        RB-8.4.1, RB-8.4.3 will be validated by daily qa test

        Show
        cn14130 欧明宝[Bom Owen] added a comment - Test Build: 9.1.0.0204 Test OS: Windows and Linux python driver: 9.1.0.0001 Test Result: pass RB-8.4.1, RB-8.4.3 will be validated by daily qa test

          People

          • Assignee:
            jinhu 李金虎
            Reporter:
            jinhu 李金虎
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: