[issue23109] French quotes in the documentation are often ungrammatical
New submission from Clément: >From https://docs.python.org/3/howto/unicode.html: > For a while people just wrote programs that didn’t display accents. > In the mid-1980s an Apple II BASIC program written by a French > speaker might have lines like these: > > PRINT "FICHIER EST COMPLETE." > PRINT "CARACTERE NON ACCEPTE." > > Those messages should contain accents (completé, caractère, accepté), > and > they just look wrong to someone who can read French. One of the reasons the message looks wrong is that "FICHIER EST COMPLETE" in ungrammatical in French. Google has 16 hits for that query, half of which are from the Python documentation. The second one is better. I imagine the first one comes from the English "FILE IS COMPLETE", but I'm not even sure what that meant, so it's hard to give a better translation :/ Instead, here are a few examples that could work: MISE A JOUR TERMINEE (Update completed − missing à and é in terminée) VEUILLEZ REDEMARRER (Please reboot − missing é in redémarrer) PARAMETRES ENREGISTRES (Settings saved − missing è in paramètre and é in enregistrés) Similarly, https://docs.python.org/3/library/email-examples.html#examples-using-the-provisional-api: > msg['Subject'] = "Ayons asperges pour le déjeuner" I imagine this comes from the English "Let's have asparagus for lunch!", but the translation reads "Possess asparagus for lunch we". A proper idiomatic French version would be "Ça te dirait de manger des asperges à midi?" (Would you like to eat asparagus for lunch?) Again further on the same page: > Cela ressemble à un excellent recipie[1] déjeuner. Could this mean "This looks like a delicious lunch recipie?" The typo in recipie would have prevented the machine translation from picking up recipie, which survived in the French version? This currently reads "This look like recipie lunch a excellent". A proper French version (adjusted to have accents) might be "J'ai trouvé une recette sympa: [1]" ("I found a nice recipe: [1]"). Not sure why using French is needed though; English already has a few accented words: a message with subject "Résumé attached", and body "Here's my résumé" would probably work just as well, and might not divert the reader's attention as much. Side note: in the example Pépé writes to Fabrette and Penelope. Aren't they the same character? Clément. -- assignee: docs@python components: Documentation messages: 233076 nosy: cpitcla, docs@python priority: normal severity: normal status: open title: French quotes in the documentation are often ungrammatical versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <http://bugs.python.org/issue23109> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28249] doctest.DocTestFinder reports incorrect line numbers with exclude_empty=False
New submission from Clément: Line numbers reported by the doctest module are wrong when a function does not include a docstring. With the attached example file, running python -c "import doctest, example; print(doctest.DocTestFinder(exclude_empty=False).find(example))" produces [, , , ] whereas if one uncomments the docstrings of a and c the output is [, , , ] This bug is due to this line in doctest: lineno = self._find_lineno(obj, source_lines) The documentation of _find_lineno says this: def _find_lineno(self, obj, source_lines): """ Return a line number of the given object's docstring. Note: this method assumes that the object has a docstring. """ This assumption is violated by the call listed above, because of the exclude_empty=False parameter to DocTestFinder(). I guess lineno should just be None for all methods that do not have a docstring? -- components: Library (Lib) files: example.py messages: 277230 nosy: cpitclaudel priority: normal severity: normal status: open title: doctest.DocTestFinder reports incorrect line numbers with exclude_empty=False versions: Python 2.7, Python 3.5 Added file: http://bugs.python.org/file44786/example.py ___ Python tracker <http://bugs.python.org/issue28249> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25660] tabs don't work correctly in python repl
Clément added the comment: Could this commit be the reason why the attached code behaves differently in 2.7 and 3.5.2? This is the code used by Emacs' default Python mode to do completion; with it (python -i completion.py), pressing "tab" on a plain prompt offers candidates in Python 2.7, but it doesn't in Python 3.5.2 (instead, it inserts a tab). -- nosy: +cpitclaudel Added file: http://bugs.python.org/file45235/completion.py ___ Python tracker <http://bugs.python.org/issue25660> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25660] tabs don't work correctly in python repl
Clément added the comment: Thanks Martin for the clarification! I'll leave it to you to decide whether there is something to fix here (I'll admit to not understanding much of that code). -- ___ Python tracker <http://bugs.python.org/issue25660> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33850] Json.dump() bug when using generator
New submission from Clément Boyer : I use a class to write easily json when having generator. ```python class StreamArray(list): def __init__(self, generator): super().__init__() self.generator = generator def __iter__(self): return self.generator def __len__(self): return 1 ``` Below a test comparing json.dump and json.dumps. ``` >>> import json >>> class StreamArray(list): ... def __init__(self, generator): ... super().__init__() ... self.generator = generator ... def __iter__(self): ... return self.generator ... def __len__(self): ... return 1 ... >>> g = (i for i in range(0)) >>> json.dumps({"a": StreamArray(g)}) '{"a": []}' >>> f = open("/tmp/test.json", "w+") >>> g = (i for i in range(0)) >>> json.dump({"a": StreamArray(g)}, f) >>> f.close() >>> print(open("/tmp/test.json").read()) {"a": ]} ``` I don't know if it's me or if there is actually a problem, could you help me ? -- components: Library (Lib) messages: 319436 nosy: biloup priority: normal severity: normal status: open title: Json.dump() bug when using generator type: behavior versions: Python 3.6 ___ Python tracker <https://bugs.python.org/issue33850> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com