Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pickletools Default Encoding #126997

Closed
Closed
Assignees
serhiy-storchaka
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error
@Legoclones

Description

@Legoclones

Bug report

Bug description:

When unpickling using_pickle.c orpickle.py throughload/loads, an encoding can be specified using theencoding argument, with the default being ASCII. However, pickletools does not support custom encodings and instead makes assumptions about what encoding it uses, which can lead to either incorrect data being displayed or erroring/not erroring when the normal unpickling process would error.

The three opcodes that I have found this in areSTRING,BINSTRING, andSHORT_BINSTRING:

  • Online 359, it assumes ASCII forSTRING
  • Online 456, it assumeslatin-1 forBINSTRING
  • Online 422, it assumeslatin-1 forSHORT_BINSTRING

I think the best solution would be to support encodings as an optional argument inpickletools.py, with the default being set to ASCII (since that's the default encoding forpickle.py and_pickle.c).

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp