indygreg / indygreg/python-zstandard

zstandard.MAGIC_NUMBER returns wrong value on Windows

Open
#202 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
642
Forks
116
Avg merge
1d 14h
Merged PRs (30d)
5

Description

I encountered the following problem.

Linux environment

Python 3.11.3
zstandard 0.21.0

>>> import zstandard
>>> hex(zstandard.MAGIC_NUMBER)
'0xfd2fb528'
Win10 environment

Python 3.9.16
zstandard 0.21.0

>>> import zstandard
>>> hex(zstandard.MAGIC_NUMBER)
'-0x2d04ad8'

It seems to be a OS specific difference not related to the Python version. Why is there a difference?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the zstandard.MAGIC_NUMBER entry point and reproduce the reported values on Windows and Linux using the stated Python and zstandard versions. Inspect how the constant is defined and exposed, then verify that its value has consistent signedness across platforms; done means the constant reports the expected magic number on both systems.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.