Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turtle.write doc missing tuple parens for font default in 3.10+ #89560

Closed
jggammon mannequin opened this issue Oct 7, 2021 · 11 comments
Closed

turtle.write doc missing tuple parens for font default in 3.10+ #89560

jggammon mannequin opened this issue Oct 7, 2021 · 11 comments
Labels
3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@jggammon
Copy link
Mannequin

jggammon mannequin commented Oct 7, 2021

BPO 45397
Nosy @birkenfeld, @terryjreedy, @serhiy-storchaka

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 = None
closed_at = None
created_at = <Date 2021-10-07.03:12:17.930>
labels = ['3.11', 'type-bug', '3.10', 'docs']
title = 'turtle.write doc missing tuple parens for font default in 3.10+'
updated_at = <Date 2021-11-27.02:54:27.094>
user = 'https://bugs.python.org/jggammon'

bugs.python.org fields:

activity = <Date 2021-11-27.02:54:27.094>
actor = 'terry.reedy'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2021-10-07.03:12:17.930>
creator = 'jggammon'
dependencies = []
files = []
hgrepos = []
issue_num = 45397
keywords = []
message_count = 7.0
messages = ['403348', '403351', '403352', '403413', '403415', '403416', '407128']
nosy_count = 5.0
nosy_names = ['georg.brandl', 'terry.reedy', 'docs@python', 'serhiy.storchaka', 'jggammon']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45397'
versions = ['Python 3.10', 'Python 3.11']

@jggammon
Copy link
Mannequin Author

jggammon mannequin commented Oct 7, 2021

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"))

@jggammon jggammon mannequin added the 3.10 only security fixes label Oct 7, 2021
@jggammon jggammon mannequin assigned docspython Oct 7, 2021
@jggammon jggammon mannequin added docs Documentation in the Doc dir 3.10 only security fixes labels Oct 7, 2021
@jggammon jggammon mannequin assigned docspython Oct 7, 2021
@jggammon jggammon mannequin added the docs Documentation in the Doc dir label Oct 7, 2021
@serhiy-storchaka
Copy link
Member

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')"

@serhiy-storchaka serhiy-storchaka added 3.11 only security fixes type-bug An unexpected behavior, bug, or error labels Oct 7, 2021
@serhiy-storchaka
Copy link
Member

Seems it was fixed in Sphinx a year ago: sphinx-doc/sphinx#8265. Maybe we need to update the Sphinx version (but it can introduce new incompatibilities).

@jggammon
Copy link
Mannequin Author

jggammon mannequin commented Oct 7, 2021

I forgot to mention I'm on Windows 10 PC and see the same thing under Edge and FireFox.

John G. Gammon -. .. .... .. .-.. .- -.. -- .. .-. .- .-. ..

@serhiy-storchaka
Copy link
Member

jg, please remove the copy of other message when answer. It makes painfully difficult reading the discussion for visually impaired people.

@serhiy-storchaka
Copy link
Member

I tested with Sphinx 1.5.4, and this issue is gone. It introduces a regression with some smart quotes (see sphinx-doc/sphinx#9713), but it is less severe than incorrect rendering of tuples as parameter defaults.

@terryjreedy
Copy link
Member

Closed bpo-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.

@terryjreedy terryjreedy changed the 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+ Nov 27, 2021
@terryjreedy terryjreedy changed the 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+ Nov 27, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@slateny
Copy link
Contributor

slateny commented Apr 15, 2022

Seems fixed in 3.11 but not in 3.10

@terryjreedy
Copy link
Member

I verified that in 3.9 and 3.11, turtle.py, line 1098, is now rendered correctly.
.. function:: write(arg, move=False, align="left", font=("Arial", 8, "normal"))
https://docs.python.org/3.11/library/turtle.html#turtle.write
turtle.write(arg, move=False, align='left', font=('Arial', 8, 'normal'))

In 3.10, same line
.. function:: write(arg, move=False, align="left", font=("Arial", 8, "normal"))
renders without the tuple parens.
https://docs.python.org/3.10/library/turtle.html#turtle.write
turtle.write(arg, move=False, align='left', font='Arial', 8, 'normal')

If there is no obvious fix, I think that this should be closed. But...

@JulienPalard Are we using a different version of Sphinx in 3.10 than in 3.9 and 3.11, or is some configuration setting different?

@JulienPalard
Copy link
Member

Yes, see docsbuild-scripts' README (but it sometimes lag behind a few days), here's an up-to-date version:

  • In 3.9 we use Sphinx==2.4.4
  • In 3.10 we use Sphinx==3.2.1
  • In 3.11 we use Sphinx==4.5.0

(It can also be checked by looking at the footers.)

@JulienPalard
Copy link
Member

Closing this as I see it fixed in /3.8/ to /dev/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

4 participants