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

Include of external C code broken: add_include_file in unfinished #2736

drgrandios opened this issue Nov 27, 2018 · 1 comment


Copy link

I use a statement similar to

cdef extern from "myfile.c":
      void myfunction(unsigned char arr[], unsigned char result[]) 

in my .pyx file.

This works fine in Cygwin (cython/cython3 0.25) but fails in Windows (cython 0.29) with a Type Error:

File "C:\Python37\lib\site-packages\Cython\Compiler\", line 499, in analyse_declarations
  env.add_include_file(self.include_file, self.verbatim_include, late)
TypeError: add_include_file() takes 2 positional arguments but 4 were given

The reason seems to be that in Compiler/, the signature of ModuleScope::add_include_file has been enhanced to 4 arguments:

def add_include_file(self, filename, verbatim_include=None, late=False):

Unfortunately, Scope::add_include_file has not been adapted properly:
def add_include_file(self, filename):

As soon as I modify Scope::add_include_file to just forward the new arguments, everything is working again.

@scoder scoder closed this as completed in bcf92f4 Nov 30, 2018
Copy link

Very nice, thank you.

@scoder scoder added the defect label Nov 30, 2018
@scoder scoder added this to the 0.29.2 milestone Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants