Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • cffi cffi
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 74
    • Issues 74
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

April 05-07 - Mercurial Paris Conference 2023 - One day of workshop dedicated to Heptapod and Mercurial usage and workflow. There are still places available for both workshops and talks!

  • PyPyPyPy
  • cfficffi
  • Issues
  • #203
Closed
Open
Issue created Jun 01, 2015 by Bitbucket Importer@bitbucket_importerMaintainer

Can't pass size as keyward arg to ffi.buffer for compiled ffi

Created originally on Bitbucket by flacjacket (Sean Vig)

Using a compiled ffi, ffi.buffer() complains when trying to pass size as a kwarg. For a minimal example, compile:

import cffi

ffi = cffi.FFI()
ffi.set_source('_ffi', None)

if __name__ == '__main__':
    ffi.compile()

Then:

In [1]: from _ffi import ffi

In [2]: ffi.buffer(ffi.NULL, 8)
Out[2]: <_cffi_backend.buffer at 0x7f200574c480>

In [3]: ffi.buffer(ffi.NULL, size=8)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-82a246219aa5> in <module>()
----> 1 ffi.buffer(ffi.NULL, size=8)

TypeError: buffer() takes no keyword arguments

This also fails for API-based compiled ffi objects.

Where as if we import the un-compiled ffi from the file, it is fine:

In [4]: from ffi_build import ffi

In [5]: ffi.buffer(ffi.NULL, size=8)
Out[5]: <_cffi_backend.buffer at 0x7f20042cf5a0>

This isn't a big deal, it can just be passed as a non-keyword arg, but it may break things when switching to compiled ffi objects.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking