Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 676
    • Issues 676
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • 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
  • pypypypy
  • Issues
  • #3686
Closed
Open
Issue created Feb 22, 2022 by Marius Gedminas@mgedmin

os.statvfs_result constructor incompatible with CPython (TypeError: expected a sequence with exactly 11 items. has 10)

This code works on CPython, but fails on PyPy3 7.3.8:

$ python3.7 -c 'import os; os.statvfs_result((4096, 4096, 20971520, 17750785, 17750785, 1600000, 1275269, 1275269, 4096, 255))'

$ python3.8 -c 'import os; os.statvfs_result((4096, 4096, 20971520, 17750785, 17750785, 1600000, 1275269, 1275269, 4096, 255))'

$ python3.9 -c 'import os; os.statvfs_result((4096, 4096, 20971520, 17750785, 17750785, 1600000, 1275269, 1275269, 4096, 255))'

$ pypy3.7 -c 'import os; os.statvfs_result((4096, 4096, 20971520, 17750785, 17750785, 1600000, 1275269, 1275269, 4096, 255))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<builtin>/frozen _structseq", line 97, in structseq_new
TypeError: expected a sequence with exactly 11 items. has 10

$ pypy3.8 -c 'import os; os.statvfs_result((4096, 4096, 20971520, 17750785, 17750785, 1600000, 1275269, 1275269, 4096, 255))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "<builtin>/frozen _structseq", line 97, in structseq_new
TypeError: expected a sequence with exactly 11 items. has 10

$ pypy3.9 -c 'import os; os.statvfs_result((4096, 4096, 20971520, 17750785, 17750785, 1600000, 1275269, 1275269, 4096, 255))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: expected a sequence with exactly 11 items. has 10

Context: I'm using os.statvfs_result in a test-suite to monkey-patch os.statvfs(). This worked with some previous PyPy3 version, and it still works with pypy2.7 7.3.8

$ pypy3.7 --version
Python 3.7.12 (c8af402943f0c6c9155c76a45e3b64103783aacf, Feb 18 2022, 12:25:20)
[PyPy 7.3.8 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

$ pypy3.8 --version
Python 3.8.12 (d00b0afd2a5dd3c13fcda75d738262c864c62fa7, Feb 18 2022, 09:52:33)
[PyPy 7.3.8 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

$ pypy3.9 --version
Python 3.9.10 (8276b505180f70c5784a698a510f0a17317a85c3, Feb 19 2022, 16:50:47)
[PyPy 7.3.8 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

$ pypy2.7 --version
Python 2.7.18 (6862351a1edb17bf92c05d0f2c573ca7f9b40726, Feb 18 2022, 13:29:02)
[PyPy 7.3.8 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)]

I've checked the various PyPy3 versions I still have lying around in my ~/opt/, and this code worked fine with pypy3.7-v7.3.5-linux64, but started raising the TypeError with pypy3.7-v7.3.6-linux64.

Edited Feb 22, 2022 by Marius Gedminas
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking