[issue40160] documentation example of os.walk should be less destructive
New submission from John Taylor : The example for os.walkdir should be less destructive. It currently recursively removes all files and directories. I will be submitting a PR on GitHub. -- assignee: docs@python components: Documentation messages: 365625 nosy: docs@python, jftuga priority: normal severity: normal status: open title: documentation example of os.walk should be less destructive versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue40160> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40160] documentation example of os.walk should be less destructive
John Taylor added the comment: https://github.com/python/cpython/pull/19313 I have just signed the CLA. -- ___ Python tracker <https://bugs.python.org/issue40160> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40160] documentation example of os.walk should be less destructive
John Taylor added the comment: I would prefer an example that does not actually modify the file system. Is there any way this could be achieved, yet still demonstrate why topdown=False is necessary? -- ___ Python tracker <https://bugs.python.org/issue40160> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40160] documentation example of os.walk should be less destructive
John Taylor added the comment: I made the suggested change to just print the os.remove() statements (instead of executing them) and also removed the 'skip news'. -- ___ Python tracker <https://bugs.python.org/issue40160> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29284] Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1
John Taylor added the comment: Bump -- ___ Python tracker <http://bugs.python.org/issue29284> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29284] Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1
John Taylor added the comment: Can this be added to Python 3.7? https://docs.python.org/3.7/library/concurrent.futures.html#threadpoolexecutor-example Thanks. -- ___ Python tracker <http://bugs.python.org/issue29284> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15754] Traceback message not returning SQLite check constraint details
New submission from John Taylor: According to: http://www.sqlite.org/releaselog/3_7_12.html SQLite has the ability to, "Report the name of specific CHECK constraints that fail." CPython 3.3.0b2 which uses SQLite version 3.7.12 does not report which constraint failed. -- import platform, sqlite3 print("Platform : %s %s" % (platform.python_implementation(),platform.python_version())) print("SQLite : %s" % (sqlite3.sqlite_version)) print() tbl="""\ create table test1 ( db_insert_date timestamp, check( cast(substr(db_insert_date,1,4) as integer) >= 2000 and cast(substr(db_insert_date,1,4) as integer) <= 2025), check( cast(substr(db_insert_date,6,2) as integer) >= 1and cast(substr(db_insert_date,6,2) as integer) <= 12), check( cast(substr(db_insert_date,9,2) as integer) >= 1and cast(substr(db_insert_date,9,2) as integer) <= 31) ) """ conn = sqlite3.connect(":memory:") c = conn.cursor() c.execute(tbl) query = "insert into test1 values( ? )" c.execute(query, ("2012-08-20", ) ) conn.commit() # this works c.execute(query, ("2012-18-20", ) ) conn.commit() # returns: sqlite3.IntegrityError: constraint failed (but which constraint?) """ Traceback (most recent call last): File "C:bug.py", line 34, in c.execute(query, ("2012-18-20", ) ) sqlite3.IntegrityError: constraint failed """ -- components: Extension Modules messages: 168777 nosy: ghaering, jftuga priority: normal severity: normal status: open title: Traceback message not returning SQLite check constraint details type: behavior versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue15754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15754] Traceback message not returning SQLite check constraint details
John Taylor added the comment: When I run this under Windows 7: Platform : CPython 3.3.0b2 SQLite : 3.7.12 Traceback (most recent call last): File "C:bug.py", line 34, in c.execute(query, ("2012-18-20", ) ) sqlite3.IntegrityError: constraint failed -- ___ Python tracker <http://bugs.python.org/issue15754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15754] Traceback message not returning SQLite check constraint details
John Taylor added the comment: I believe patching Python is beyond my programming capability. I would be very interested in seeing this in 3.3.1. How else could I assist in making this happen? Thanks! -- ___ Python tracker <http://bugs.python.org/issue15754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15754] Traceback message not returning SQLite check constraint details
John Taylor added the comment: Chris, I will try naming the constraints and will then follow-up. -- ___ Python tracker <http://bugs.python.org/issue15754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15754] Traceback message not returning SQLite check constraint details
John Taylor added the comment: Please close this ticket. This is not a bug. As per cjerdonek's suggestion, defining a constraint as follows: constraint my_name check (...) returns the actual name of the constraint, when it fails: sqlite3.IntegrityError: constraint my_name failed -- resolution: -> works for me status: open -> closed ___ Python tracker <http://bugs.python.org/issue15754> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15972] wrong error message for os.path.getsize
New submission from John Taylor: import os.path a = [ r'c:\Windows\notepad.exe' ] print( os.path.getsize(a) ) Under Python 3.2.3, this error message is returned: File "c:\python32\lib\genericpath.py", line 49, in getsize return os.stat(filename).st_size TypeError: Can't convert 'list' object to str implicitly Under Python 3.3.0rc2, this error message is returned: File "c:\Python33\lib\genericpath.py", line 49, in getsize return os.stat(filename).st_size TypeError: an integer is required I feel like the 3.2.3 behavior is more accurate and would like to propose that the 3.3 error message says something about a list instead of an integer. -- components: Extension Modules messages: 170726 nosy: jftuga priority: normal severity: normal status: open title: wrong error message for os.path.getsize type: behavior versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue15972> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15973] Segmentation fault on timezone comparison
John Taylor added the comment: Crashes Python 3.2.3 and Python 3.3.0rc2 on Windows 7 as well. -- nosy: +jftuga ___ Python tracker <http://bugs.python.org/issue15973> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15972] wrong error message for os.path.getsize
John Taylor added the comment: OP here. These error messages are much better. Thanks! -- ___ Python tracker <http://bugs.python.org/issue15972> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29284] Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1
New submission from John Taylor: Please include how to use the thread_name_prefix method argument (new to Python 3.6) in the example: 17.4.2.1. ThreadPoolExecutor Example -- assignee: docs@python components: Documentation messages: 285572 nosy: docs@python, jftuga priority: normal severity: normal status: open title: Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1 type: enhancement versions: Python 3.6 ___ Python tracker <http://bugs.python.org/issue29284> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29285] Unicode errors occur inside of multi-line comments
New submission from John Taylor: I am using Python 3.5.2 on OS X 10.11.6. The same error occurs with 3.5.2 on Windows 10. When I run the attached code, I get this error: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 23-24: truncated \u escape I think unicode processing should be ignored inside of multiline comments. Inside of my comments, I really want to use this text verbatim. -- components: Interpreter Core files: example.py messages: 285573 nosy: jftuga priority: normal severity: normal status: open title: Unicode errors occur inside of multi-line comments type: behavior versions: Python 3.5 Added file: http://bugs.python.org/file46303/example.py ___ Python tracker <http://bugs.python.org/issue29285> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29285] Unicode errors occur inside of multi-line comments
John Taylor added the comment: OP here, thanks for replying to this. I used Zach's suggestion of placing an 'r' in front of triple-quotes. This accomplishes my goal. -- ___ Python tracker <http://bugs.python.org/issue29285> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29284] Include thread_name_prefix in the concurrent.futures.ThreadPoolExecutor example 17.4.2.1
John Taylor added the comment: I have updated the Python 3.6 example for 17.4.2.1. ThreadPoolExecutor Example. Please see the attachment. On my system this is the output: thread name: loader_0 thread name: loader_1 thread name: loader_2 thread name: loader_3 thread name: loader_4 'http://example.com/' page is 1270 bytes 'http://www.foxnews.com/' page is 67351 bytes 'http://www.cnn.com/' page is 137164 bytes 'http://europe.wsj.com/' page is 914169 bytes 'http://www.bbc.co.uk/' page is 229503 bytes Could you please consider adding this to the official documentation? -- Added file: http://bugs.python.org/file46377/ThreadPoolExec_Example.py ___ Python tracker <http://bugs.python.org/issue29284> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21253] unittest assertSequenceEqual can lead to Difflib.compare() crashing on mostly different sequences
John Taylor added the comment: I am seeing something similar in difflib.HtmlDiff.make_file() under Python 3.4.3 (windows 7). Do I need to file a separate bug report? File "H:\test\test.py", line 522, in print_differ diff = html.make_file(file1_data,file2_data,"dir 1","dir 2",True) File "C:\Python34\lib\difflib.py", line 1713, in make_file context=context,numlines=numlines)) File "C:\Python34\lib\difflib.py", line 1962, in make_table fromlist,tolist,flaglist = self._collect_lines(diffs) File "C:\Python34\lib\difflib.py", line 1830, in _collect_lines for fromdata,todata,flag in diffs: File "C:\Python34\lib\difflib.py", line 1806, in _line_wrapper self._split_line(fromlist,fromline,fromtext) File "C:\Python34\lib\difflib.py", line 1791, in _split_line self._split_line(data_list,'>',line2) (repeated many times) File "C:\Python34\lib\difflib.py", line 1791, in _split_line self._split_line(data_list,'>',line2) File "C:\Python34\lib\difflib.py", line 1755, in _split_line if (size <= max) or ((size -(text.count('\0')*3)) <= max): RuntimeError: maximum recursion depth exceeded in comparison -- nosy: +jftuga ___ Python tracker <http://bugs.python.org/issue21253> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24904] Patch: add timeout to difflib SequenceMatcher ratio() and quick_ratio()
New submission from John Taylor: SequenceMatcher in the difflib module contain ratio() and quick_ratio() methods which can take a long time to run with certain input. One example is two slightly different versions of jquery.min.js. I have written a patch against python-350b4 that adds a timeout to these methods. The new functionality also has the capability to "fall through" to the next quickest comparison method should a timeout occur. If a timeout does occur and using a fall through method is not desired, then -1 is returned for the ratio. I'd like this to be incorporated into Python 3.5.0 if it is not too late. -- components: Library (Lib) files: difflib-diff.patch keywords: patch messages: 248919 nosy: jftuga priority: normal severity: normal status: open title: Patch: add timeout to difflib SequenceMatcher ratio() and quick_ratio() type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file40217/difflib-diff.patch ___ Python tracker <http://bugs.python.org/issue24904> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25169] multiprocess documentation
New submission from John Taylor: In the Windows Help File for Python 3.5: 17.2 multiprocessing 17.2.1.1 The Process class 2nd code example: "To show the individual process IDs involved, here is an expanded example" def info(title): print(title) print('module name:', __name__) if hasattr(os, 'getppid'): # only available on Unix print('parent process:', os.getppid()) print('process id:', os.getpid()) os.getppid() is now available on Windows, so you can remove the if statement. -- assignee: docs@python components: Documentation messages: 251002 nosy: docs@python, jftuga priority: normal severity: normal status: open title: multiprocess documentation versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue25169> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25169] multiprocess documentation
John Taylor added the comment: To follow up on my previous message, I looked at the documentation for os.getppid(). It states: Changed in version 3.2: Added support for Windows. -- ___ Python tracker <http://bugs.python.org/issue25169> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26422] printing 1e23 and up is incorrect
New submission from John Taylor: The print statement does not display accurate results. code: print("%35d" % (1e21)) print("%35d" % (1e22)) print("%35d" % (1e23)) print("%35d" % (1e24)) print("%35d" % (1e25)) print("%35d" % (1e26)) print("%35d" % (1e27)) print("%35d" % (1e28)) print("%35d" % (1e29)) print("%35d" % (1e30)) print("%35d" % (1e31)) result: 10 100 1611392 83222784 1905969664 14764729344 113287555072 583119736832 1433150857216 119884624838656 635896294965248 Platforms: Windows 10 x64, Python 3.5.1 Debian 8 (jessie), Python 3.5.1 -- messages: 260745 nosy: jftuga priority: normal severity: normal status: open title: printing 1e23 and up is incorrect type: behavior versions: Python 3.5 ___ Python tracker <http://bugs.python.org/issue26422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28467] Installer should be a 64-bit executable
New submission from John Taylor: The python-3.6.0b2-amd64.exe binary installs the 64-bit version of python, but the binary itself is only 32-bit. I would like this to be a 64-bit binary so that Python can easily be installed on Windows Server 2016 Nano Server. Since this OS version will only execute 64-bit binaries, Python can not be installed even with the /quiet option. Ideally, I would like to be able to install Python with this command: python-3.6.0b2-amd64.exe /quiet targetdir=C:\Python36 -- components: Installation messages: 278844 nosy: jftuga priority: normal severity: normal status: open title: Installer should be a 64-bit executable type: behavior versions: Python 3.6 ___ Python tracker <http://bugs.python.org/issue28467> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28467] Installer should be a 64-bit executable
John Taylor added the comment: python-3.6.0b2-embed-amd64.zip will load the interpreter as is easy to install. The Python Embedded Distribution documentation mentions needing ucrtbase.dll, which is already installed on Nano Server. One small pain point is that ctrl-z seems to exit/suspend the docker container and drop you back to the host. Under the normal, non-embedded python, you can just run exit() to quit the interpreter. Since this option is not available under the embedded version, you have to import sys; sys.exit() to quit the interpreter under Nano Server. Also, there is no pip.exe. Thank you for the information regarding MSI which I was not aware of. Upon further consideration, I believe this issue can be closed because the embedded distribution works on Nano Server. -- ___ Python tracker <http://bugs.python.org/issue28467> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com