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

C language typos #95969

Closed
ghost opened this issue Aug 13, 2022 · 8 comments
Closed

C language typos #95969

ghost opened this issue Aug 13, 2022 · 8 comments

Comments

@ghost
Copy link

ghost commented Aug 13, 2022

A Member can decide whether to uncomment the lines in the script.

grep -nr UNMARSHALLABLE cpython

grep -nr unmarshallable cpython

grep -n *p*redicate cpython/Python/getargs.c

I would leave it to someone else to open a PR.

$ cat typos.sh
#!/bin.sh

# sed -i "s/UNMARSHALLABLE/UNMARSHALABLE/g" cpython/Python/marshal.c
# sed -i "s/unmarshallable/unmarshalable/g" cpython/Python/marshal.c
# sed -i "s/unmarshallable/unmarshalable/g" cpython/Python/clinic/marshal.c.h
# sed -i "s/unmarshallable/unmarshalable/g" cpython/Lib/test/test_marshal.py
# sed -i "s/unmarshallable/unmarshalable/g" cpython/Doc/library/marshal.rst
sed -i "s/Realisically/Realistically/g" cpython/Python/pystate.c
sed -i "s/Sanitify/Sanity/g" cpython/Objects/object.c
sed -i "s/advices/advises/g" cpython/Modules/posixmodule.c
sed -i "s/alignement/alignment/g" cpython/Modules/_ctypes/libffi_osx/powerpc/ppc-ffi_darwin.c
sed -i "s/aposthrophe/apostrophe/g" cpython/Modules/expat/xmltok_impl.h
sed -i "s/callaback/callback/g" cpython/Modules/atexitmodule.c
sed -i "s/catostraphically/catastrophically/g" cpython/Modules/_xxtestfuzz/fuzzer.c
sed -i "s/contiuning/continuing/g" cpython/PC/launcher2.c
sed -i "s/definiton/definition/g" cpython/Modules/pyexpat.c
sed -i "s/descripter/descriptor/g" cpython/Modules/faulthandler.c
sed -i "s/endianess/endianness/g" cpython/Modules/_sha3/sha3.c
sed -i "s/finallization/finalization/g" cpython/Python/_warnings.c
sed -i "s/inlclude/include/g" cpython/Modules/_testcapi/heaptype.c
sed -i "s/interactie/interactive/g" cpython/Parser/tokenizer.h
sed -i "s/interfece/interface/g" cpython/Modules/_sha3/sha3.h
sed -i "s/maximin/maximum/g" cpython/Modules/_sre/sre_lib.h
sed -i "s/measn/means/g" cpython/Modules/expat/xmlparse.c
sed -i "s/mistmatching/mismatching/g" cpython/Parser/pegen_errors.c
sed -i "s/occurences/occurrences/g" cpython/Include/internal/pycore_object.h
sed -i "s/ovewrite/overwrite/g" cpython/Modules/_testcapi/heaptype.c
sed -i "s/parallellism/parallelism/g" cpython/Objects/tupleobject.c
sed -i "s/predecssors/predecessors/g" cpython/Python/compile.c
sed -i "s/quaduples/quadruples/g" cpython/Modules/_pickle.c
# sed -i "s/\\*p\\*redicate/predicate/g" cpython/Python/getargs.c
sed -i "s/referennce/reference/g" cpython/Include/internal/pycore_frame.h
sed -i "s/repeately/repeatedly/g" cpython/Include/internal/pycore_bytesobject.h
sed -i "s/rotatation/rotation/g" cpython/Modules/itertoolsmodule.c
sed -i "s/supplimental/supplemental/g" cpython/Modules/posixmodule.c
$ 
@ghost ghost added the type-bug An unexpected behavior, bug, or error label Aug 13, 2022
@ghost
Copy link
Author

ghost commented Aug 13, 2022

@Fidget-Spinner

Labels for this ticket might be adjusted/corrected.

@ghost
Copy link
Author

ghost commented Aug 15, 2022

a typo was corrected upstream today in pysqlite

the file appears in this repo as Modules/_sqlite/cursor.c


quickly lookup context where the typo(s) appear

$ cat typos.pl
#!/usr/bin/env perl

use strict;
use warnings;
use autodie;

my $fh;
my $file = 'typos';

open $fh, '<', $file;
while ( my $line = <$fh> ) {
    next if $line =~ /^\s*#/; # skip commented out lines
    my @typo = split '/', $line;
    my @path = split ' ', $line;
    print "grep -n $typo[1] $path[3]\n";
}

close $fh;
$ wc -l typos.sh
35 typos.sh
$ ed -s typos.sh <<<'3,35p' > typos
$ 

redirect output

./typos.pl > myfile

if the following line is uncommented

# sed -i "s/\\*p\\*redicate/predicate/g" cpython/Python/getargs.c

remove backslashes

sed -i 's/\\//g' myfile

then run

sh myfile

@erlend-aasland erlend-aasland removed the type-bug An unexpected behavior, bug, or error label Aug 15, 2022
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Aug 15, 2022

Thanks for you interest in improving CPython.

Typos in source code comments are not bugs; I'm removing the bug label. AFAIK, no-one has misunderstood the meaning of the misspelled words. Fixing them is churn for very little benefit.

I suggest to leave them in place and close this issue.

@erlend-aasland erlend-aasland added the pending The issue will be closed if no feedback is provided label Aug 15, 2022
@erlend-aasland
Copy link
Contributor

erlend-aasland commented Aug 15, 2022

See also #93124 (comment)

@ghost
Copy link
Author

ghost commented Aug 15, 2022

should have opened a blank issue

a Documentation label when code and comment changes are involved doesn't sit well with me

grep -nr UNMARSHALLABLE cpython

grep -nr unmarshallable cpython

as others from different coding language communities may read the source files the changes are indicated

@ghost
Copy link
Author

ghost commented Aug 16, 2022

@pitrou

found another .c file typo

sed -i "s/temptative/tentative/g" cpython/Modules/_io/textio.c

this is a repo wide bulk fix for C language typos


a brief perusal of Lib top-level .py files revealed a few typos

replacement strings

becoming
concatenating
daemon
tentative

$ grep -nr becaming cpython/Lib/*.py
cpython/Lib/enum.py:25:    Protects item from becaming an Enum member during class creation.
$ grep -nr concatenting cpython/Lib/*.py
cpython/Lib/dataclasses.py:578:        # (instead of just concatenting the lists together).
$ grep -nr deamon cpython/Lib/*.py
cpython/Lib/threading.py:1570:    # Join all non-deamon threads
$ grep -nr temptative cpython/Lib/*.py
cpython/Lib/_pyio.py:2362:                # Decode up to temptative start point
$ 

A Philosophy of Software Design
Copyright 2018 John Ousterhout

12 Why Write Comments? The Four Excuses
12.1 Good code is self-documenting
12.2 I don’t have time to write comments
12.3 Comments get out of date and become misleading
12.4 All the comments I have seen are worthless
12.5 Benefits of well-written comments

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Aug 16, 2022

Closing this for the reasons provided in #95969 (comment) and #93124 (comment)

@erlend-aasland erlend-aasland closed this as not planned Won't fix, can't repro, duplicate, stale Aug 16, 2022
@erlend-aasland erlend-aasland removed the pending The issue will be closed if no feedback is provided label Aug 16, 2022
@musvaage
Copy link

musvaage commented Oct 13, 2022

PR #98194 revealed another typo.

sed -i "s/uninitialzed/uninitialized/g" cpython/Objects/longobject.c

updated Nov 6, 2022

Implemented in effect with merge of PR #98194 .

sed -i "s/definiton/definition/g" cpython/Modules/pyexpat.c
sed -i "s/uninitialzed/uninitialized/g" cpython/Objects/longobject.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants