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

URL Quoting page links to function Bytes instead of defintion #74238

Closed
csabella opened this issue Apr 12, 2017 · 17 comments
Closed

URL Quoting page links to function Bytes instead of defintion #74238

csabella opened this issue Apr 12, 2017 · 17 comments
Labels
3.7 (EOL) end of life docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@csabella
Copy link
Contributor

BPO 30052
Nosy @birkenfeld, @ncoghlan, @wimglenn, @Mariatta, @csabella
PRs
  • bpo-30052: DOC: Link bytes to stdtypes not functions  #1271
  • bpo-30052: Always regenerate cross-references #1339
  • [3.6] bpo-30052: Link bytes & bytearray to stdtypes not functions… #1915
  • [3.6] bpo-30052: Always regenerate cross-references (GH-1339) #1921
  • 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 = <Date 2017-06-06.02:20:48.154>
    created_at = <Date 2017-04-12.12:49:34.666>
    labels = ['type-bug', '3.7', 'docs']
    title = 'URL Quoting page links to function Bytes instead of defintion'
    updated_at = <Date 2019-06-21.21:27:29.843>
    user = 'https://github.com/csabella'

    bugs.python.org fields:

    activity = <Date 2019-06-21.21:27:29.843>
    actor = 'cheryl.sabella'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2017-06-06.02:20:48.154>
    closer = 'Mariatta'
    components = ['Documentation']
    creation = <Date 2017-04-12.12:49:34.666>
    creator = 'cheryl.sabella'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30052
    keywords = []
    message_count = 17.0
    messages = ['291546', '291575', '292215', '292301', '292428', '292440', '292484', '292520', '294982', '295015', '295019', '295020', '295229', '295230', '345881', '345882', '346253']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'ncoghlan', 'docs@python', 'wim.glenn', 'Mariatta', 'cheryl.sabella']
    pr_nums = ['1271', '1339', '1915', '1921']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue30052'
    versions = ['Python 3.6', 'Python 3.7']

    @csabella
    Copy link
    Contributor Author

    On the URL Quoting page, the following line:

    string may be either a str or a bytes.

    Has the str link to:
    https://docs.python.org/3/library/stdtypes.html#str

    But the bytes link to:
    https://docs.python.org/3/library/functions.html#bytes

    Should the bytes link to?
    https://docs.python.org/3/library/stdtypes.html#bytes

    @csabella csabella added the docs Documentation in the Doc dir label Apr 12, 2017
    @csabella
    Copy link
    Contributor Author

    I've looked into this a little more and it seems that, in all instances, the :class:`bytes` and :class:`bytearray` mark-up link to the Built-In Functions page instead of the Built-In Types page.

    It also looks like the Built-In Functions page has specific code for many types (dict, frozenset, memoryview, list, tuple, str, etc) so that it wouldn't link to this (the functions) page. However, bytes and bytearray aren't part of that list. I don't know if they were excluded on purpose or if their links should behave like the other types.

    Please let me know if this should change.

    @csabella
    Copy link
    Contributor Author

    Since no one has said that this change shouldn't be made, I'll start working on this.

    @Mariatta Mariatta added the 3.7 (EOL) end of life label Apr 25, 2017
    @ncoghlan
    Copy link
    Contributor

    New changeset c6db481 by Nick Coghlan (csabella) in branch 'master':
    bpo-30052: Link bytes & bytearray to stdtypes not functions (GH-1271)
    c6db481

    @berkerpeksag berkerpeksag added the type-bug An unexpected behavior, bug, or error label Apr 27, 2017
    @csabella
    Copy link
    Contributor Author

    FYI.

    When I tested this change locally, I needed to do a 'make clean' then a 'make html' for all the pages to relink to the stdtypes page for :class:`bytes`. I had asked on the IRC channel about that and thought maybe the merge into the master would do that automatically, but checking some of the links (like on the urllib.parse page), it didn't update them.

    @ncoghlan
    Copy link
    Contributor

    Indeed, checking the dev build at https://docs.python.org/dev/library/urllib.parse.html#url-quoting shows it still linking to the old location.

    Perhaps the autobuild-dev-html target in the Makefile should be adding -E and -a so it always regenerates everything, rather than re-using the potentially stale cached info from the previous day?

    @csabella
    Copy link
    Contributor Author

    I don't think it would add a lot of time or processing to rebuild it daily, would it? Seems safer than not doing it.

    @ncoghlan
    Copy link
    Contributor

    New PR disabling the output caching and adding a corresponding NEWS entry: #1339

    On my local machine, it takes a "nothing changed" build from less than 2 seconds to just under 2 minutes, but I think that's fine for a daily build task.

    @Mariatta
    Copy link
    Member

    Mariatta commented Jun 2, 2017

    New changeset 1c92c0e by Mariatta in branch '3.6':
    bpo-30052: Link bytes & bytearray to stdtypes not functions (GH-1271) (GH-1915)
    1c92c0e

    @csabella
    Copy link
    Contributor Author

    csabella commented Jun 2, 2017

    Sorry, Mariatta. I didn't realize this was waiting for a backport.

    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Jun 2, 2017

    New changeset 7a82f9c by Nick Coghlan in branch 'master':
    bpo-30052: Always regenerate cross-references (bpo-1339)
    7a82f9c

    @ncoghlan
    Copy link
    Contributor

    ncoghlan commented Jun 2, 2017

    Not your fault, Cheryl! I unfortunately got distracted and didn't follow up on the backports for several PRs I merged a while back. Mariatta has been graciously cleaning some of those up rather than leaving them lingering the way I had been :)

    I also just noticed that I never merged the PR to always regenerate the cross-references, so I went ahead and did that, and also submitted the corresponding 3.6 backport PR.

    @Mariatta
    Copy link
    Member

    Mariatta commented Jun 6, 2017

    New changeset 798cfb2 by Mariatta (Nick Coghlan) in branch '3.6':
    bpo-30052: Always regenerate cross-references (GH-1339) (GH-1921)
    798cfb2

    @Mariatta
    Copy link
    Member

    Mariatta commented Jun 6, 2017

    Backport PR looks good so I went ahead and merged it :)
    Thanks.

    @Mariatta Mariatta closed this as completed Jun 6, 2017
    @wimglenn
    Copy link
    Mannequin

    wimglenn mannequin commented Jun 17, 2019

    https://docs.python.org/3/library/functions.html

    Usually the little paragraph icon appears when you hover over a function name, giving an anchor link. It's not doing it for bytes or bytearray.

    Was that an unintended consequence of disambiguation from the stdtypes html?

    @wimglenn
    Copy link
    Mannequin

    wimglenn mannequin commented Jun 17, 2019

    This anchor works, by the way:
    https://docs.python.org/3/library/functions.html#func-bytes

    Hopefully someone more fluent in the docs syntax can figure out a way to fix the anchor-link hovers

    @csabella
    Copy link
    Contributor Author

    Hi @wim.glenn,

    Thanks for the report. It looks like the same issue applies to all the built-in functions that are handled this way, not just bytearray and bytes. So, dict, frozenset, list, memoryview, range, set, str, and tuple too. I'm not sure what the fix is, but I agree that we should take a look. Can you create a new tracker issue for this? Thanks!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants