[Commented On] D10770: docket: make compatible with py3.6, where Struct.format is bytes

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri May 28 13:34:21 UTC 2021


martinvonz added a comment.
martinvonz abandoned this revision.


  In D10770#164629 <https://phab.mercurial-scm.org/D10770#164629>, @marmoute wrote:
  
  > In D10770#164628 <https://phab.mercurial-scm.org/D10770#164628>, @martinvonz wrote:
  >
  >> In D10770#164626 <https://phab.mercurial-scm.org/D10770#164626>, @marmoute wrote:
  >>
  >>> Looks like this is happening because of an inconsistency betwen the fact we passe a binary 'struct' for INDEX_HEADER and a sysstr for the extra once. I would rather fix this by making them consistent.
  >>
  >> I'm not sure I understand. Can you show me how?
  >>
  >>   $ python3.6 -c 'import struct; print(type(struct.Struct(b"I").format))'
  >>   <class 'bytes'>
  >>   $ python3.6 -c 'import struct; print(type(struct.Struct("I").format))'
  >>   <class 'bytes'>
  >>   $ python3.7 -c 'import struct; print(type(struct.Struct(b"I").format))'
  >>   <class 'str'>
  >>   $ python3.7 -c 'import struct; print(type(struct.Struct("I").format))'
  >>   <class 'str'>
  >
  > Okay, so my assertion is correct and Python behavior is… creative. Maybe we should build a pycompat wrapper for struct.format access ?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10770/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10770

To: martinvonz, #hg-reviewers, marmoute
Cc: marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210528/e2bc28c8/attachment-0002.html>


More information about the Mercurial-patches mailing list