This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author probinso
Recipients ezio.melotti, mrabarnett, probinso
Date 2021-02-14.08:17:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613290630.55.0.329403737317.issue43222@roundup.psfhosted.org>
In-reply-to
Content
I am receiving an unexpected behavior in using regular expressions for splitting a string. It seems like this error exists in `python 3.6` but not `python 2.7` and not `python 3.7+`. Below I have described a minimal example with `tox`.

`setup.py`
```
from setuptools import setup
setup(
    name='my-tox-tested-package',
    version='0.0.1',
    install_requires=["pytest"]
)
```

`tests/test_re.py`
```
import re
import pytest

_DIGIT_BOUNDARY_RE = re.compile(
    r'(?<=\D)(?=\d)|(?<=\d)(?=\D)'
)

def test():
    _DIGIT_BOUNDARY_RE.split("10.0.0")
```

`tox.ini`
```
[tox]
envlist = py27, py36, py37
requires=
  pytest

[testenv]
commands =
    pytest {posargs: tests}
```
```
============================================= FAILURES ================================
_____________________________________________ test ____________________________________

    def test():
>       _DIGIT_BOUNDARY_RE.split("10.0.0")
E       ValueError: split() requires a non-empty pattern match.

tests/test_god.py:9: ValueError
============================================ short test summary info ==================
...

============================================ test session starts ======================
platform linux -- Python 3.7.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/probinson/code
collected 1 item

tests/test_re.py .                                                                [100%]

============================================ 1 passed in 0.00s =========================
____________________________________________ summary ___________________________________
  py27: commands succeeded
ERROR:   py36: commands failed
  py37: commands succeeded

```
History
Date User Action Args
2021-02-14 08:17:10probinsosetrecipients: + probinso, ezio.melotti, mrabarnett
2021-02-14 08:17:10probinsosetmessageid: <1613290630.55.0.329403737317.issue43222@roundup.psfhosted.org>
2021-02-14 08:17:10probinsolinkissue43222 messages
2021-02-14 08:17:10probinsocreate