Advertisement
psi_mmobile

Untitled

Mar 4th, 2020
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.87 KB | None | 0 0
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <title>IndexError: list index out of range // Werkzeug Debugger</title>
  6. <link rel="stylesheet" href="?__debugger__=yes&amp;cmd=resource&amp;f=style.css"
  7. type="text/css">
  8. <!-- We need to make sure this has a favicon so that the debugger does
  9. not by accident trigger a request to /favicon.ico which might
  10. change the application state. -->
  11. <link rel="shortcut icon"
  12. href="?__debugger__=yes&amp;cmd=resource&amp;f=console.png">
  13. <script src="?__debugger__=yes&amp;cmd=resource&amp;f=jquery.js"></script>
  14. <script src="?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js"></script>
  15. <script type="text/javascript">
  16. var TRACEBACK = 1056592944376,
  17. CONSOLE_MODE = false,
  18. EVALEX = true,
  19. EVALEX_TRUSTED = false,
  20. SECRET = "5yiZPvQTae4yiHag2Nn9";
  21. </script>
  22. </head>
  23. <body style="background-color: #fff">
  24. <div class="debugger">
  25. <h1>IndexError</h1>
  26. <div class="detail">
  27. <p class="errormsg">IndexError: list index out of range</p>
  28. </div>
  29. <h2 class="traceback">Traceback <em>(most recent call last)</em></h2>
  30. <div class="traceback">
  31.  
  32. <ul><li><div class="frame" id="frame-1056592944488">
  33. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  34. line <em class="line">2463</em>,
  35. in <code class="function">__call__</code></h4>
  36. <div class="source library"><pre class="line before"><span class="ws"></span> </pre>
  37. <pre class="line before"><span class="ws"> </span>def __call__(self, environ, start_response):</pre>
  38. <pre class="line before"><span class="ws"> </span>&quot;&quot;&quot;The WSGI server calls the Flask application object as the</pre>
  39. <pre class="line before"><span class="ws"> </span>WSGI application. This calls :meth:`wsgi_app` which can be</pre>
  40. <pre class="line before"><span class="ws"> </span>wrapped to applying middleware.&quot;&quot;&quot;</pre>
  41. <pre class="line current"><span class="ws"> </span>return self.wsgi_app(environ, start_response)</pre>
  42. <pre class="line after"><span class="ws"></span> </pre>
  43. <pre class="line after"><span class="ws"> </span>def __repr__(self):</pre>
  44. <pre class="line after"><span class="ws"> </span>return &quot;&lt;%s %r&gt;&quot; % (self.__class__.__name__, self.name)</pre></div>
  45. </div>
  46.  
  47. <li><div class="frame" id="frame-1056592944824">
  48. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  49. line <em class="line">2449</em>,
  50. in <code class="function">wsgi_app</code></h4>
  51. <div class="source library"><pre class="line before"><span class="ws"> </span>try:</pre>
  52. <pre class="line before"><span class="ws"> </span>ctx.push()</pre>
  53. <pre class="line before"><span class="ws"> </span>response = self.full_dispatch_request()</pre>
  54. <pre class="line before"><span class="ws"> </span>except Exception as e:</pre>
  55. <pre class="line before"><span class="ws"> </span>error = e</pre>
  56. <pre class="line current"><span class="ws"> </span>response = self.handle_exception(e)</pre>
  57. <pre class="line after"><span class="ws"> </span>except: # noqa: B001</pre>
  58. <pre class="line after"><span class="ws"> </span>error = sys.exc_info()[1]</pre>
  59. <pre class="line after"><span class="ws"> </span>raise</pre>
  60. <pre class="line after"><span class="ws"> </span>return response(environ, start_response)</pre>
  61. <pre class="line after"><span class="ws"> </span>finally:</pre></div>
  62. </div>
  63.  
  64. <li><div class="frame" id="frame-1056592944936">
  65. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  66. line <em class="line">1866</em>,
  67. in <code class="function">handle_exception</code></h4>
  68. <div class="source library"><pre class="line before"><span class="ws"> </span># if we want to repropagate the exception, we can attempt to</pre>
  69. <pre class="line before"><span class="ws"> </span># raise it with the whole traceback in case we can do that</pre>
  70. <pre class="line before"><span class="ws"> </span># (the function was actually called from the except part)</pre>
  71. <pre class="line before"><span class="ws"> </span># otherwise, we just raise the error again</pre>
  72. <pre class="line before"><span class="ws"> </span>if exc_value is e:</pre>
  73. <pre class="line current"><span class="ws"> </span>reraise(exc_type, exc_value, tb)</pre>
  74. <pre class="line after"><span class="ws"> </span>else:</pre>
  75. <pre class="line after"><span class="ws"> </span>raise e</pre>
  76. <pre class="line after"><span class="ws"></span> </pre>
  77. <pre class="line after"><span class="ws"> </span>self.log_exception((exc_type, exc_value, tb))</pre>
  78. <pre class="line after"><span class="ws"> </span>server_error = InternalServerError()</pre></div>
  79. </div>
  80.  
  81. <li><div class="frame" id="frame-1056592945048">
  82. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py"</cite>,
  83. line <em class="line">39</em>,
  84. in <code class="function">reraise</code></h4>
  85. <div class="source library"><pre class="line before"><span class="ws"> </span>import collections.abc as collections_abc</pre>
  86. <pre class="line before"><span class="ws"></span> </pre>
  87. <pre class="line before"><span class="ws"> </span>def reraise(tp, value, tb=None):</pre>
  88. <pre class="line before"><span class="ws"> </span>if value.__traceback__ is not tb:</pre>
  89. <pre class="line before"><span class="ws"> </span>raise value.with_traceback(tb)</pre>
  90. <pre class="line current"><span class="ws"> </span>raise value</pre>
  91. <pre class="line after"><span class="ws"></span> </pre>
  92. <pre class="line after"><span class="ws"> </span>implements_to_string = _identity</pre>
  93. <pre class="line after"><span class="ws"></span> </pre>
  94. <pre class="line after"><span class="ws"></span>else:</pre>
  95. <pre class="line after"><span class="ws"> </span>iterkeys = lambda d: d.iterkeys()</pre></div>
  96. </div>
  97.  
  98. <li><div class="frame" id="frame-1056592944880">
  99. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  100. line <em class="line">2446</em>,
  101. in <code class="function">wsgi_app</code></h4>
  102. <div class="source library"><pre class="line before"><span class="ws"> </span>ctx = self.request_context(environ)</pre>
  103. <pre class="line before"><span class="ws"> </span>error = None</pre>
  104. <pre class="line before"><span class="ws"> </span>try:</pre>
  105. <pre class="line before"><span class="ws"> </span>try:</pre>
  106. <pre class="line before"><span class="ws"> </span>ctx.push()</pre>
  107. <pre class="line current"><span class="ws"> </span>response = self.full_dispatch_request()</pre>
  108. <pre class="line after"><span class="ws"> </span>except Exception as e:</pre>
  109. <pre class="line after"><span class="ws"> </span>error = e</pre>
  110. <pre class="line after"><span class="ws"> </span>response = self.handle_exception(e)</pre>
  111. <pre class="line after"><span class="ws"> </span>except: # noqa: B001</pre>
  112. <pre class="line after"><span class="ws"> </span>error = sys.exc_info()[1]</pre></div>
  113. </div>
  114.  
  115. <li><div class="frame" id="frame-1056592945104">
  116. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  117. line <em class="line">1951</em>,
  118. in <code class="function">full_dispatch_request</code></h4>
  119. <div class="source library"><pre class="line before"><span class="ws"> </span>request_started.send(self)</pre>
  120. <pre class="line before"><span class="ws"> </span>rv = self.preprocess_request()</pre>
  121. <pre class="line before"><span class="ws"> </span>if rv is None:</pre>
  122. <pre class="line before"><span class="ws"> </span>rv = self.dispatch_request()</pre>
  123. <pre class="line before"><span class="ws"> </span>except Exception as e:</pre>
  124. <pre class="line current"><span class="ws"> </span>rv = self.handle_user_exception(e)</pre>
  125. <pre class="line after"><span class="ws"> </span>return self.finalize_request(rv)</pre>
  126. <pre class="line after"><span class="ws"></span> </pre>
  127. <pre class="line after"><span class="ws"> </span>def finalize_request(self, rv, from_error_handler=False):</pre>
  128. <pre class="line after"><span class="ws"> </span>&quot;&quot;&quot;Given the return value from a view function this finalizes</pre>
  129. <pre class="line after"><span class="ws"> </span>the request by converting it into a response and invoking the</pre></div>
  130. </div>
  131.  
  132. <li><div class="frame" id="frame-1056592944992">
  133. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  134. line <em class="line">1820</em>,
  135. in <code class="function">handle_user_exception</code></h4>
  136. <div class="source library"><pre class="line before"><span class="ws"> </span>return self.handle_http_exception(e)</pre>
  137. <pre class="line before"><span class="ws"></span> </pre>
  138. <pre class="line before"><span class="ws"> </span>handler = self._find_error_handler(e)</pre>
  139. <pre class="line before"><span class="ws"></span> </pre>
  140. <pre class="line before"><span class="ws"> </span>if handler is None:</pre>
  141. <pre class="line current"><span class="ws"> </span>reraise(exc_type, exc_value, tb)</pre>
  142. <pre class="line after"><span class="ws"> </span>return handler(e)</pre>
  143. <pre class="line after"><span class="ws"></span> </pre>
  144. <pre class="line after"><span class="ws"> </span>def handle_exception(self, e):</pre>
  145. <pre class="line after"><span class="ws"> </span>&quot;&quot;&quot;Handle an exception that did not have an error handler</pre>
  146. <pre class="line after"><span class="ws"> </span>associated with it, or that was raised from an error handler.</pre></div>
  147. </div>
  148.  
  149. <li><div class="frame" id="frame-1056593641544">
  150. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py"</cite>,
  151. line <em class="line">39</em>,
  152. in <code class="function">reraise</code></h4>
  153. <div class="source library"><pre class="line before"><span class="ws"> </span>import collections.abc as collections_abc</pre>
  154. <pre class="line before"><span class="ws"></span> </pre>
  155. <pre class="line before"><span class="ws"> </span>def reraise(tp, value, tb=None):</pre>
  156. <pre class="line before"><span class="ws"> </span>if value.__traceback__ is not tb:</pre>
  157. <pre class="line before"><span class="ws"> </span>raise value.with_traceback(tb)</pre>
  158. <pre class="line current"><span class="ws"> </span>raise value</pre>
  159. <pre class="line after"><span class="ws"></span> </pre>
  160. <pre class="line after"><span class="ws"> </span>implements_to_string = _identity</pre>
  161. <pre class="line after"><span class="ws"></span> </pre>
  162. <pre class="line after"><span class="ws"></span>else:</pre>
  163. <pre class="line after"><span class="ws"> </span>iterkeys = lambda d: d.iterkeys()</pre></div>
  164. </div>
  165.  
  166. <li><div class="frame" id="frame-1056593641656">
  167. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  168. line <em class="line">1949</em>,
  169. in <code class="function">full_dispatch_request</code></h4>
  170. <div class="source library"><pre class="line before"><span class="ws"> </span>self.try_trigger_before_first_request_functions()</pre>
  171. <pre class="line before"><span class="ws"> </span>try:</pre>
  172. <pre class="line before"><span class="ws"> </span>request_started.send(self)</pre>
  173. <pre class="line before"><span class="ws"> </span>rv = self.preprocess_request()</pre>
  174. <pre class="line before"><span class="ws"> </span>if rv is None:</pre>
  175. <pre class="line current"><span class="ws"> </span>rv = self.dispatch_request()</pre>
  176. <pre class="line after"><span class="ws"> </span>except Exception as e:</pre>
  177. <pre class="line after"><span class="ws"> </span>rv = self.handle_user_exception(e)</pre>
  178. <pre class="line after"><span class="ws"> </span>return self.finalize_request(rv)</pre>
  179. <pre class="line after"><span class="ws"></span> </pre>
  180. <pre class="line after"><span class="ws"> </span>def finalize_request(self, rv, from_error_handler=False):</pre></div>
  181. </div>
  182.  
  183. <li><div class="frame" id="frame-1056593641768">
  184. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py"</cite>,
  185. line <em class="line">1935</em>,
  186. in <code class="function">dispatch_request</code></h4>
  187. <div class="source library"><pre class="line before"><span class="ws"> </span>getattr(rule, &quot;provide_automatic_options&quot;, False)</pre>
  188. <pre class="line before"><span class="ws"> </span>and req.method == &quot;OPTIONS&quot;</pre>
  189. <pre class="line before"><span class="ws"> </span>):</pre>
  190. <pre class="line before"><span class="ws"> </span>return self.make_default_options_response()</pre>
  191. <pre class="line before"><span class="ws"> </span># otherwise dispatch to the handler for that endpoint</pre>
  192. <pre class="line current"><span class="ws"> </span>return self.view_functions[rule.endpoint](**req.view_args)</pre>
  193. <pre class="line after"><span class="ws"></span> </pre>
  194. <pre class="line after"><span class="ws"> </span>def full_dispatch_request(self):</pre>
  195. <pre class="line after"><span class="ws"> </span>&quot;&quot;&quot;Dispatches the request and on top of that performs request</pre>
  196. <pre class="line after"><span class="ws"> </span>pre and postprocessing as well as HTTP exception catching and</pre>
  197. <pre class="line after"><span class="ws"> </span>error handling.</pre></div>
  198. </div>
  199.  
  200. <li><div class="frame" id="frame-1056593641600">
  201. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\web_service.py"</cite>,
  202. line <em class="line">10</em>,
  203. in <code class="function">analysis</code></h4>
  204. <div class="source "><pre class="line before"><span class="ws"></span>app = Flask(__name__)</pre>
  205. <pre class="line before"><span class="ws"></span> </pre>
  206. <pre class="line before"><span class="ws"></span>@app.route('/DocAnalysis', methods=['GET'])</pre>
  207. <pre class="line before"><span class="ws"></span>def analysis():</pre>
  208. <pre class="line before"><span class="ws"> </span>path_doc = request.args.get('path')</pre>
  209. <pre class="line current"><span class="ws"> </span>return vision_analysis.analysis(path_doc)</pre>
  210. <pre class="line after"><span class="ws"></span> </pre>
  211. <pre class="line after"><span class="ws"></span> </pre>
  212. <pre class="line after"><span class="ws"></span>if __name__ == '__main__':</pre>
  213. <pre class="line after"><span class="ws"> </span>app.run(debug=True, port=4949)</pre></div>
  214. </div>
  215.  
  216. <li><div class="frame" id="frame-1056593641880">
  217. <h4>File <cite class="filename">"C:\a_tech\DeepAdmin\DocAnalysis\vision_analysis.py"</cite>,
  218. line <em class="line">348</em>,
  219. in <code class="function">analysis</code></h4>
  220. <div class="source "><pre class="line before"><span class="ws"></span> </pre>
  221. <pre class="line before"><span class="ws"></span>def analysis(image_path):</pre>
  222. <pre class="line before"><span class="ws"> </span>image_path = 'D:/a_tech\geofleet/attached_documents/' + image_path</pre>
  223. <pre class="line before"><span class="ws"></span> </pre>
  224. <pre class="line before"><span class="ws"> </span># convert and save file as a temporary file for modification (trim, ...)</pre>
  225. <pre class="line current"><span class="ws"> </span>if image_path.split('/')[-1].split('.')[1] == 'pdf' :</pre>
  226. <pre class="line after"><span class="ws"> </span>convert_from_path(image_path, single_file=True, fmt=&quot;jpeg&quot;, output_folder='data', output_file='temp')</pre>
  227. <pre class="line after"><span class="ws"> </span>else :</pre>
  228. <pre class="line after"><span class="ws"> </span>Image.open(image_path).save('data/temp.jpg')</pre>
  229. <pre class="line after"><span class="ws"></span> </pre>
  230. <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>
  231. </div>
  232. </ul>
  233. <blockquote>IndexError: list index out of range</blockquote>
  234. </div>
  235.  
  236. <div class="plain">
  237. <form action="/?__debugger__=yes&amp;cmd=paste" method="post">
  238. <p>
  239. <input type="hidden" name="language" value="pytb">
  240. This is the Copy/Paste friendly version of the traceback. <span
  241. class="pastemessage">You can also paste this traceback into
  242. a <a href="https://gist.github.com/">gist</a>:
  243. <input type="submit" value="create paste"></span>
  244. </p>
  245. <textarea cols="50" rows="10" name="code" readonly>Traceback (most recent call last):
  246. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 2463, in __call__
  247. return self.wsgi_app(environ, start_response)
  248. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 2449, in wsgi_app
  249. response = self.handle_exception(e)
  250. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 1866, in handle_exception
  251. reraise(exc_type, exc_value, tb)
  252. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py&quot;, line 39, in reraise
  253. raise value
  254. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 2446, in wsgi_app
  255. response = self.full_dispatch_request()
  256. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 1951, in full_dispatch_request
  257. rv = self.handle_user_exception(e)
  258. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 1820, in handle_user_exception
  259. reraise(exc_type, exc_value, tb)
  260. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py&quot;, line 39, in reraise
  261. raise value
  262. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 1949, in full_dispatch_request
  263. rv = self.dispatch_request()
  264. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py&quot;, line 1935, in dispatch_request
  265. return self.view_functions[rule.endpoint](**req.view_args)
  266. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\web_service.py&quot;, line 10, in analysis
  267. return vision_analysis.analysis(path_doc)
  268. File &quot;C:\a_tech\DeepAdmin\DocAnalysis\vision_analysis.py&quot;, line 348, in analysis
  269. if image_path.split('/')[-1].split('.')[1] == 'pdf' :
  270. IndexError: list index out of range</textarea>
  271. </form>
  272. </div>
  273. <div class="explanation">
  274. The debugger caught an exception in your WSGI application. You can now
  275. look at the traceback which led to the error. <span class="nojavascript">
  276. If you enable JavaScript you can also use additional features such as code
  277. execution (if the evalex feature is enabled), automatic pasting of the
  278. exceptions and much more.</span>
  279. </div>
  280. <div class="footer">
  281. Brought to you by <strong class="arthur">DON'T PANIC</strong>, your
  282. friendly Werkzeug powered traceback interpreter.
  283. </div>
  284. </div>
  285.  
  286. <div class="pin-prompt">
  287. <div class="inner">
  288. <h3>Console Locked</h3>
  289. <p>
  290. The console is locked and needs to be unlocked by entering the PIN.
  291. You can find the PIN printed out on the standard output of your
  292. shell that runs the server.
  293. <form>
  294. <p>PIN:
  295. <input type=text name=pin size=14>
  296. <input type=submit name=btn value="Confirm Pin">
  297. </form>
  298. </div>
  299. </div>
  300. </body>
  301. </html>
  302.  
  303. <!--
  304.  
  305. Traceback (most recent call last):
  306. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2463, in __call__
  307. return self.wsgi_app(environ, start_response)
  308. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2449, in wsgi_app
  309. response = self.handle_exception(e)
  310. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1866, in handle_exception
  311. reraise(exc_type, exc_value, tb)
  312. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
  313. raise value
  314. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 2446, in wsgi_app
  315. response = self.full_dispatch_request()
  316. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
  317. rv = self.handle_user_exception(e)
  318. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
  319. reraise(exc_type, exc_value, tb)
  320. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\_compat.py", line 39, in reraise
  321. raise value
  322. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
  323. rv = self.dispatch_request()
  324. File "C:\a_tech\DeepAdmin\DocAnalysis\venv\lib\site-packages\flask\app.py", line 1935, in dispatch_request
  325. return self.view_functions[rule.endpoint](**req.view_args)
  326. File "C:\a_tech\DeepAdmin\DocAnalysis\web_service.py", line 10, in analysis
  327. return vision_analysis.analysis(path_doc)
  328. File "C:\a_tech\DeepAdmin\DocAnalysis\vision_analysis.py", line 348, in analysis
  329. if image_path.split('/')[-1].split('.')[1] == 'pdf' :
  330. IndexError: list index out of range
  331.  
  332. -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement