Skip to content

PyUnicode_FromFormat broken and not documented for 2.x #51823

Closed

Description

@ronaldoussoren
BPO 7574
Nosy @malemburg, @birkenfeld, @ronaldoussoren, @abalkin, @vstinner, @ezio-melotti
Superseder
  • bpo-7330: PyUnicode_FromFormat: implement width and precision for %s, %S, %R, %V, %U, %A
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/malemburg'
    closed_at = <Date 2014-09-30.22:15:25.520>
    created_at = <Date 2009-12-24.11:54:39.619>
    labels = ['interpreter-core', 'expert-unicode', 'type-crash', 'docs']
    title = 'PyUnicode_FromFormat broken and not documented for 2.x'
    updated_at = <Date 2014-09-30.22:15:25.518>
    user = 'https://github.com/ronaldoussoren'

    bugs.python.org fields:

    activity = <Date 2014-09-30.22:15:25.518>
    actor = 'vstinner'
    assignee = 'lemburg'
    closed = True
    closed_date = <Date 2014-09-30.22:15:25.520>
    closer = 'vstinner'
    components = ['Documentation', 'Interpreter Core', 'Unicode']
    creation = <Date 2009-12-24.11:54:39.619>
    creator = 'ronaldoussoren'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 7574
    keywords = []
    message_count = 5.0
    messages = ['96853', '112993', '127685', '228004', '228013']
    nosy_count = 8.0
    nosy_names = ['lemburg', 'georg.brandl', 'ronaldoussoren', 'belopolsky', 'vstinner', 'ezio.melotti', 'ysj.ray', 'BreamoreBoy']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '7330'
    type = 'crash'
    url = 'https://bugs.python.org/issue7574'
    versions = ['Python 2.6', 'Python 2.7']

    Activity

    1. ronaldoussoren commented on Dec 24, 2009

      @ronaldoussoren
      ContributorAuthor

      Include/unicodeobject.h includes prototypes for PyUnicode_FromFormat and
      PyUnicode_FromFormatV in both 2.6 and 2.7, but those functions are not
      included in the documention.

      And worse, the implementation contains bugs: the %R format code tries to
      include the repr() of an object and blindly assumes that the result of
      PyObject_Repr is a unicode string. In the 2.x tree PyObject_Repr usually
      (but not allways) returns a regular string (str instead of unicode).

      The same problem is present in the implementation of %S.

      For the %U and %V formats the code does typechecking in an assert
      statement rather than always testing and bailing out using a NULL result
      from the function.

    2. added
      interpreter-core(Objects, Python, Grammar, and Parser dirs)
      docsDocumentation in the Doc dir
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Dec 24, 2009
    3. ysjray commented on Aug 5, 2010

      ysjraymannequin
      Mannequin

      It seems there is pretty much problems in PyUnicode_FromFormatV().
      see bpo-7330.

    4. abalkin commented on Feb 1, 2011

      @abalkin
      Member

      Documentation part of this issue will be addressed in bpo-10435.

    5. BreamoreBoy commented on Sep 30, 2014

      BreamoreBoymannequin
      Mannequin

      With Stage "resolved" and Resolution "duplicate" surely this can be closed?

    6. vstinner commented on Sep 30, 2014

      @vstinner
      Member

      Ok, let's close the issue.

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    docsDocumentation in the Doc dirinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-unicodetype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions