This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: turtle.write doc missing tuple parens for font default in 3.10+
Type: behavior Stage:
Components: Documentation Versions: Python 3.11, Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, georg.brandl, jggammon, serhiy.storchaka, terry.reedy
Priority: normal Keywords:

Created on 2021-10-07 03:12 by jggammon, last changed 2022-04-11 14:59 by admin.

Messages (7)
msg403348 - (view) Author: jg (jggammon) Date: 2021-10-07 03:12
In the version 3.10 and 3.11 python turtle doc, the turtle.write line shows font without it's tuple parenthesis. Something change in 3.10 that makes it look like font='Arial' and 8 and 'normal' are 3 separate parameters, when it should be one tuple parameter font=(x,y,z).

Ex. of wrong entry (URL=https://docs.python.org/3.11/library/turtle.html#turtle.write)
line=turtle.write(arg, move=False, align='left', font='Arial', 8, 'normal')

Ex. of correct entry (https://docs.python.org/3.9/library/turtle.html#turtle.write)
line=turtle.write(arg, move=False, align="left", font=("Arial", 8, "normal"))
msg403351 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-07 06:47
This looks like some Sphinx bug.

In Python 3.8, using Sphinx:

>>> from sphinx.pycode import ast
>>> ast.unparse(ast.parse("('Arial', 8, 'normal')", 'eval').body)
"'Arial', 8, 'normal'"

For comparison, using builtin ast module in Python 3.9:

>>> import ast
>>> ast.unparse(ast.parse("('Arial', 8, 'normal')", 'eval').body)
"('Arial', 8, 'normal')"
msg403352 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-07 06:54
Seems it was fixed in Sphinx a year ago: https://github.com/sphinx-doc/sphinx/pull/8265. Maybe we need to update the Sphinx version (but it can introduce new incompatibilities).
msg403413 - (view) Author: jg (jggammon) Date: 2021-10-07 14:17
I forgot to mention I'm on Windows 10 PC and see the same thing under Edge and FireFox.

John G. Gammon -.  ..  ....  ..  .-..      .-  -..  --  ..  .-.  .-  .-.  ..
This message and any attachments hereto may contain confidential and/or privileged information. If you are not the intended recipient or authorized to receive this for the intended recipient, please advise the sender immediately by reply e-mail and delete this message; you must not use, copy, disclose or take any other action based on this message or any information herein. Thank you for your cooperation.

________________________________
From: report=bugs.python.org@roundup.psfhosted.org <report=bugs.python.org@roundup.psfhosted.org> on behalf of Serhiy Storchaka <report@bugs.python.org>
Sent: Thursday, October 7, 2021 01:47
To: jggammon@hotmail.com <jggammon@hotmail.com>
Subject: [issue45397] Doc for turtle.write missing the tuple part of the font param in 3.10+

Serhiy Storchaka <storchaka+cpython@gmail.com> added the comment:

This looks like some Sphinx bug.

In Python 3.8, using Sphinx:

>>> from sphinx.pycode import ast
>>> ast.unparse(ast.parse("('Arial', 8, 'normal')", 'eval').body)
"'Arial', 8, 'normal'"

For comparison, using builtin ast module in Python 3.9:

>>> import ast
>>> ast.unparse(ast.parse("('Arial', 8, 'normal')", 'eval').body)
"('Arial', 8, 'normal')"

----------
nosy: +georg.brandl, serhiy.storchaka
type:  -> behavior
versions: +Python 3.11

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue45397>
_______________________________________
msg403415 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-07 14:24
jg, please remove the copy of other message when answer. It makes painfully difficult reading the discussion for visually impaired people.
msg403416 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-10-07 14:29
I tested with Sphinx 1.5.4, and this issue is gone. It introduces a regression with some smart quotes (see https://github.com/sphinx-doc/sphinx/issues/9713), but it is less severe than incorrect rendering of tuples as parameter defaults.
msg407128 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2021-11-27 02:54
Closed #45872 as duplicate.  Éric, any idea for a local fix?

I verified with Sphinx 3.2.1.  I tried both escaping with '\' and doubling parens, without success.
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89560
2021-11-27 02:54:27terry.reedysetnosy: + terry.reedy

messages: + msg407128
title: Doc for turtle.write missing the tuple part of the font param in 3.10+ -> turtle.write doc missing tuple parens for font default in 3.10+
2021-11-27 02:53:31terry.reedylinkissue45872 superseder
2021-10-07 14:29:12serhiy.storchakasetmessages: + msg403416
2021-10-07 14:24:48serhiy.storchakasetmessages: + msg403415
2021-10-07 14:17:46jggammonsetmessages: + msg403413
2021-10-07 06:54:36serhiy.storchakasetmessages: + msg403352
2021-10-07 06:47:07serhiy.storchakasetversions: + Python 3.11
nosy: + georg.brandl, serhiy.storchaka

messages: + msg403351

type: behavior
2021-10-07 03:12:17jggammoncreate