Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <title>IndexError: list index out of range // Werkzeug Debugger</title>
- <link rel="stylesheet" href="?__debugger__=yes&cmd=resource&f=style.css"
- type="text/css">
- <!-- We need to make sure this has a favicon so that the debugger does
- not by accident trigger a request to /favicon.ico which might
- change the application state. -->
- <link rel="shortcut icon"
- href="?__debugger__=yes&cmd=resource&f=console.png">
- <script src="?__debugger__=yes&cmd=resource&f=jquery.js"></script>
- <script src="?__debugger__=yes&cmd=resource&f=debugger.js"></script>
- <script type="text/javascript">
- var TRACEBACK = 1056592944376,
- CONSOLE_MODE = false,
- EVALEX = true,
- EVALEX_TRUSTED = false,
- SECRET = "5yiZPvQTae4yiHag2Nn9";
- </script>
- </head>
- <body style="background-color: #fff">
- <div class="debugger">
- <h1>IndexError</h1>
- <div class="detail">
- <p class="errormsg">IndexError: list index out of range</p>
- </div>
- <h2 class="traceback">Traceback <em>(most recent call last)</em></h2>
- <div class="traceback">
- <ul><li><div class="frame" id="frame-1056592944488">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">2463</em>,
- in <code class="function">__call__</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"> </span>def __call__(self, environ, start_response):</pre>
- <pre class="line before"><span class="ws"> </span>"""The WSGI server calls the Flask application object as the</pre>
- <pre class="line before"><span class="ws"> </span>WSGI application. This calls :meth:`wsgi_app` which can be</pre>
- <pre class="line before"><span class="ws"> </span>wrapped to applying middleware."""</pre>
- <pre class="line current"><span class="ws"> </span>return self.wsgi_app(environ, start_response)</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>def __repr__(self):</pre>
- <pre class="line after"><span class="ws"> </span>return "<%s %r>" % (self.__class__.__name__, self.name)</pre></div>
- </div>
- <li><div class="frame" id="frame-1056592944824">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">2449</em>,
- in <code class="function">wsgi_app</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>try:</pre>
- <pre class="line before"><span class="ws"> </span>ctx.push()</pre>
- <pre class="line before"><span class="ws"> </span>response = self.full_dispatch_request()</pre>
- <pre class="line before"><span class="ws"> </span>except Exception as e:</pre>
- <pre class="line before"><span class="ws"> </span>error = e</pre>
- <pre class="line current"><span class="ws"> </span>response = self.handle_exception(e)</pre>
- <pre class="line after"><span class="ws"> </span>except: # noqa: B001</pre>
- <pre class="line after"><span class="ws"> </span>error = sys.exc_info()[1]</pre>
- <pre class="line after"><span class="ws"> </span>raise</pre>
- <pre class="line after"><span class="ws"> </span>return response(environ, start_response)</pre>
- <pre class="line after"><span class="ws"> </span>finally:</pre></div>
- </div>
- <li><div class="frame" id="frame-1056592944936">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">1866</em>,
- in <code class="function">handle_exception</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span># if we want to repropagate the exception, we can attempt to</pre>
- <pre class="line before"><span class="ws"> </span># raise it with the whole traceback in case we can do that</pre>
- <pre class="line before"><span class="ws"> </span># (the function was actually called from the except part)</pre>
- <pre class="line before"><span class="ws"> </span># otherwise, we just raise the error again</pre>
- <pre class="line before"><span class="ws"> </span>if exc_value is e:</pre>
- <pre class="line current"><span class="ws"> </span>reraise(exc_type, exc_value, tb)</pre>
- <pre class="line after"><span class="ws"> </span>else:</pre>
- <pre class="line after"><span class="ws"> </span>raise e</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>self.log_exception((exc_type, exc_value, tb))</pre>
- <pre class="line after"><span class="ws"> </span>server_error = InternalServerError()</pre></div>
- </div>
- <li><div class="frame" id="frame-1056592945048">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py"</cite>,
- line <em class="line">39</em>,
- in <code class="function">reraise</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>import collections.abc as collections_abc</pre>
- <pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"> </span>def reraise(tp, value, tb=None):</pre>
- <pre class="line before"><span class="ws"> </span>if value.__traceback__ is not tb:</pre>
- <pre class="line before"><span class="ws"> </span>raise value.with_traceback(tb)</pre>
- <pre class="line current"><span class="ws"> </span>raise value</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>implements_to_string = _identity</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"></span>else:</pre>
- <pre class="line after"><span class="ws"> </span>iterkeys = lambda d: d.iterkeys()</pre></div>
- </div>
- <li><div class="frame" id="frame-1056592944880">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">2446</em>,
- in <code class="function">wsgi_app</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>ctx = self.request_context(environ)</pre>
- <pre class="line before"><span class="ws"> </span>error = None</pre>
- <pre class="line before"><span class="ws"> </span>try:</pre>
- <pre class="line before"><span class="ws"> </span>try:</pre>
- <pre class="line before"><span class="ws"> </span>ctx.push()</pre>
- <pre class="line current"><span class="ws"> </span>response = self.full_dispatch_request()</pre>
- <pre class="line after"><span class="ws"> </span>except Exception as e:</pre>
- <pre class="line after"><span class="ws"> </span>error = e</pre>
- <pre class="line after"><span class="ws"> </span>response = self.handle_exception(e)</pre>
- <pre class="line after"><span class="ws"> </span>except: # noqa: B001</pre>
- <pre class="line after"><span class="ws"> </span>error = sys.exc_info()[1]</pre></div>
- </div>
- <li><div class="frame" id="frame-1056592945104">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">1951</em>,
- in <code class="function">full_dispatch_request</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>request_started.send(self)</pre>
- <pre class="line before"><span class="ws"> </span>rv = self.preprocess_request()</pre>
- <pre class="line before"><span class="ws"> </span>if rv is None:</pre>
- <pre class="line before"><span class="ws"> </span>rv = self.dispatch_request()</pre>
- <pre class="line before"><span class="ws"> </span>except Exception as e:</pre>
- <pre class="line current"><span class="ws"> </span>rv = self.handle_user_exception(e)</pre>
- <pre class="line after"><span class="ws"> </span>return self.finalize_request(rv)</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>def finalize_request(self, rv, from_error_handler=False):</pre>
- <pre class="line after"><span class="ws"> </span>"""Given the return value from a view function this finalizes</pre>
- <pre class="line after"><span class="ws"> </span>the request by converting it into a response and invoking the</pre></div>
- </div>
- <li><div class="frame" id="frame-1056592944992">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">1820</em>,
- in <code class="function">handle_user_exception</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>return self.handle_http_exception(e)</pre>
- <pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"> </span>handler = self._find_error_handler(e)</pre>
- <pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"> </span>if handler is None:</pre>
- <pre class="line current"><span class="ws"> </span>reraise(exc_type, exc_value, tb)</pre>
- <pre class="line after"><span class="ws"> </span>return handler(e)</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>def handle_exception(self, e):</pre>
- <pre class="line after"><span class="ws"> </span>"""Handle an exception that did not have an error handler</pre>
- <pre class="line after"><span class="ws"> </span>associated with it, or that was raised from an error handler.</pre></div>
- </div>
- <li><div class="frame" id="frame-1056593641544">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py"</cite>,
- line <em class="line">39</em>,
- in <code class="function">reraise</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>import collections.abc as collections_abc</pre>
- <pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"> </span>def reraise(tp, value, tb=None):</pre>
- <pre class="line before"><span class="ws"> </span>if value.__traceback__ is not tb:</pre>
- <pre class="line before"><span class="ws"> </span>raise value.with_traceback(tb)</pre>
- <pre class="line current"><span class="ws"> </span>raise value</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>implements_to_string = _identity</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"></span>else:</pre>
- <pre class="line after"><span class="ws"> </span>iterkeys = lambda d: d.iterkeys()</pre></div>
- </div>
- <li><div class="frame" id="frame-1056593641656">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">1949</em>,
- in <code class="function">full_dispatch_request</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>self.try_trigger_before_first_request_functions()</pre>
- <pre class="line before"><span class="ws"> </span>try:</pre>
- <pre class="line before"><span class="ws"> </span>request_started.send(self)</pre>
- <pre class="line before"><span class="ws"> </span>rv = self.preprocess_request()</pre>
- <pre class="line before"><span class="ws"> </span>if rv is None:</pre>
- <pre class="line current"><span class="ws"> </span>rv = self.dispatch_request()</pre>
- <pre class="line after"><span class="ws"> </span>except Exception as e:</pre>
- <pre class="line after"><span class="ws"> </span>rv = self.handle_user_exception(e)</pre>
- <pre class="line after"><span class="ws"> </span>return self.finalize_request(rv)</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>def finalize_request(self, rv, from_error_handler=False):</pre></div>
- </div>
- <li><div class="frame" id="frame-1056593641768">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
- line <em class="line">1935</em>,
- in <code class="function">dispatch_request</code></h4>
- <div class="source library"><pre class="line before"><span class="ws"> </span>getattr(rule, "provide_automatic_options", False)</pre>
- <pre class="line before"><span class="ws"> </span>and req.method == "OPTIONS"</pre>
- <pre class="line before"><span class="ws"> </span>):</pre>
- <pre class="line before"><span class="ws"> </span>return self.make_default_options_response()</pre>
- <pre class="line before"><span class="ws"> </span># otherwise dispatch to the handler for that endpoint</pre>
- <pre class="line current"><span class="ws"> </span>return self.view_functions[rule.endpoint](**req.view_args)</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>def full_dispatch_request(self):</pre>
- <pre class="line after"><span class="ws"> </span>"""Dispatches the request and on top of that performs request</pre>
- <pre class="line after"><span class="ws"> </span>pre and postprocessing as well as HTTP exception catching and</pre>
- <pre class="line after"><span class="ws"> </span>error handling.</pre></div>
- </div>
- <li><div class="frame" id="frame-1056593641600">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\web_service.py"</cite>,
- line <em class="line">10</em>,
- in <code class="function">analysis</code></h4>
- <div class="source "><pre class="line before"><span class="ws"></span>app = Flask(__name__)</pre>
- <pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"></span>@app.route('/DocAnalysis', methods=['GET'])</pre>
- <pre class="line before"><span class="ws"></span>def analysis():</pre>
- <pre class="line before"><span class="ws"> </span>path_doc = request.args.get('path')</pre>
- <pre class="line current"><span class="ws"> </span>return vision_analysis.analysis(path_doc)</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"></span>if __name__ == '__main__':</pre>
- <pre class="line after"><span class="ws"> </span>app.run(debug=True, port=4949)</pre></div>
- </div>
- <li><div class="frame" id="frame-1056593641880">
- <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\vision_analysis.py"</cite>,
- line <em class="line">348</em>,
- in <code class="function">analysis</code></h4>
- <div class="source "><pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"></span>def analysis(image_path):</pre>
- <pre class="line before"><span class="ws"> </span>image_path = 'D:/a_tech\geofleet/attached_documents/' + image_path</pre>
- <pre class="line before"><span class="ws"></span> </pre>
- <pre class="line before"><span class="ws"> </span># convert and save file as a temporary file for modification (trim, ...)</pre>
- <pre class="line current"><span class="ws"> </span>if image_path.split('/')[-1].split('.')[1] == 'pdf' :</pre>
- <pre class="line after"><span class="ws"> </span>convert_from_path(image_path, single_file=True, fmt="jpeg", output_folder='data', output_file='temp')</pre>
- <pre class="line after"><span class="ws"> </span>else :</pre>
- <pre class="line after"><span class="ws"> </span>Image.open(image_path).save('data/temp.jpg')</pre>
- <pre class="line after"><span class="ws"></span> </pre>
- <pre class="line after"><span class="ws"> </span>detected_info = {'firstName': None, 'lastName': None, 'Names': None, 'Belgian': None, 'Expiration': None, 'NISS': None, 'limosa': None, 'BCE': None, 'companyName': None, 'detected_types': None}</pre></div>
- </div>
- </ul>
- <blockquote>IndexError: list index out of range</blockquote>
- </div>
- <div class="plain">
- <form action="/?__debugger__=yes&cmd=paste" method="post">
- <p>
- <input type="hidden" name="language" value="pytb">
- This is the Copy/Paste friendly version of the traceback. <span
- class="pastemessage">You can also paste this traceback into
- a <a href="https://gist.github.com/">gist</a>:
- <input type="submit" value="create paste"></span>
- </p>
- <textarea cols="50" rows="10" name="code" readonly>Traceback (most recent call last):
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2463, in __call__
- return self.wsgi_app(environ, start_response)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2449, in wsgi_app
- response = self.handle_exception(e)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1866, in handle_exception
- reraise(exc_type, exc_value, tb)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
- raise value
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2446, in wsgi_app
- response = self.full_dispatch_request()
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
- rv = self.handle_user_exception(e)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
- reraise(exc_type, exc_value, tb)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
- raise value
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
- rv = self.dispatch_request()
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1935, in dispatch_request
- return self.view_functions[rule.endpoint](**req.view_args)
- File "C:\a_tech\DeepAdmin\DocAnalysis\web_service.py", line 10, in analysis
- return vision_analysis.analysis(path_doc)
- File "C:\a_tech\DeepAdmin\DocAnalysis\vision_analysis.py", line 348, in analysis
- if image_path.split('/')[-1].split('.')[1] == 'pdf' :
- IndexError: list index out of range</textarea>
- </form>
- </div>
- <div class="explanation">
- The debugger caught an exception in your WSGI application. You can now
- look at the traceback which led to the error. <span class="nojavascript">
- If you enable JavaScript you can also use additional features such as code
- execution (if the evalex feature is enabled), automatic pasting of the
- exceptions and much more.</span>
- </div>
- <div class="footer">
- Brought to you by <strong class="arthur">DON'T PANIC</strong>, your
- friendly Werkzeug powered traceback interpreter.
- </div>
- </div>
- <div class="pin-prompt">
- <div class="inner">
- <h3>Console Locked</h3>
- <p>
- The console is locked and needs to be unlocked by entering the PIN.
- You can find the PIN printed out on the standard output of your
- shell that runs the server.
- <form>
- <p>PIN:
- <input type=text name=pin size=14>
- <input type=submit name=btn value="Confirm Pin">
- </form>
- </div>
- </div>
- </body>
- </html>
- <!--
- Traceback (most recent call last):
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2463, in __call__
- return self.wsgi_app(environ, start_response)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2449, in wsgi_app
- response = self.handle_exception(e)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1866, in handle_exception
- reraise(exc_type, exc_value, tb)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
- raise value
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2446, in wsgi_app
- response = self.full_dispatch_request()
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
- rv = self.handle_user_exception(e)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
- reraise(exc_type, exc_value, tb)
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
- raise value
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
- rv = self.dispatch_request()
- File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1935, in dispatch_request
- return self.view_functions[rule.endpoint](**req.view_args)
- File "C:\a_tech\DeepAdmin\DocAnalysis\web_service.py", line 10, in analysis
- return vision_analysis.analysis(path_doc)
- File "C:\a_tech\DeepAdmin\DocAnalysis\vision_analysis.py", line 348, in analysis
- if image_path.split('/')[-1].split('.')[1] == 'pdf' :
- IndexError: list index out of range
- -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement