Skip to content

error when runing mypy in win10 with pythin files #16046

@akbzam

Description

@akbzam

Bug Report

(A clear and concise description of what the bug is.)

To Reproduce

# Ideally, a small sample program that demonstrates the problem.
# Or even better, a reproducible playground link https://mypy-play.net/ (use the "Gist" button)

Expected Behavior

Actual Behavior

Your Environment

  • Mypy version used:
  • Mypy command-line flags:
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used:

hi
I use window 10 on my PC and Python 3.11.3
I saved my python files in D:\14020412_enteghal\akb_python\akb_py_projects
I wanted to use mypy with Python files. it took 3 days of my time and I had many arguement in https://python-forum.io/thread-40660-page-2.html

I wanted to run mypy by example1.py file but I could not. in the message that cmd was shown to me, it said that I report this bug, so I write here.
I must say if I create an env and then use mypy is okay.
below is what I saw in cmd:
Microsoft Windows [Version 10.0.19045.3324]
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd/d D:\14020412_enteghal\akb_python\akb_py_projects

D:\14020412_enteghal\akb_python\akb_py_projects>mypy example1.py --show-traceback
D:\14020412_enteghal\akb_python\akb_py_projects_init_.py: error: INTERNAL ERROR -- Please try us
tHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.5.1
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\akbar\AppData\Local\Programs\Python\Python311\Scripts\mypy.exe_main
.py", line
sys.exit(console_entry())
File "mypy\build.py", line 2069, in wrap_context
File "mypy\build.py", line 2176, in parse_file
File "mypy\build.py", line 841, in parse_file
File "mypy\parse.py", line 22, in parse
File "mypy\fastparse.py", line 219, in parse
File "mypy\fastparse.py", line 134, in ast3_parse
File "C:\Users\akbar\AppData\Local\Programs\Python\Python311\Lib\ast.py", line 50, in parse
return compile(source, filename, mode, flags,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: source code string cannot contain null bytes
D:\14020412_enteghal\akb_python\akb_py_projects_init
.py: : note: use --pdb to drop into pdb

D:\14020412_enteghal\akb_python\akb_py_projects>python
Python 3.11.3 (tags/v3.11.3:f3909b8, Apr 4 2023, 23:49:59) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions