question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Numpy does not recognize 'c' as PEP 3118 buffer format string

See original GitHub issue

One way to demonstrate the bug without writing a C extension is

>>> np.core._internal._dtype_from_pep3118('c')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "numpy/core/_internal.py", line 446, in _dtype_from_pep3118
    raise ValueError("Unknown PEP 3118 data type specifier %r" % spec)
ValueError: Unknown PEP 3118 data type specifier 'c'

http://legacy.python.org/dev/peps/pep-3118/#additions-to-the-struct-string-syntax

http://docs.python.org/2/library/struct.html#format-characters

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
eric-wiesercommented, Mar 25, 2018

No super easy way. What I did was look at the blame of the file in question on GitHub. I knew what the fix would look like, so found the relevant like, and clicked on the commit sha1 that blame shows beside it. When looking at a commit, GitHub shows the PR it was part of, which is how I found that number.

0reactions
stephaniemdaviscommented, Mar 25, 2018

@eric-wieser Again, I thank you for this information. It sounds as if I could also do some tracing through the Pull Request meta data and find it that way. You’ve put me on to learning something else new within github: tracing changes… This is fun; hope to see you again as I go along on my journey. I take it you’re active on the numpy project…

Read more comments on GitHub >

github_iconTop Results From Across the Web

PEP 3118 warning when using ctypes array as numpy array
It's a bug in Python. ctypes currently produces invalid PEP 3118 type codes ... is present, Numpy skips using the PEP 3118 buffer...
Read more >
[BUG] numpy implements PEP-3118 incorrectly #9456 - GitHub
PEP 3118 describes Buffers protocol to implement data interchange between different Python/C objects. I'm implementing such an object, ...
Read more >
PEP 3118 – Revising the buffer protocol
This function returns 0 on success and -1 on failure (and raises an error). The first variable is the “exporting” object.
Read more >
The array interface protocol — NumPy v1.25.dev0 Manual
This page describes the NumPy-specific API for accessing the contents of a NumPy array from other C extensions. PEP 3118 – The Revised...
Read more >
2.2. Advanced NumPy - Scipy Lecture Notes
Recently added features, and what's in them: PEP 3118 buffers, ... x is a string (in Python 3 a bytes), we can represent...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found