# Amending PEP 427 (and PEP 625) on package normalization rules

**URL:** <https://discuss.python.org/t/amending-pep-427-and-pep-625-on-package-normalization-rules/17226>\
**Category:** Packaging\
**Created:** [July 8, 2022, 10:52pm UTC](https://discuss.python.org/t/amending-pep-427-and-pep-625-on-package-normalization-rules/17226 "2022-07-08T22:52:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![dstufft](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/dstufft/32/23_2.png) [@dstufft](https://discuss.python.org/u/dstufft)\
**Post date:** [July 8, 2022, 11:28pm UTC](https://discuss.python.org/t/amending-pep-427-and-pep-625-on-package-normalization-rules/17226/2 "2022-07-08T23:28:07Z")

</div>

I chatted with @bernatgabor on Discord, and just to be clear, the desire here is to fix PEP 427, because the text says:

> Each component of the filename is escaped by replacing runs of non-alphanumeric characters with an underscore `_` :

but the code in the PEP says

```python
re.sub("[^\w\d.]+", "_", distribution, re.UNICODE)

```

Which is how everyone implements it (and implementing it as the text says would turn `1.0` into `1-0` or `py2.py3` into `py2_py3`, so it’s the only logical way for it to work).

The part about PEP 503 is actually asking for PEP 625 to _not_ reference PEP 503, and just reference PEP 427 escaping rules.

---

_[View the full topic](https://discuss.python.org/t/amending-pep-427-and-pep-625-on-package-normalization-rules/17226)._
