[issue43922] Double dots in quopri transported emails
Change by Jérôme Vanhaudenard : -- nosy: +jev2 ___ Python tracker <https://bugs.python.org/issue43922> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42473] re.sub ignores flag re.M
New submission from Jérôme Laurens : Test code: ``` import re test='''012345678 012345678 ''' pattern = r'^\s+?$' m = re.search(pattern, test, re.M) if m: print(f'TEST FOUND "{m.span()}"') def replace(m): print(f'TEST REMOVE {m.span()}') return '' test = re.sub(pattern, replace, test, re.M) m = re.search(pattern, test, re.M) if m: print(f'TEST STILL THERE "{m.span()}"') print('COMPILE PATTERN FIRST') pattern_re = re.compile(pattern, re.M) m = re.search(pattern_re, test) if m: print(f'TEST FOUND "{m.span()}"') def replace(m): print(f'TEST REMOVE {m.span()}') return '' test = re.sub(pattern_re, replace, test) m = re.search(pattern_re, test) if m: print(f'TEST STILL THERE "{m.span()}"') ``` Actual output: TEST FOUND "(10, 19)" TEST STILL THERE "(10, 19)" COMPILE PATTERN FIRST TEST FOUND "(10, 19)" TEST REMOVE (10, 19) This is an inconsistency between re.search and re.sub. Either this is a bug in the code or in the documentation. -- components: IO messages: 381901 nosy: jlaurens priority: normal severity: normal status: open title: re.sub ignores flag re.M type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue42473> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c
Jérôme added the comment: Yes, I get your meaning, and I totally agree with it, I was wondering what was the best way to do it, stay close to the cause, which would allow to more easily go along with changes, or put it in the configure file and warn the user as soon as possible... It was kind of a flip a coin decision in the end. For my information, is there a kind of committee or someone taking these kinds of decisions or at least expressing rules as to the spirit in which they should be made? On the same track, how can I find why someone wrote " /* Various compilers have only certain posix functions */ /* XXX Gosh I wish these were all moved into pyconfig.h */ " in posixmodule.c? Is it just because no-one had the opportunity to do it and it is OK for me to do it? "Fetchez la vache" -- ___ Python tracker <https://bugs.python.org/issue40174> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c
Jérôme added the comment: Hi, I think it is nice to inform the user that clock_gettime is mandatory (just like pthreads, see PR). Can be nice for someone trying to port it to a new platform. "It's no particularly silly, is it?" -- ___ Python tracker <https://bugs.python.org/issue40174> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40183] AC_COMPILE_IFELSE doesn't work in all cases
New submission from Jérôme : Just compiling the symbol sometimes gives a false positive (for example chroot compiles OK), but also linking properly detects the symbol is missing. -- components: Interpreter Core messages: 365781 nosy: jerome.hamm priority: normal severity: normal status: open title: AC_COMPILE_IFELSE doesn't work in all cases type: compile error versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue40183> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c
Jérôme added the comment: Hi, OK, I was looking at the wrong line numbers, the problem is still there and as follows. You might call me a perfectionist, but if HAVE_CLOCK_GETTIME is not defined, the function pytime_fromtimespec is taken out by the preprocessor, but still called by the function pymonotonic, so python does not compile. I'm thinking of two ways to go, either stop configure if HAVE_CLOCK_GETTIME is not defined, or rewrite the function differently (I don't know how badly a truly monotonic clock is needed). It does feel strange to me to partially only honor HAVE_CLOCK_GETTIME. "With government backing, I could make it very silly" -- ___ Python tracker <https://bugs.python.org/issue40174> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c
Jérôme added the comment: Hold on, this was the case with Python 3.8.2, but I just checked Github and the code is different! I'll have to check again with HEAD, and sorry if it was fixed! "Drop your panties sir William, I cannot wait till lunchtime". -- ___ Python tracker <https://bugs.python.org/issue40174> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40174] HAVE_CLOCK_GETTIME not repected in pytime.c
New submission from Jérôme : Hi, In the file Python/pytime.c (line 886 and others), functions and constants that I infer should be declared by HAVE_CLOCK_GETTIME are called without #ifdef. Best regards, Jérôme. -- components: Interpreter Core messages: 365703 nosy: jerome.hamm priority: normal severity: normal status: open title: HAVE_CLOCK_GETTIME not repected in pytime.c type: compile error versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue40174> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38514] pathlib's mkdir documentation improvement
New submission from Jérôme Laurens : There are some inconsistencies in the actual documentation of path lib's mkdir doc. Here is the 3.7 version, annotated and followed by a change proposal Path.mkdir(mode=0o777, parents=False, exist_ok=False) Create a new directory at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If the path already exists, FileExistsError is raised. <<<<<<<<<<<<<<<<<< NOT ALWAYS due to exist_ok. If parents is true, any missing parents of this path are created as needed; they are created with the default permissions without taking mode into account (mimicking the POSIX mkdir -p command). If parents is false (the default), a missing parent raises FileNotFoundError. If exist_ok is false (the default), FileExistsError is raised if the target directory already exists. If exist_ok is true, FileExistsError exceptions will be ignored (same behavior as the POSIX mkdir -p command), but only if the last path component is not an existing non-directory file. <<<<<<<<<<<<<<<<<< UNCLEAR: 1) what is an ignored exception ? 2) The reference to POSIX should appear at the end, like above, 3) the last path component is a string 4) usage of a double negation ignore/is not - CHANGE Path.mkdir(mode=0o777, parents=False, exist_ok=False) Create a new directory in the file system at this given path. If mode is given, it is combined with the process’ umask value to determine the file mode and access flags. If parents is false (the default), a missing parent raises FileNotFoundError. If parents is true, any missing parents of this path are created as needed; they are created with the default permissions without taking mode into account (mimicking the POSIX mkdir -p command). If exist_ok is false (the default), FileExistsError is raised if the given path already exists in the file system, whether a directory or not. If exist_ok is true, FileExistsError is raised only if the given path already exists in the file system and is not a directory (same behavior as the POSIX mkdir -p command). Thanks for reading JL -- assignee: docs@python components: Documentation messages: 354874 nosy: docs@python, jlaurens priority: normal severity: normal status: open title: pathlib's mkdir documentation improvement type: enhancement versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue38514> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37514] french translation Spelling mistake on datetime python's library documentation online
New submission from Lanteri Jérôme : "Un objet avisé est utilisé pour représenté un moment" corrected should be: "Un objet avisé est utilisé pour représenter un moment" Comment for help French translator: Vous pouvez tester en remplaçant le verbe suspecté par un verbe du troisième groupe, tel que "faire": "Un objet avisé est utilisé pour faire..." (ça fonctionne, il n'est pas conjugué, par ce que on ne pourrait pas dire: "Un objet avisé est utilisé pour fait..."). C'est une astuce facile à retenir. -- assignee: docs@python components: Documentation messages: 347432 nosy: docs@python, jerome_l priority: normal severity: normal status: open title: french translation Spelling mistake on datetime python's library documentation online versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue37514> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35957] Indentation explanation is unclear
Jérôme LAURENS added the comment: To be more precise, consider code def f(x): \tx=0 # 7 spaces + one tab return x # 8 spaces In cpython, both indentation levels are 8 and no indentation error is reported (this is the case where both tab size and alt tab size are equal) If instead of 8 the tab would count for 6 spaces, then we would have 12 and 8 as indentation level, resulting in a mismatch and an indentation error being reported, according to the documentation. This is inconsistent. Then either the documentation is faulty or cpython is. Actually, cpython accepts a mix of space and tabs only when tabs are in 8, 16, 24... positions. -- ___ Python tracker <https://bugs.python.org/issue35957> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35957] Indentation explanation is unclear
New submission from Jérôme LAURENS : https://docs.python.org/3/reference/lexical_analysis.html#indentation reads Point 1: "Tabs are replaced (from left to right) by one to eight spaces such that the total number of characters up to and including the replacement is a multiple of eight" and in the next paragraph Point 2: "Indentation is rejected as inconsistent if a source file mixes tabs and spaces in a way that makes the meaning dependent on the worth of a tab in spaces" In point 1, each tab has definitely a unique space counterpart, in point 2, tabs may have different space counterpart, which one is reliable ? The documentation should state that Point 1 concerns cPython, or at least indicate that the 8 may depend on the implementation, which then gives sense to point 2. -- assignee: docs@python components: Documentation messages: 335165 nosy: Jérôme LAURENS, docs@python priority: normal severity: normal status: open title: Indentation explanation is unclear type: enhancement versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue35957> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24079] xml.etree.ElementTree.Element.text does not conform to the documentation
Jérôme Laurens added the comment: Erratum def innertext(elt): return (elt.text or '') +''.join(innertext(e)+(e.tail or '') for e in elt) -- ___ Python tracker <http://bugs.python.org/issue24079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24079] xml.etree.ElementTree.Element.text does not conform to the documentation
Jérôme Laurens added the comment: The totsstring(..., method='text') is not suitable for the inner text because it adds the tail of the top element. A proper implementation would be def innertext(elt): return (elt.text or '') +''.join(innertext(e)+e.tail for e in elt) that can be included in the doc instead of the mention of the to string trick -- ___ Python tracker <http://bugs.python.org/issue24079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24079] xml.etree.ElementTree.Element.text does not conform to the documentation
Jérôme Laurens added the comment: Since the text and tail notions seem tightly coupled, I would vote for a more detailed explanation in the text doc and a forward link in the tail documentation. """ text The text attribute holds the text between the element's begin tag and the next tag or None. The tail attribute holds the text between the element's end tag and the next tag or None. For "1234" xml data, the a element has None for both text and tail attributes, the b element has text '1' and tail '4', the c element has text '2' and tail None, the d element hast text None and tail '3'. To collect the inner text of an element, see `tostring` with method 'text'. Applications may store arbitrary objects in this attribute. tail The tail attribute holds the text between the element's end tag and the next tag or None. See `text` for more details. Applications may store arbitrary objects in this attribute. """ It is very important to mention that the 'text' attribute does not always hold a string contrary to what would suggest its name. BTW, I was not aware of the tostring method with 'text' argument. The fact is that the documentation reads "Returns an (optionally) encoded string containing the XML data." which is misleading because the text is not xml data in general. This also needs to be rephrased or simply removed. -- ___ Python tracker <http://bugs.python.org/issue24079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24079] xml.etree.ElementTree.Element.text does not conform to the documentation
New submission from Jérôme Laurens: The documentation for xml.etree.ElementTree.Element.text reads "If the element is created from an XML file the attribute will contain any text found between the element tags." import xml.etree.ElementTree as ET root3 = ET.fromstring('TEXT') print(root3.text) CURRENT OUTPUT None "TEXT" is between the elements tags but does not appear in the output BTW : this is well formed xml and has nothing to do with tail. -- components: XML messages: 242256 nosy: jlaurens priority: normal severity: normal status: open title: xml.etree.ElementTree.Element.text does not conform to the documentation type: behavior versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue24079> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24072] xml.etree.ElementTree.Element does not catch text
New submission from Jérôme Laurens: text is not catcher in case 3 below INPUT import xml.etree.ElementTree as ET root1 = ET.fromstring('TEXT') print(root1.text) root2 = ET.fromstring('TEXT') print(root2.text) root3 = ET.fromstring('TEXT') print(root3.text) CURRENT OUTPUT TEXT TEXT None <-- ERROR HERE EXPECTED OUTPUT TEXT TEXT TEXT -- messages: 242207 nosy: jlaurens priority: normal severity: normal status: open title: xml.etree.ElementTree.Element does not catch text type: behavior versions: Python 3.4 ___ Python tracker <http://bugs.python.org/issue24072> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11505] string.py increased test coverage
Jérôme Radix added the comment: There seems to be a small problem with parameters when calling _vformat. Your test is OK because _vformat raises an exception before using those parameters. See test_vformat_assert.patch for a correction proposal. -- nosy: +jerome.radix Added file: http://bugs.python.org/file21254/test_vformat_assert.patch ___ Python tracker <http://bugs.python.org/issue11505> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11375] urllib2 over SOCKS doesn't use proxy for DNS
Changes by Jérôme Radix : -- nosy: +jerome.radix ___ Python tracker <http://bugs.python.org/issue11375> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11319] Command line option -t (and -tt) does not work for a particular case
New submission from Jérôme Radix : The attached example mixes tabs and spaces but python does not report any warning when used with -t. Line 4 contains 1 tab. Lines after line 4 contains spaces. Tested using : Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 C:\>python -t test_tt.py C:\> -- components: Interpreter Core files: test_tt.py messages: 129368 nosy: jerome.radix priority: normal severity: normal status: open title: Command line option -t (and -tt) does not work for a particular case type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file20889/test_tt.py ___ Python tracker <http://bugs.python.org/issue11319> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6792] Distutils-based installer does not detect 64bit versions of Python
Jérôme Radix added the comment: Could you please change the priority of this Issue to 'High' as this problem is a big annoyance for all Windows 64bits users which is a rather large niche of users (a niche getting larger and larger everyday), don't you think ? -- ___ Python tracker <http://bugs.python.org/issue6792> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6792] Distutils-based installer does not detect 64bit versions of Python
Changes by Jérôme Radix : -- nosy: +Jérôme Radix ___ Python tracker <http://bugs.python.org/issue6792> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com