Skip to content

b''.hex() == '' #18807

Description

@GanerCodes

Port, board and/or hardware

esp32

MicroPython version

MicroPython v1.28.0-preview.173.g97219553ed.dirty on 2026-02-11; ESP32 LightWave with ESP32LW

(99.99% sure master has this issue)

Reproduction

b''.hex()

Expected behaviour

''

Observed behaviour

b''

Additional Information

No response

Code of Conduct

Yes, I agree

Activity

  1. Josverl commented on Feb 11, 2026

    @Josverl
    SponsorContributor

    actually this reproduces on v1.27.0

    # Windows standard
    MicroPython v1.27.0 on 2025-12-18; win32 [GCC 12.0.0] version
    Type "help()" for more information.
    >>> b''.hex()
    b''
    
    # unix standard 
    MicroPython v1.27.0 on 2025-12-18; linux [GCC 12.4.0] version
    Type "help()" for more information.
    >>> b''.hex()
    b''

    But that is indeed different from CPython

    Python 3.11.9 (main, Aug 14 2024, 04:18:20) [MSC v.1929 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> b''.hex()
    ''
  2. dpgeorge commented on Feb 12, 2026

    @dpgeorge
    Member

    Thanks for the report. PR #18808 fixes this issue.

  3. dpgeorge commented on Mar 4, 2026

    @dpgeorge
    Member

    Fixed by 06bfefe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions