Thrift
  1. Thrift
  2. THRIFT-1515

NameError: global name 'TApplicationException' is not defined

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9
    • Component/s: Python - Compiler
    • Labels:
      None

      Description

      The Python Thrift generator does not include imports for all the exception types it uses, namely, "TApplicationException".

      To reproduce:
      Create two Thrift services (A and B) and start them.
      Using the Python client for B, connect to A and call one of the methods from the service.

      Expected result:

      thrift.Thrift.TApplicationException: Invalid method name: 'someMethod'

      Actual Result:

      NameError: global name 'TApplicationException' is not defined
      1. thrift_1515.patch
        0.5 kB
        Atul S Vasu

        Activity

        Jon Stephens created issue -
        Hide
        Atul S Vasu added a comment -

        Patch to fix this bug.

        From r1309631
        http://svn.apache.org/repos/asf/thrift/trunk

        Show
        Atul S Vasu added a comment - Patch to fix this bug. From r1309631 http://svn.apache.org/repos/asf/thrift/trunk
        Atul S Vasu made changes -
        Field Original Value New Value
        Attachment thrift_1515.patch [ 12521431 ]
        Hide
        Will Pierce added a comment -

        I attached a patch for this same fix to THRIFT-1115 which does the same thing (except uses 2 lines, to avoid going past the 80 char suggested limit of PEP8)

        I'm happy with either one

        Show
        Will Pierce added a comment - I attached a patch for this same fix to THRIFT-1115 which does the same thing (except uses 2 lines, to avoid going past the 80 char suggested limit of PEP8) I'm happy with either one
        Hide
        David De Caires E Freitas added a comment -

        Cool, I have the same problem, will the Fix Version be 0.9?

        Show
        David De Caires E Freitas added a comment - Cool, I have the same problem, will the Fix Version be 0.9?
        Hide
        Jake Farrell added a comment -

        Yes, this is available within trunk and will be in the 0.9 release

        Show
        Jake Farrell added a comment - Yes, this is available within trunk and will be in the 0.9 release
        Jake Farrell made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Jake Farrell [ jfarrell ]
        Fix Version/s 0.9 [ 12316294 ]
        Resolution Fixed [ 1 ]
        Hide
        Grayson Koonce added a comment -

        Are exceptions defined in a service file supposed to extend from TApplicationException? At the moment they are only extending TException...

        Show
        Grayson Koonce added a comment - Are exceptions defined in a service file supposed to extend from TApplicationException? At the moment they are only extending TException...
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        174d 18h 21m 1 Jake Farrell 08/Aug/12 16:39

          People

          • Assignee:
            Jake Farrell
            Reporter:
            Jon Stephens
          • Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.25h
              0.25h
              Remaining:
              Remaining Estimate - 0.25h
              0.25h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development