Skip to content

Uppercase characters in pypi packages names are not allowed for upload  #21014

Closed
@gd197

Description

@gd197

Description

Python packages with a character in uppercase cannot be uploaded in package registry.
eg : Pygments-2.13.0-py3-none-any.whl from pypi.org
or
PyQt5_Qt5-5.15.2-py3-none-manylinux2014_x86_64.whl from pypi.org
lead to :
2022/09/01 08:57:24 ...ackages/pypi/pypi.go:34:func1() [T] [631057d4] plainTextInternal (status=400): invalid name or version
By changing the wheel file name and the name entry in METADATA file of the package by lowercase solve the issue.
could be related to :
routers/api/packages/pypi/pypi.go
var nameMatcher = regexp.MustCompile('\A[a-z0-9\.\-_]+\z')
sorry for not being in a situation currently to provide a correct (and tested) pull request but I'll work on it in the future

Gitea Version

1.17.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.27.0

Operating System

RHEL8.5

How are you running Gitea?

official github 1.17.1 delivery

Database

MySQL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions