-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
bpo-31537: Fix bug in readline documentation example code #3925
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
Conversation
8dee488
to
adf56e3
Compare
@@ -0,0 +1,2 @@ | |||
Fix incorrect usage of `get_history_length` in readline documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use double backticks: ``get_history_length``
Single backtick means Sphinx will use the value of the default_role
setting to decide what to do with a markup like `foo bar` and it can cause regressions in documentation if someone changes the value of default_role
by using the default-role
directive:
`foo bar`
.. default-role:: subscript
`spam eggs`
will be rendered as
<p><cite>foo bar</cite></p>
<p><sub>spam eggs</sub></p>
See http://docutils.sourceforge.net/docs/ref/rst/directives.html#default-role for details.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be put in the comfy chair! |
Use `get_current_history_length` to get the current length of the history, not `get_history_length`. This fixes an issue where the example code's call to `append_history_file` in the `save` function would never actually write any lines to the file.
adf56e3
to
5e94fa4
Compare
I didn't expect the Spanish Inquisition! |
Nobody expects the Spanish Inquisition! @berkerpeksag, @Mariatta: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!
Thanks @infinitewarp for the PR, and @Mariatta for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Thanks @infinitewarp and congrats on your first contribution to CPython 🌮 |
Thanks @infinitewarp for the PR, and @Mariatta for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6. |
GH-3948 is a backport of this pull request to the 3.6 branch. |
Change the code example from using `get_history_length` to `get_current_history_length`. (cherry picked from commit eeb5ffd)
Use
get_current_history_length
to get the current length of the history, notget_history_length
. This fixes an issue where the example code's call toappend_history_file
in thesave
function would never actually write any lines to the file.Fixes https://bugs.python.org/issue31537
https://bugs.python.org/issue31537