Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Merge requests 144
    • Merge requests 144
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !2145

Merged
Created Aug 14, 2025 by Xiaowu Zhang@xiaowu.zhangDeveloper

load bytes objects directly as bytes

  • Overview 35
  • Commits 12
  • Changes 11

While upgrade instance from python2 to python3, i found when read old BigFile object such as Data Stream, it raise error below

  Module erp5.component.document.erp5_version.BigFile, line 105, in getData
    return btree.read(0, len(btree))
  Module erp5.component.module.erp5_version.BTreeData, line 182, in read
    return b''.join(self.iterate(offset, size))
TypeError: sequence item 0: expected a bytes-like object, str found

It's because the old data created when in python2 is firstly loaded as string

but for PersistentString, we're sure that it's bytes, let's load directly as bytes to avoid useless conversion.

in this MR, we also clean some codes

Related MR: erp5-bin!12 (merged)

Edited Oct 02, 2025 by Xiaowu Zhang
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix/mix_data
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7