Python exception handling - line number











up vote
39
down vote

favorite
19












I'm using python to evaluate some measured data. Because of many possible results it is difficult to handle or possible combinations. Sometimes an error happens during the evaluation. It is usually an index error because I get out of range from measured data.



It is very difficult to find out on which place in code the problem happened. It would help a lot if I knew on which line the error was raised. If I use following code:



try:
result = evaluateData(data)
except Exception, err:
print ("Error: %s.n" % str(err))


Unfortunately this only tells me that there is and index error. I would like to know more details about the exception (line in code, variable etc.) to find out what happened. Is it possible?



Thank you.










share|improve this question


















  • 1




    See stackoverflow.com/questions/3702675/…!
    – Charles Beattie
    Jan 25 '13 at 9:57










  • docs.python.org/2/library/traceback.html#traceback-examples
    – osa
    Sep 9 '14 at 23:44






  • 3




    @JeCh The answers look good. Please accept one. To accept it click the empty checkmark next to the answer.
    – Michael Potter
    Aug 9 '15 at 23:53










  • The answer that is voted highest here is also presented in the stackoverflow question that @CharlesBeattie references above. That answer has important comments associated with it whereas this answer does not. It's definitely worth your time to check that one out.
    – harperville
    Jan 9 '17 at 17:33















up vote
39
down vote

favorite
19












I'm using python to evaluate some measured data. Because of many possible results it is difficult to handle or possible combinations. Sometimes an error happens during the evaluation. It is usually an index error because I get out of range from measured data.



It is very difficult to find out on which place in code the problem happened. It would help a lot if I knew on which line the error was raised. If I use following code:



try:
result = evaluateData(data)
except Exception, err:
print ("Error: %s.n" % str(err))


Unfortunately this only tells me that there is and index error. I would like to know more details about the exception (line in code, variable etc.) to find out what happened. Is it possible?



Thank you.










share|improve this question


















  • 1




    See stackoverflow.com/questions/3702675/…!
    – Charles Beattie
    Jan 25 '13 at 9:57










  • docs.python.org/2/library/traceback.html#traceback-examples
    – osa
    Sep 9 '14 at 23:44






  • 3




    @JeCh The answers look good. Please accept one. To accept it click the empty checkmark next to the answer.
    – Michael Potter
    Aug 9 '15 at 23:53










  • The answer that is voted highest here is also presented in the stackoverflow question that @CharlesBeattie references above. That answer has important comments associated with it whereas this answer does not. It's definitely worth your time to check that one out.
    – harperville
    Jan 9 '17 at 17:33













up vote
39
down vote

favorite
19









up vote
39
down vote

favorite
19






19





I'm using python to evaluate some measured data. Because of many possible results it is difficult to handle or possible combinations. Sometimes an error happens during the evaluation. It is usually an index error because I get out of range from measured data.



It is very difficult to find out on which place in code the problem happened. It would help a lot if I knew on which line the error was raised. If I use following code:



try:
result = evaluateData(data)
except Exception, err:
print ("Error: %s.n" % str(err))


Unfortunately this only tells me that there is and index error. I would like to know more details about the exception (line in code, variable etc.) to find out what happened. Is it possible?



Thank you.










share|improve this question













I'm using python to evaluate some measured data. Because of many possible results it is difficult to handle or possible combinations. Sometimes an error happens during the evaluation. It is usually an index error because I get out of range from measured data.



It is very difficult to find out on which place in code the problem happened. It would help a lot if I knew on which line the error was raised. If I use following code:



try:
result = evaluateData(data)
except Exception, err:
print ("Error: %s.n" % str(err))


Unfortunately this only tells me that there is and index error. I would like to know more details about the exception (line in code, variable etc.) to find out what happened. Is it possible?



Thank you.







python exception indexing






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 25 '13 at 9:47









JeCh

315138




315138








  • 1




    See stackoverflow.com/questions/3702675/…!
    – Charles Beattie
    Jan 25 '13 at 9:57










  • docs.python.org/2/library/traceback.html#traceback-examples
    – osa
    Sep 9 '14 at 23:44






  • 3




    @JeCh The answers look good. Please accept one. To accept it click the empty checkmark next to the answer.
    – Michael Potter
    Aug 9 '15 at 23:53










  • The answer that is voted highest here is also presented in the stackoverflow question that @CharlesBeattie references above. That answer has important comments associated with it whereas this answer does not. It's definitely worth your time to check that one out.
    – harperville
    Jan 9 '17 at 17:33














  • 1




    See stackoverflow.com/questions/3702675/…!
    – Charles Beattie
    Jan 25 '13 at 9:57










  • docs.python.org/2/library/traceback.html#traceback-examples
    – osa
    Sep 9 '14 at 23:44






  • 3




    @JeCh The answers look good. Please accept one. To accept it click the empty checkmark next to the answer.
    – Michael Potter
    Aug 9 '15 at 23:53










  • The answer that is voted highest here is also presented in the stackoverflow question that @CharlesBeattie references above. That answer has important comments associated with it whereas this answer does not. It's definitely worth your time to check that one out.
    – harperville
    Jan 9 '17 at 17:33








1




1




See stackoverflow.com/questions/3702675/…!
– Charles Beattie
Jan 25 '13 at 9:57




See stackoverflow.com/questions/3702675/…!
– Charles Beattie
Jan 25 '13 at 9:57












docs.python.org/2/library/traceback.html#traceback-examples
– osa
Sep 9 '14 at 23:44




docs.python.org/2/library/traceback.html#traceback-examples
– osa
Sep 9 '14 at 23:44




3




3




@JeCh The answers look good. Please accept one. To accept it click the empty checkmark next to the answer.
– Michael Potter
Aug 9 '15 at 23:53




@JeCh The answers look good. Please accept one. To accept it click the empty checkmark next to the answer.
– Michael Potter
Aug 9 '15 at 23:53












The answer that is voted highest here is also presented in the stackoverflow question that @CharlesBeattie references above. That answer has important comments associated with it whereas this answer does not. It's definitely worth your time to check that one out.
– harperville
Jan 9 '17 at 17:33




The answer that is voted highest here is also presented in the stackoverflow question that @CharlesBeattie references above. That answer has important comments associated with it whereas this answer does not. It's definitely worth your time to check that one out.
– harperville
Jan 9 '17 at 17:33












4 Answers
4






active

oldest

votes

















up vote
57
down vote













Solution, printing filename, linenumber, line itself and exception descrition:



import linecache
import sys

def PrintException():
exc_type, exc_obj, tb = sys.exc_info()
f = tb.tb_frame
lineno = tb.tb_lineno
filename = f.f_code.co_filename
linecache.checkcache(filename)
line = linecache.getline(filename, lineno, f.f_globals)
print 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)


try:
print 1/0
except:
PrintException()


Output:



EXCEPTION IN (D:/Projects/delme3.py, LINE 15 "print 1/0"): integer division or modulo by zero





share|improve this answer





















  • For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
    – Chris
    Aug 16 at 13:34




















up vote
18
down vote













To simply get the line number you can use sys, if you would like to have more, try the traceback module.



import sys    
try:
[2]
except IndexError:
print 'Error on line {}'.format(sys.exc_info()[-1].tb_lineno)


prints:



Error on line 3




Example from the traceback module documentation:



import sys, traceback

def lumberjack():
bright_side_of_death()

def bright_side_of_death():
return tuple()[0]

try:
lumberjack()
except IndexError:
exc_type, exc_value, exc_traceback = sys.exc_info()
print "*** print_tb:"
traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
print "*** print_exception:"
traceback.print_exception(exc_type, exc_value, exc_traceback,
limit=2, file=sys.stdout)
print "*** print_exc:"
traceback.print_exc()
print "*** format_exc, first and last line:"
formatted_lines = traceback.format_exc().splitlines()
print formatted_lines[0]
print formatted_lines[-1]
print "*** format_exception:"
print repr(traceback.format_exception(exc_type, exc_value,
exc_traceback))
print "*** extract_tb:"
print repr(traceback.extract_tb(exc_traceback))
print "*** format_tb:"
print repr(traceback.format_tb(exc_traceback))
print "*** tb_lineno:", exc_traceback.tb_lineno





share|improve this answer






























    up vote
    4
    down vote













    The simplest way is just to use:



    import traceback
    try:
    <blah>
    except IndexError:
    traceback.print_exc()


    or if using logging:



    import logging
    try:
    <blah>
    except IndexError as e:
    logging.exception(e)





    share|improve this answer




























      up vote
      0
      down vote













      I use the traceback which is simple and robust:



      import traceback

      try:
      raise ValueError()
      except:
      print(traceback.format_exc())


      Out:



      Traceback (most recent call last):
      File "catch.py", line 4, in <module>
      raise ValueError()
      ValueError





      share|improve this answer





















        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function() {
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled) {
        StackExchange.using("snippets", function() {
        createEditor();
        });
        }
        else {
        createEditor();
        }
        });

        function createEditor() {
        StackExchange.prepareEditor({
        heartbeatType: 'answer',
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader: {
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        },
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        });


        }
        });














        draft saved

        draft discarded


















        StackExchange.ready(
        function () {
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f14519177%2fpython-exception-handling-line-number%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        4 Answers
        4






        active

        oldest

        votes








        4 Answers
        4






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        57
        down vote













        Solution, printing filename, linenumber, line itself and exception descrition:



        import linecache
        import sys

        def PrintException():
        exc_type, exc_obj, tb = sys.exc_info()
        f = tb.tb_frame
        lineno = tb.tb_lineno
        filename = f.f_code.co_filename
        linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        print 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)


        try:
        print 1/0
        except:
        PrintException()


        Output:



        EXCEPTION IN (D:/Projects/delme3.py, LINE 15 "print 1/0"): integer division or modulo by zero





        share|improve this answer





















        • For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
          – Chris
          Aug 16 at 13:34

















        up vote
        57
        down vote













        Solution, printing filename, linenumber, line itself and exception descrition:



        import linecache
        import sys

        def PrintException():
        exc_type, exc_obj, tb = sys.exc_info()
        f = tb.tb_frame
        lineno = tb.tb_lineno
        filename = f.f_code.co_filename
        linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        print 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)


        try:
        print 1/0
        except:
        PrintException()


        Output:



        EXCEPTION IN (D:/Projects/delme3.py, LINE 15 "print 1/0"): integer division or modulo by zero





        share|improve this answer





















        • For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
          – Chris
          Aug 16 at 13:34















        up vote
        57
        down vote










        up vote
        57
        down vote









        Solution, printing filename, linenumber, line itself and exception descrition:



        import linecache
        import sys

        def PrintException():
        exc_type, exc_obj, tb = sys.exc_info()
        f = tb.tb_frame
        lineno = tb.tb_lineno
        filename = f.f_code.co_filename
        linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        print 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)


        try:
        print 1/0
        except:
        PrintException()


        Output:



        EXCEPTION IN (D:/Projects/delme3.py, LINE 15 "print 1/0"): integer division or modulo by zero





        share|improve this answer












        Solution, printing filename, linenumber, line itself and exception descrition:



        import linecache
        import sys

        def PrintException():
        exc_type, exc_obj, tb = sys.exc_info()
        f = tb.tb_frame
        lineno = tb.tb_lineno
        filename = f.f_code.co_filename
        linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        print 'EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj)


        try:
        print 1/0
        except:
        PrintException()


        Output:



        EXCEPTION IN (D:/Projects/delme3.py, LINE 15 "print 1/0"): integer division or modulo by zero






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 28 '13 at 10:50









        Apogentus

        3,3632425




        3,3632425












        • For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
          – Chris
          Aug 16 at 13:34




















        • For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
          – Chris
          Aug 16 at 13:34


















        For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
        – Chris
        Aug 16 at 13:34






        For my python 3.6.5 I needed to add parens to last line with print: print('EXCEPTION IN ({}, LINE {} "{}"): {}'.format(filename, lineno, line.strip(), exc_obj))
        – Chris
        Aug 16 at 13:34














        up vote
        18
        down vote













        To simply get the line number you can use sys, if you would like to have more, try the traceback module.



        import sys    
        try:
        [2]
        except IndexError:
        print 'Error on line {}'.format(sys.exc_info()[-1].tb_lineno)


        prints:



        Error on line 3




        Example from the traceback module documentation:



        import sys, traceback

        def lumberjack():
        bright_side_of_death()

        def bright_side_of_death():
        return tuple()[0]

        try:
        lumberjack()
        except IndexError:
        exc_type, exc_value, exc_traceback = sys.exc_info()
        print "*** print_tb:"
        traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
        print "*** print_exception:"
        traceback.print_exception(exc_type, exc_value, exc_traceback,
        limit=2, file=sys.stdout)
        print "*** print_exc:"
        traceback.print_exc()
        print "*** format_exc, first and last line:"
        formatted_lines = traceback.format_exc().splitlines()
        print formatted_lines[0]
        print formatted_lines[-1]
        print "*** format_exception:"
        print repr(traceback.format_exception(exc_type, exc_value,
        exc_traceback))
        print "*** extract_tb:"
        print repr(traceback.extract_tb(exc_traceback))
        print "*** format_tb:"
        print repr(traceback.format_tb(exc_traceback))
        print "*** tb_lineno:", exc_traceback.tb_lineno





        share|improve this answer



























          up vote
          18
          down vote













          To simply get the line number you can use sys, if you would like to have more, try the traceback module.



          import sys    
          try:
          [2]
          except IndexError:
          print 'Error on line {}'.format(sys.exc_info()[-1].tb_lineno)


          prints:



          Error on line 3




          Example from the traceback module documentation:



          import sys, traceback

          def lumberjack():
          bright_side_of_death()

          def bright_side_of_death():
          return tuple()[0]

          try:
          lumberjack()
          except IndexError:
          exc_type, exc_value, exc_traceback = sys.exc_info()
          print "*** print_tb:"
          traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
          print "*** print_exception:"
          traceback.print_exception(exc_type, exc_value, exc_traceback,
          limit=2, file=sys.stdout)
          print "*** print_exc:"
          traceback.print_exc()
          print "*** format_exc, first and last line:"
          formatted_lines = traceback.format_exc().splitlines()
          print formatted_lines[0]
          print formatted_lines[-1]
          print "*** format_exception:"
          print repr(traceback.format_exception(exc_type, exc_value,
          exc_traceback))
          print "*** extract_tb:"
          print repr(traceback.extract_tb(exc_traceback))
          print "*** format_tb:"
          print repr(traceback.format_tb(exc_traceback))
          print "*** tb_lineno:", exc_traceback.tb_lineno





          share|improve this answer

























            up vote
            18
            down vote










            up vote
            18
            down vote









            To simply get the line number you can use sys, if you would like to have more, try the traceback module.



            import sys    
            try:
            [2]
            except IndexError:
            print 'Error on line {}'.format(sys.exc_info()[-1].tb_lineno)


            prints:



            Error on line 3




            Example from the traceback module documentation:



            import sys, traceback

            def lumberjack():
            bright_side_of_death()

            def bright_side_of_death():
            return tuple()[0]

            try:
            lumberjack()
            except IndexError:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            print "*** print_tb:"
            traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
            print "*** print_exception:"
            traceback.print_exception(exc_type, exc_value, exc_traceback,
            limit=2, file=sys.stdout)
            print "*** print_exc:"
            traceback.print_exc()
            print "*** format_exc, first and last line:"
            formatted_lines = traceback.format_exc().splitlines()
            print formatted_lines[0]
            print formatted_lines[-1]
            print "*** format_exception:"
            print repr(traceback.format_exception(exc_type, exc_value,
            exc_traceback))
            print "*** extract_tb:"
            print repr(traceback.extract_tb(exc_traceback))
            print "*** format_tb:"
            print repr(traceback.format_tb(exc_traceback))
            print "*** tb_lineno:", exc_traceback.tb_lineno





            share|improve this answer














            To simply get the line number you can use sys, if you would like to have more, try the traceback module.



            import sys    
            try:
            [2]
            except IndexError:
            print 'Error on line {}'.format(sys.exc_info()[-1].tb_lineno)


            prints:



            Error on line 3




            Example from the traceback module documentation:



            import sys, traceback

            def lumberjack():
            bright_side_of_death()

            def bright_side_of_death():
            return tuple()[0]

            try:
            lumberjack()
            except IndexError:
            exc_type, exc_value, exc_traceback = sys.exc_info()
            print "*** print_tb:"
            traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
            print "*** print_exception:"
            traceback.print_exception(exc_type, exc_value, exc_traceback,
            limit=2, file=sys.stdout)
            print "*** print_exc:"
            traceback.print_exc()
            print "*** format_exc, first and last line:"
            formatted_lines = traceback.format_exc().splitlines()
            print formatted_lines[0]
            print formatted_lines[-1]
            print "*** format_exception:"
            print repr(traceback.format_exception(exc_type, exc_value,
            exc_traceback))
            print "*** extract_tb:"
            print repr(traceback.extract_tb(exc_traceback))
            print "*** format_tb:"
            print repr(traceback.format_tb(exc_traceback))
            print "*** tb_lineno:", exc_traceback.tb_lineno






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 25 '13 at 10:36

























            answered Jan 25 '13 at 9:53









            root

            37.2k127599




            37.2k127599






















                up vote
                4
                down vote













                The simplest way is just to use:



                import traceback
                try:
                <blah>
                except IndexError:
                traceback.print_exc()


                or if using logging:



                import logging
                try:
                <blah>
                except IndexError as e:
                logging.exception(e)





                share|improve this answer

























                  up vote
                  4
                  down vote













                  The simplest way is just to use:



                  import traceback
                  try:
                  <blah>
                  except IndexError:
                  traceback.print_exc()


                  or if using logging:



                  import logging
                  try:
                  <blah>
                  except IndexError as e:
                  logging.exception(e)





                  share|improve this answer























                    up vote
                    4
                    down vote










                    up vote
                    4
                    down vote









                    The simplest way is just to use:



                    import traceback
                    try:
                    <blah>
                    except IndexError:
                    traceback.print_exc()


                    or if using logging:



                    import logging
                    try:
                    <blah>
                    except IndexError as e:
                    logging.exception(e)





                    share|improve this answer












                    The simplest way is just to use:



                    import traceback
                    try:
                    <blah>
                    except IndexError:
                    traceback.print_exc()


                    or if using logging:



                    import logging
                    try:
                    <blah>
                    except IndexError as e:
                    logging.exception(e)






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 19 '17 at 0:28









                    acowpy

                    1115




                    1115






















                        up vote
                        0
                        down vote













                        I use the traceback which is simple and robust:



                        import traceback

                        try:
                        raise ValueError()
                        except:
                        print(traceback.format_exc())


                        Out:



                        Traceback (most recent call last):
                        File "catch.py", line 4, in <module>
                        raise ValueError()
                        ValueError





                        share|improve this answer

























                          up vote
                          0
                          down vote













                          I use the traceback which is simple and robust:



                          import traceback

                          try:
                          raise ValueError()
                          except:
                          print(traceback.format_exc())


                          Out:



                          Traceback (most recent call last):
                          File "catch.py", line 4, in <module>
                          raise ValueError()
                          ValueError





                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            I use the traceback which is simple and robust:



                            import traceback

                            try:
                            raise ValueError()
                            except:
                            print(traceback.format_exc())


                            Out:



                            Traceback (most recent call last):
                            File "catch.py", line 4, in <module>
                            raise ValueError()
                            ValueError





                            share|improve this answer












                            I use the traceback which is simple and robust:



                            import traceback

                            try:
                            raise ValueError()
                            except:
                            print(traceback.format_exc())


                            Out:



                            Traceback (most recent call last):
                            File "catch.py", line 4, in <module>
                            raise ValueError()
                            ValueError






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Nov 11 at 13:43









                            Benyamin Jafari

                            2,46031833




                            2,46031833






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.





                                Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                Please pay close attention to the following guidance:


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid



                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.


                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function () {
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f14519177%2fpython-exception-handling-line-number%23new-answer', 'question_page');
                                }
                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Xamarin.iOS Cant Deploy on Iphone

                                Glorious Revolution

                                Dulmage-Mendelsohn matrix decomposition in Python