Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. JSONDecoderError during run empty pyproject
Forum Updated to NodeBB v4.3 + New Features

JSONDecoderError during run empty pyproject

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 297 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kamichanw
    wrote on last edited by
    #1

    I created an empty Qt Quick Application on Qt 6.5.2, then I edit .pyproject as follows:

    {
        "files": [
            "main.py",
            "main.qml"
        ],
        "qmlImportPath": [
            "path/to/my/qml/directory"
        ]
    }
    

    An exception occurred:

    Traceback (most recent call last):
      File "C:\Users\ASUS\Documents\Qt Project\untitled\venv\Lib\site-packages\PySide6\scripts\project.py", line 240, in <module>
        project = Project(project_file)
                  ^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\Documents\Qt Project\untitled\venv\Lib\site-packages\PySide6\scripts\project.py", line 58, in __init__
        self.project = ProjectData(project_file=project_file)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\Documents\Qt Project\untitled\venv\Lib\site-packages\PySide6\scripts\project\project_data.py", line 30, in __init__
        pyproject = json.load(pyf)
                    ^^^^^^^^^^^^^^
      File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\__init__.py", line 293, in load
        return loads(fp.read(),
               ^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\__init__.py", line 346, in loads
        return _default_decoder.decode(s)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\decoder.py", line 337, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\decoder.py", line 355, in raw_decode
        raise JSONDecodeError("Expecting value", s, err.value) from None
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    

    And when I use Ctrl+z undo what I haved editted, the exception is still consistent.

    F 1 Reply Last reply
    0
    • K Kamichanw

      I created an empty Qt Quick Application on Qt 6.5.2, then I edit .pyproject as follows:

      {
          "files": [
              "main.py",
              "main.qml"
          ],
          "qmlImportPath": [
              "path/to/my/qml/directory"
          ]
      }
      

      An exception occurred:

      Traceback (most recent call last):
        File "C:\Users\ASUS\Documents\Qt Project\untitled\venv\Lib\site-packages\PySide6\scripts\project.py", line 240, in <module>
          project = Project(project_file)
                    ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ASUS\Documents\Qt Project\untitled\venv\Lib\site-packages\PySide6\scripts\project.py", line 58, in __init__
          self.project = ProjectData(project_file=project_file)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ASUS\Documents\Qt Project\untitled\venv\Lib\site-packages\PySide6\scripts\project\project_data.py", line 30, in __init__
          pyproject = json.load(pyf)
                      ^^^^^^^^^^^^^^
        File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\__init__.py", line 293, in load
          return loads(fp.read(),
                 ^^^^^^^^^^^^^^^^
        File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\__init__.py", line 346, in loads
          return _default_decoder.decode(s)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\decoder.py", line 337, in decode
          obj, end = self.raw_decode(s, idx=_w(s, 0).end())
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ASUS\anaconda3\envs\ml\Lib\json\decoder.py", line 355, in raw_decode
          raise JSONDecodeError("Expecting value", s, err.value) from None
      json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
      

      And when I use Ctrl+z undo what I haved editted, the exception is still consistent.

      F Offline
      F Offline
      friedemannkleint
      wrote on last edited by
      #2

      Have you checked the file; was maybe an UTF8-BOM added or sth similarly weird?

      K 1 Reply Last reply
      2
      • F friedemannkleint

        Have you checked the file; was maybe an UTF8-BOM added or sth similarly weird?

        K Offline
        K Offline
        Kamichanw
        wrote on last edited by
        #3

        @friedemannkleint said in JSONDecoderError during run empty pyproject:

        Have you checked the file; was maybe an UTF8-BOM added or sth similarly weird?

        Yes, BOM caused such a disaster

        1 Reply Last reply
        0
        • K Kamichanw marked this topic as a regular topic on
        • K Kamichanw marked this topic as a question on
        • K Kamichanw has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved