Skip to content

Unable to parse package informations containing \n--- #173

@legau

Description

@legau

Hi, I encountered an unfortunate bug when using scip-python index

(12:25:35) Evaluating python environment dependencies
(12:25:35)   Gathering environment information from `pip`
(12:25:40)   Analyzing dependencies
Experienced Fatal Error While Indexing:
Please create an issue at github.com/sourcegraph/scip-python: Unexpected. Thought I should be getting files now

With a bit of investigation it seems that the pip informations are split with this piece of code
However some packages may contain \n--- such as pytest-django with its license file

Name: pytest-django
Version: 4.11.1
Summary: A Django plugin for pytest.
Home-page: 
Author: 
Author-email: Andreas Pelme <andreas@pelme.se>
License: pytest-django is released under the BSD (3-clause) license
----------------------------------------------------------
Copyright (c) 2015-2018, pytest-django authors (see AUTHORS file)
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 * The names of its contributors may not be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


This version of pytest-django is a fork of pytest_django created by Ben Firshman.
---------------------------------------------------------------------------------
Copyright (c) 2009, Ben Firshman
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
 * The names of its contributors may not be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Location: /home/leni/.cache/pypoetry/virtualenvs/test-infra-back-lSRTar0T-py3.12/lib/python3.12/site-packages
Requires: pytest
Required-by: 
Files:
  pytest_django-4.11.1.dist-info/INSTALLER
  pytest_django-4.11.1.dist-info/METADATA
  pytest_django-4.11.1.dist-info/RECORD
  pytest_django-4.11.1.dist-info/WHEEL
  pytest_django-4.11.1.dist-info/entry_points.txt
  pytest_django-4.11.1.dist-info/licenses/AUTHORS
  pytest_django-4.11.1.dist-info/licenses/LICENSE
  pytest_django-4.11.1.dist-info/top_level.txt
  pytest_django/__init__.py
  pytest_django/_version.py
  pytest_django/asserts.py
  pytest_django/django_compat.py
  pytest_django/fixtures.py
  pytest_django/lazy_django.py
  pytest_django/live_server_helper.py
  pytest_django/plugin.py
  pytest_django/py.typed
  pytest_django/runner.py

As a workaround for now I have to uninstall the package from the virtualenv running the command

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions