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: Remove smart quotes in pydoc text
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Giant_Robato, docs@python, steve.dower, steven.daprano
Priority: normal Keywords: patch

Created on 2019-04-29 17:53 by steve.dower, last changed 2022-04-11 14:59 by admin.

Pull Requests
URL Status Linked Edit
PR 13128 closed Giant_Robato, 2019-05-06 18:43
Messages (5)
msg341107 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-04-29 17:53
Not all console configurations can correctly render smart quotes in help() text. See the "Æ" in "superclass's" below.

When building for pydoc-topics, it would be ideal to disable smart quotes. (I'm assuming from issue31793 that this can be done in configuration, though I'm not entirely sure how - it's not clear to me from those PRs)

---

>>> help("BASICMETHODS")
Basic customization
*******************

object.__new__(cls[, ...])
...
   Typical implementations create a new instance of the class by
   invoking the superclassÆs "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.
msg341109 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2019-04-29 18:14
> Not all console configurations can correctly render smart quotes in 
> help() text. See the "Æ" in "superclass's" below.

That suggests to me a mismatch in encodings, rather than inability to 
render curly quotes at all. It's 2019 and surely we don't have to target 
ASCII as the lowest common denominator any more?
msg341110 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-04-29 18:29
> mismatch in encodings

Also likely. I haven't looked into how pydoc does its rendering, but certainly Python 3.7 on Windows should be able to print regular Unicode.

Perhaps it's not going through stdout for some reason?
msg341597 - (view) Author: Dustin Mendoza (Giant_Robato) * Date: 2019-05-06 18:49
In my editor (VSCode) on windows it outputs correctly as a smart quote but if I write the output to a file or the console I get the "Æ" effect. A sent a PR to replace the smart quotes with escaped quotes but I wonder if we should also do a scan across everything to see if there are more smart quote instances (I'm still pretty new to the entire codebase so I can't say for sure if this is would even be necessary)
msg341611 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-05-06 19:14
So pydoc_topics.py is an auto-generated file, which means we need to fix the generator as well if we decide to go that route.

However, I suspect there's a problem somewhere else causing the console output to not go through stdout correctly. I'm not familiar enough with how help() works to know where.
History
Date User Action Args
2022-04-11 14:59:14adminsetgithub: 80935
2019-05-06 19:14:03steve.dowersetmessages: + msg341611
2019-05-06 18:49:06Giant_Robatosetnosy: + Giant_Robato
messages: + msg341597
2019-05-06 18:43:18Giant_Robatosetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request13041
2019-04-29 18:29:30steve.dowersetmessages: + msg341110
2019-04-29 18:14:43steven.dapranosetnosy: + steven.daprano
messages: + msg341109
2019-04-29 17:53:25steve.dowercreate