On 12/16/2010 06:37 PM, Dag Sverre Seljebotn wrote: > On 12/16/2010 05:56 PM, Lisandro Dalcin wrote: > >> On 16 December 2010 02:03, Stefan Behnel<stefan...@behnel.de> wrote: >> >> >>> Lisandro Dalcin, 15.12.2010 20:38: >>> >>> >>>> On 15 December 2010 09:02, Arfrever Frehtes Taifersar Arahesis >>>> >>>> >>>>> ====================================================================== >>>>> ERROR: compiling (c) and running numpy_bufacc_T155 >>>>> ---------------------------------------------------------------------- >>>>> FAILED (errors=11) >>>>> >>>>> === Got errors: === >>>>> 10:9: 'ndarray' is not a type identifier >>>>> 173:49: "mode" is not a buffer option >>>>> >>>>> >>>> The problem here is that the dictionary keywords of >>>> __cythonbufferdefaults__ are parsed as BytesLiteral, there is code >>>> with "if not mode in buffer_options" at Buffer.py that fails because >>>> "mode" is 'bytes' and "buffer_options" do have 'str' keys... >>>> >>>> Stefan, could you take a look at this? >>>> >>>> >>> Yes, I know. IIRC, NumPy 1.4 *requires* bytes values here, though. >>> >>> >> Sorry, what do you mean? >> >> > __cythonbufferdefaults__ have no dependency on NumPy > (tests/run/bufaccess.pyx exercises it without NumPy). It's purely used > as a mechanism to get settings from an arbitrary pxd file to > Cython/Compiler/Buffer.py (as a way of getting "custom syntax" through > without having to modify the parser). >
To be clear: The if-tests in Buffer.py is the *only* place where __cythonbufferdefaults__ is used. So just turning any BytesLiteral's into unicode by brute force/ASCII decoding should work well. Probably one should handle both BytesLiteral and UnicodeLiteral and convert them both to str. Dag Sverre _______________________________________________ Cython-dev mailing list Cython-dev@codespeak.net http://codespeak.net/mailman/listinfo/cython-dev