Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upcoming Cython 3.1 str <-> bytes errors #1451

Closed
greglucas opened this issue Oct 9, 2024 · 1 comment · Fixed by #1452
Closed

Upcoming Cython 3.1 str <-> bytes errors #1451

greglucas opened this issue Oct 9, 2024 · 1 comment · Fixed by #1452
Labels

Comments

@greglucas
Copy link
Contributor

Building with the latest Cython nightly wheel causes errors with strings that are expected to be bytes and vice-versa. I'm not sure if this is due to an implicit cast that was removed somewhere or something else. My guess is this may be related to: cython/cython#6374

pip install --upgrade --pre --only-binary :all: -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy
pip install .
python -m pytest

Problem description

____________________________________________________ ERROR collecting test/crs/test_crs.py ____________________________________________________
test/crs/test_crs.py:1670: in <module>
    CRS("EPSG:4979"),  # native 3D
pyproj/crs/crs.py:350: in __init__
    self._local.crs = _CRS(self.srs)
pyproj/_crs.pyx:2355: in pyproj._crs._CRS.__init__
    def __init__(self, const char *proj_string):
E   TypeError: expected bytes, str found
__________________________________________________ ERROR collecting test/test_datum_shift.py __________________________________________________
test/test_datum_shift.py:30: in <module>
    WGS84_PROJ = Proj(proj="latlong", datum="WGS84")
pyproj/proj.py:110: in __init__
    self.crs = CRS.from_user_input(projparams, **kwargs)
pyproj/crs/crs.py:503: in from_user_input
    return cls(value, **kwargs)
pyproj/crs/crs.py:350: in __init__
    self._local.crs = _CRS(self.srs)
pyproj/_crs.pyx:2355: in pyproj._crs._CRS.__init__
    def __init__(self, const char *proj_string):
E   TypeError: expected bytes, str found

Expected Output

No TypeErrors

Installation method

from source

@greglucas greglucas added the bug label Oct 9, 2024
@snowman2
Copy link
Member

snowman2 commented Oct 9, 2024

Thanks for the report. Probably just need to wrap it in the cstrencode function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants