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

3.0.0b1 generates misnamed PyMemoryview_Check function call #5270

Closed
totaam opened this issue Feb 27, 2023 · 1 comment · Fixed by #5271
Closed

3.0.0b1 generates misnamed PyMemoryview_Check function call #5270

totaam opened this issue Feb 27, 2023 · 1 comment · Fixed by #5271

Comments

@totaam
Copy link

totaam commented Feb 27, 2023

Describe the bug

Compilation error:

error: implicit declaration of function ‘PyMemoryview_Check’; did you mean ‘PyMemoryView_Check’? [-Werror=implicit-function-declaration]
32216 |   __pyx_t_1 = PyMemoryview_Check(__pyx_v_pixels);
      |               ^~~~~~~~~~~~~~~~~~
      |               PyMemoryView_Check

As gcc suggests, the correct function spelling is PyMemoryView_Check with an uppercase V.
Manually editing the .c file allows the compilation to succeed.

Code to reproduce the behaviour:

  /* "xpra/codecs/nvidia/nvenc/encoder.pyx":2436
 *         if isinstance(pixels, (bytearray, bytes)):
 *             pixels = memoryview(pixels)
 *         if isinstance(pixels, memoryview):             # <<<<<<<<<<<<<<
 *             #copy memoryview to inputBuffer directly:
 *             buf = self.inputBuffer
 */
  __pyx_t_1 = PyMemoryview_Check(__pyx_v_pixels); 
  if (__pyx_t_1) {

Expected behaviour

Compilation should succeed, it did with 3.0.0a11 so this is a recent regression.

Environment

Reproducible on many different Linux distros.

Additional context

No response

@da-woods
Copy link
Contributor

Thanks. MemoryViews are now a "known" builtin type in Cython so they're handled slightly differently.

Just working on fixing this (and another memoryview issue). Should be pretty easy

@da-woods da-woods added this to the 3.0 milestone Feb 28, 2023
scoder pushed a commit that referenced this issue Mar 1, 2023
Error in capitalization.
Closes #5270 

Context managers were being optimized into a non-working state when involving a CloneNode.
Closes #5268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants