Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

IndexError in utbot_mypy_runner #2017

Open
Assignees
Labels
ctg-bugIssue is a bug lang-pythonIssue is related to python support
@tamarinvs19

Description

Description

Error message from utbot_mypy_runner

To Reproduce

Steps to reproduce the behavior:

Example:

  1. Download project pylint
  2. Open file pylint/checkers/variables.py
  3. Try to generate tests for the function _is_from_future_import

Expected behavior

Tests are supposed to be generated.

Actual behavior

Error from utbot_mypy_runner in logs

Visual proofs (screenshots, logs, images)

Log
java.lang.IllegalStateException: Something went wrong in initial mypy run. 
Python stderr Traceback (most recent call last):
 File "C:\Users\tWX1238545\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
 return _run_code(code, main_globals, None,
 File "C:\Users\tWX1238545\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
 exec(code, run_globals)
 File "C:\Users\tWX1238545\IdeaProjects\pylint\venv\lib\site-packages\utbot_mypy_runner\__main__.py", line 50, in 
 file.write(extraction.get_result_from_mypy_build(build_result, sources, args.module_for_types, args.indent))
 File "C:\Users\tWX1238545\IdeaProjects\pylint\venv\lib\site-packages\utbot_mypy_runner\extract_annotations.py", line 98, in get_result_from_mypy_build
 traverser.visit_mypy_file(build_result.files[module_for_types])
 File "mypy\traverser.py", line 114, in visit_mypy_file
 File "mypy\nodes.py", line 1133, in accept
 File "mypy\traverser.py", line 150, in visit_class_def
 File "mypy\nodes.py", line 1214, in accept
 File "mypy\traverser.py", line 118, in visit_block
 File "mypy\nodes.py", line 794, in accept
 File "mypy\traverser.py", line 133, in visit_func_def
 File "mypy\traverser.py", line 130, in visit_func
 File "mypy\nodes.py", line 1214, in accept
 File "mypy\traverser.py", line 118, in visit_block
 File "mypy\nodes.py", line 1410, in accept
 File "mypy\traverser.py", line 187, in visit_return_stmt
 File "mypy\nodes.py", line 1891, in accept
 File "mypy\traverser.py", line 257, in visit_call_expr
 File "mypy\nodes.py", line 2214, in accept
 File "mypy\traverser.py", line 303, in visit_list_expr
 File "mypy\nodes.py", line 1891, in accept
 File "mypy\traverser.py", line 257, in visit_call_expr
 File "mypy\nodes.py", line 1793, in accept
 File "C:\Users\tWX1238545\IdeaProjects\pylint\venv\lib\site-packages\utbot_mypy_runner\expression_traverser.py", line 19, in visit_name_expr
 self.process_expression(o)
 File "C:\Users\tWX1238545\IdeaProjects\pylint\venv\lib\site-packages\utbot_mypy_runner\expression_traverser.py", line 16, in process_expression
 self.processor(o.line, o.column, o.end_line, o.end_column, self.types[o])
 File "C:\Users\tWX1238545\IdeaProjects\pylint\venv\lib\site-packages\utbot_mypy_runner\extract_annotations.py", line 95, in 
 ExpressionType(*get_borders(line, col, end_line, end_col, content), line, get_annotation(type_, Meta(module_for_types)))
 File "C:\Users\tWX1238545\IdeaProjects\pylint\venv\lib\site-packages\utbot_mypy_runner\utils.py", line 13, in get_borders
 while bad_symbol(file_content[end_line - 1][end_column - 1]):
IndexError: string index out of range
Mypy stderr: 
	at org.utbot.python.newtyping.mypy.RunMypyKt.readMypyAnnotationStorageAndInitialErrors(RunMypy.kt:52)
	at org.utbot.python.PythonTestGenerationProcessor.processTestGeneration(PythonTestGenerationProcessor.kt:83)
	at org.utbot.python.PythonTestGenerationProcessor.processTestGeneration$default(PythonTestGenerationProcessor.kt:38)
	at org.utbot.intellij.plugin.language.python.PythonDialogProcessor$createTests1ドル.run(PythonDialogProcessor.kt:173)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously6ドル(CoreProgressManager.java:480)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit3ドル(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess2ドル(CoreProgressManager.java:186)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress13ドル(CoreProgressManager.java:604)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit4ドル(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory1ドル1ドル.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory1ドル1ドル.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory1ドル.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

Environment

UnitTestBot version: from pr #2010
OS; Winows10

Metadata

Metadata

Labels

ctg-bugIssue is a bug lang-pythonIssue is related to python support

Type

No type

Projects

Status

Todo

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /