html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,issue,performed_via_github_app https://github.com/simonw/datasette/pull/557#issuecomment-511625212,https://api.github.com/repos/simonw/datasette/issues/557,511625212,MDEyOklzc3VlQ29tbWVudDUxMTYyNTIxMg==,9599,2019-07-16T01:12:14Z,2019-07-16T01:12:14Z,OWNER,This looks useful for dealing with the `The process cannot access the file because it is being used by another process` error: https://stackoverflow.com/a/28032829,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",466996584, https://github.com/simonw/datasette/pull/557#issuecomment-511624403,https://api.github.com/repos/simonw/datasette/issues/557,511624403,MDEyOklzc3VlQ29tbWVudDUxMTYyNDQwMw==,9599,2019-07-16T01:07:27Z,2019-07-16T01:10:24Z,OWNER,"Woohoo! That got the tests running on Windows. They're pretty slow there unfortunately... and I'm seeing some failures. https://travis-ci.org/simonw/datasette/jobs/559205729 is the first run against Windows. ``` collected 353 items tests\test_cli.py ... [ 0%] tests\test_black.py . [ 1%] tests\test_api.py ..........F........................................... [ 16%] .....s..F..................FF...............F...... [ 30%] tests\test_cli.py F [ 31%] tests\test_csv.py ....... [ 33%] tests\test_database.py .... [ 34%] tests\test_docs.py ..................................................... [ 49%] .... [ 50%] tests\test_facets.py .....ss. [ 52%] tests\test_filters.py ........... [ 55%] tests\test_html.py ...FF.....FF..............................F.FF.F..... [ 70%] .....F [ 72%] tests\test_plugins.py ...............F [ 77%] tests\test_publish_cloudrun.py ..F. [ 78%] tests\test_publish_heroku.py ...FF [ 79%] tests\test_publish_now.py ...FF.. [ 81%] tests\test_utils.py .............................F...........FFF........ [ 96%] .............E [100%] =================================== ERRORS ==================================== ________ ERROR at teardown of test_format_bytes[1099511627776-1.0 TB] _________ @pytest.fixture(scope=""session"") def app_client(): > yield from make_app_client() ..\..\..\..\..\build\simonw\datasette\tests\fixtures.py:161: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp_tkydmmd' onerror = .onerror at 0x0000017D0230CAF8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp_tkydmmd\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ================================== FAILURES =================================== _____________________________ test_allow_sql_off ______________________________ def test_allow_sql_off(): > for client in make_app_client(config={""allow_sql"": False}): ..\..\..\..\build\simonw\datasette\tests\test_api.py:600: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp6pkccymo' onerror = .onerror at 0x0000017D0261FD38> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp6pkccymo\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError __________ test_table_filter_extra_where_disabled_if_no_sql_allowed ___________ def test_table_filter_extra_where_disabled_if_no_sql_allowed(): > for client in make_app_client(config={""allow_sql"": False}): ..\..\..\..\build\simonw\datasette\tests\test_api.py:1050: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpfa3zhjsq' onerror = .onerror at 0x0000017D025E0B88> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpfa3zhjsq\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ____________________________ test_allow_facet_off _____________________________ def test_allow_facet_off(): > for client in make_app_client(config={""allow_facet"": False}): ..\..\..\..\build\simonw\datasette\tests\test_api.py:1454: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpvap5inq5' onerror = .onerror at 0x0000017D025DAAF8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpvap5inq5\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ___________________________ test_suggest_facets_off ___________________________ def test_suggest_facets_off(): > for client in make_app_client(config={""suggest_facets"": False}): ..\..\..\..\build\simonw\datasette\tests\test_api.py:1461: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp7hn1_v44' onerror = .onerror at 0x0000017D0260C5E8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp7hn1_v44\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ________________________ test_config_force_https_urls _________________________ def test_config_force_https_urls(): > for client in make_app_client(config={""force_https_urls"": True}): ..\..\..\..\build\simonw\datasette\tests\test_api.py:1589: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpu3lq69xr' onerror = .onerror at 0x0000017D02825EE8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpu3lq69xr\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ________ test_serve_with_inspect_file_prepopulates_table_counts_cache _________ def test_serve_with_inspect_file_prepopulates_table_counts_cache(): inspect_data = {""fixtures"": {""tables"": {""hithere"": {""count"": 44}}}} > for client in make_app_client(inspect_data=inspect_data, is_immutable=True): ..\..\..\..\build\simonw\datasette\tests\test_cli.py:36: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpo65sp2ig' onerror = .onerror at 0x0000017D0240DC18> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpo65sp2ig\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError _____________________________ test_static_mounts ______________________________ def test_static_mounts(): for client in make_app_client( > static_mounts=[(""custom-static"", str(pathlib.Path(__file__).parent))] ): ..\..\..\..\build\simonw\datasette\tests\test_html.py:64: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpqv82mm64' onerror = .onerror at 0x0000017D0294FD38> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpqv82mm64\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ---------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 100, in __call__ return await view(new_scope, receive, send) File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 315, in inner_static await asgi_send_file(send, full_path, chunk_size=chunk_size) File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 296, in asgi_send_file {""type"": ""http.response.body"", ""body"": chunk, ""more_body"": more_body} File ""c:\python37\lib\site-packages\aiofiles\base.py"", line 92, in __aexit__ yield from self._obj.close() File ""c:\python37\lib\site-packages\aiofiles\threadpool\utils.py"", line 36, in method return (yield from self._loop.run_in_executor(self._executor, cb)) concurrent.futures._base.CancelledError __________________________ test_memory_database_page __________________________ def test_memory_database_page(): > for client in make_app_client(memory=True): ..\..\..\..\build\simonw\datasette\tests\test_html.py:75: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp6cagtj6v' onerror = .onerror at 0x0000017D040A2AF8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp6cagtj6v\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError _________________________ test_table_cell_truncation __________________________ def test_table_cell_truncation(): > for client in make_app_client(config={""truncate_cells_html"": 5}): ..\..\..\..\build\simonw\datasette\tests\test_html.py:123: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp1zz78pre' onerror = .onerror at 0x0000017D03DFD5E8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp1zz78pre\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError _______________________ test_row_page_does_not_truncate _______________________ def test_row_page_does_not_truncate(): > for client in make_app_client(config={""truncate_cells_html"": 5}): ..\..\..\..\build\simonw\datasette\tests\test_html.py:148: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpsukb573e' onerror = .onerror at 0x0000017D023B9AF8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpsukb573e\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ________________ test_database_download_allowed_for_immutable _________________ def test_database_download_allowed_for_immutable(): > for client in make_app_client(is_immutable=True): ..\..\..\..\build\simonw\datasette\tests\test_html.py:755: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpcivpcoop' onerror = .onerror at 0x0000017D02666A68> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpcivpcoop\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ---------------------------- Captured stderr call ----------------------------- Traceback (most recent call last): File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 100, in __call__ return await view(new_scope, receive, send) File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 174, in view await response.asgi_send(send) File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 383, in asgi_send return await asgi_send_file(send, self.filepath, content_type=self.content_type) File ""C:\Users\travis\build\simonw\datasette\datasette\utils\asgi.py"", line 296, in asgi_send_file {""type"": ""http.response.body"", ""body"": chunk, ""more_body"": more_body} File ""c:\python37\lib\site-packages\aiofiles\base.py"", line 92, in __aexit__ yield from self._obj.close() File ""c:\python37\lib\site-packages\aiofiles\threadpool\utils.py"", line 36, in method return (yield from self._loop.run_in_executor(self._executor, cb)) concurrent.futures._base.CancelledError ________________ test_database_download_disallowed_for_memory _________________ def test_database_download_disallowed_for_memory(): > for client in make_app_client(memory=True): ..\..\..\..\build\simonw\datasette\tests\test_html.py:773: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpvwpwrijf' onerror = .onerror at 0x0000017D02637D38> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpvwpwrijf\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ___________________________ test_allow_download_off ___________________________ def test_allow_download_off(): > for client in make_app_client(is_immutable=True, config={""allow_download"": False}): ..\..\..\..\build\simonw\datasette\tests\test_html.py:782: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpmz0s6rqz' onerror = .onerror at 0x0000017D03EFA1F8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpmz0s6rqz\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError _____________________________ test_allow_sql_off ______________________________ def test_allow_sql_off(): > for client in make_app_client(config={""allow_sql"": False}): ..\..\..\..\build\simonw\datasette\tests\test_html.py:800: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpmrr0edfk' onerror = .onerror at 0x0000017D03EFFD38> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpmrr0edfk\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError __________________________ test_custom_table_include __________________________ def test_custom_table_include(): for client in make_app_client( > template_dir=str(pathlib.Path(__file__).parent / ""test_templates"") ): ..\..\..\..\build\simonw\datasette\tests\test_html.py:973: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpxcd2zp24' onerror = .onerror at 0x0000017D03FFBD38> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpxcd2zp24\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ______________________ test_plugins_extra_template_vars _______________________ restore_working_directory = None def test_plugins_extra_template_vars(restore_working_directory): for client in make_app_client( > template_dir=str(pathlib.Path(__file__).parent / ""test_templates"") ): ..\..\..\..\build\simonw\datasette\tests\test_plugins.py:196: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ..\..\..\..\build\simonw\datasette\tests\fixtures.py:156: in make_app_client yield client c:\python37\lib\tempfile.py:805: in __exit__ self.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:400: in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpkjbhg_ho' onerror = .onerror at 0x0000017D03DB6DC8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: > os.unlink(fullname) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpkjbhg_ho\\fixtures.db' c:\python37\lib\shutil.py:398: PermissionError ____________________________ test_publish_cloudrun ____________________________ mock_call = mock_output = mock_which = @mock.patch(""shutil.which"") @mock.patch(""datasette.publish.cloudrun.check_output"") @mock.patch(""datasette.publish.cloudrun.check_call"") def test_publish_cloudrun(mock_call, mock_output, mock_which): mock_output.return_value = ""myproject"" mock_which.return_value = True runner = CliRunner() with runner.isolated_filesystem(): open(""test.db"", ""w"").write(""data"") result = runner.invoke(cli.cli, [""publish"", ""cloudrun"", ""test.db""]) > assert 0 == result.exit_code E AssertionError: assert 0 == 1 E + where 1 = .exit_code ..\..\..\..\build\simonw\datasette\tests\test_publish_cloudrun.py:37: AssertionError _____________________________ test_publish_heroku _____________________________ mock_call = mock_check_output = mock_which = @mock.patch(""shutil.which"") @mock.patch(""datasette.publish.heroku.check_output"") @mock.patch(""datasette.publish.heroku.call"") def test_publish_heroku(mock_call, mock_check_output, mock_which): mock_which.return_value = True mock_check_output.side_effect = lambda s: { ""['heroku', 'plugins']"": b""heroku-builds"", ""['heroku', 'apps:list', '--json']"": b""[]"", ""['heroku', 'apps:create', 'datasette', '--json']"": b'{""name"": ""f""}', }[repr(s)] runner = CliRunner() with runner.isolated_filesystem(): open(""test.db"", ""w"").write(""data"") result = runner.invoke(cli.cli, [""publish"", ""heroku"", ""test.db""]) > assert 0 == result.exit_code, result.output E AssertionError: E assert 0 == 1 E + where 1 = .exit_code ..\..\..\..\build\simonw\datasette\tests\test_publish_heroku.py:59: AssertionError _____________________ test_publish_heroku_plugin_secrets ______________________ mock_call = mock_check_output = mock_which = @mock.patch(""shutil.which"") @mock.patch(""datasette.publish.heroku.check_output"") @mock.patch(""datasette.publish.heroku.call"") def test_publish_heroku_plugin_secrets(mock_call, mock_check_output, mock_which): mock_which.return_value = True mock_check_output.side_effect = lambda s: { ""['heroku', 'plugins']"": b""heroku-builds"", ""['heroku', 'apps:list', '--json']"": b""[]"", ""['heroku', 'apps:create', 'datasette', '--json']"": b'{""name"": ""f""}', }[repr(s)] runner = CliRunner() with runner.isolated_filesystem(): open(""test.db"", ""w"").write(""data"") result = runner.invoke( cli.cli, [ ""publish"", ""heroku"", ""test.db"", ""--plugin-secret"", ""datasette-auth-github"", ""client_id"", ""x-client-id"", ], ) > assert 0 == result.exit_code, result.output E AssertionError: E assert 0 == 1 E + where 1 = .exit_code ..\..\..\..\build\simonw\datasette\tests\test_publish_heroku.py:90: AssertionError ______________________________ test_publish_now _______________________________ mock_run = mock_which = @mock.patch(""shutil.which"") @mock.patch(""datasette.publish.now.run"") def test_publish_now(mock_run, mock_which): mock_which.return_value = True runner = CliRunner() with runner.isolated_filesystem(): open(""test.db"", ""w"").write(""data"") result = runner.invoke(cli.cli, [""publish"", ""nowv1"", ""test.db""]) > assert 0 == result.exit_code E AssertionError: assert 0 == 1 E + where 1 = .exit_code ..\..\..\..\build\simonw\datasette\tests\test_publish_now.py:43: AssertionError ________________________ test_publish_now_force_token _________________________ mock_run = mock_which = @mock.patch(""shutil.which"") @mock.patch(""datasette.publish.now.run"") def test_publish_now_force_token(mock_run, mock_which): mock_which.return_value = True runner = CliRunner() with runner.isolated_filesystem(): open(""test.db"", ""w"").write(""data"") result = runner.invoke( cli.cli, [""publish"", ""nowv1"", ""test.db"", ""--force"", ""--token=X""] ) > assert 0 == result.exit_code E AssertionError: assert 0 == 1 E + where 1 = .exit_code ..\..\..\..\build\simonw\datasette\tests\test_publish_now.py:57: AssertionError _______________________________ test_detect_fts _______________________________ def test_detect_fts(): sql = """""" CREATE TABLE ""Dumb_Table"" ( ""TreeID"" INTEGER, ""qSpecies"" TEXT ); CREATE TABLE ""Street_Tree_List"" ( ""TreeID"" INTEGER, ""qSpecies"" TEXT, ""qAddress"" TEXT, ""SiteOrder"" INTEGER, ""qSiteInfo"" TEXT, ""PlantType"" TEXT, ""qCaretaker"" TEXT ); CREATE VIEW Test_View AS SELECT * FROM Dumb_Table; CREATE VIRTUAL TABLE ""Street_Tree_List_fts"" USING FTS4 (""qAddress"", ""qCaretaker"", ""qSpecies"", content=""Street_Tree_List""); CREATE VIRTUAL TABLE r USING rtree(a, b, c); """""" conn = utils.sqlite3.connect("":memory:"") > conn.executescript(sql) E sqlite3.OperationalError: no such module: rtree ..\..\..\..\build\simonw\datasette\tests\test_utils.py:182: OperationalError _______________ test_temporary_docker_directory_uses_hard_link ________________ def test_temporary_docker_directory_uses_hard_link(): with tempfile.TemporaryDirectory() as td: os.chdir(td) open(""hello"", ""w"").write(""world"") # Default usage of this should use symlink with utils.temporary_docker_directory( files=[""hello""], name=""t"", metadata=None, extra_options=None, branch=None, template_dir=None, plugins_dir=None, static=[], install=[], spatialite=False, version_note=None, ) as temp_docker: hello = os.path.join(temp_docker, ""hello"") assert ""world"" == open(hello).read() # It should be a hard link > assert 2 == os.stat(hello).st_nlink ..\..\..\..\..\build\simonw\datasette\tests\test_utils.py:239: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ c:\python37\lib\contextlib.py:119: in __exit__ next(self.gen) ..\..\..\..\..\build\simonw\datasette\datasette\utils\__init__.py:397: in temporary_docker_directory tmp.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:395: in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) c:\python37\lib\shutil.py:404: in _rmtree_unsafe onerror(os.rmdir, path, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp0g07cby1\\t' onerror = .onerror at 0x0000017D0230C5E8> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: os.unlink(fullname) except OSError: onerror(os.unlink, fullname, sys.exc_info()) try: > os.rmdir(path) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmp0g07cby1\\t' c:\python37\lib\shutil.py:402: PermissionError ________ test_temporary_docker_directory_uses_copy_if_hard_link_fails _________ mock_link = @patch(""os.link"") def test_temporary_docker_directory_uses_copy_if_hard_link_fails(mock_link): # Copy instead if os.link raises OSError (normally due to different device) mock_link.side_effect = OSError with tempfile.TemporaryDirectory() as td: os.chdir(td) open(""hello"", ""w"").write(""world"") # Default usage of this should use symlink with utils.temporary_docker_directory( files=[""hello""], name=""t"", metadata=None, extra_options=None, branch=None, template_dir=None, plugins_dir=None, static=[], install=[], spatialite=False, version_note=None, ) as temp_docker: hello = os.path.join(temp_docker, ""hello"") assert ""world"" == open(hello).read() # It should be a copy, not a hard link > assert 1 == os.stat(hello).st_nlink ..\..\..\..\..\build\simonw\datasette\tests\test_utils.py:266: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ c:\python37\lib\contextlib.py:119: in __exit__ next(self.gen) ..\..\..\..\..\build\simonw\datasette\datasette\utils\__init__.py:397: in temporary_docker_directory tmp.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:395: in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) c:\python37\lib\shutil.py:404: in _rmtree_unsafe onerror(os.rmdir, path, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpywj5p10g\\t' onerror = .onerror at 0x0000017D0230C558> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: os.unlink(fullname) except OSError: onerror(os.unlink, fullname, sys.exc_info()) try: > os.rmdir(path) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmpywj5p10g\\t' c:\python37\lib\shutil.py:402: PermissionError _________________ test_temporary_docker_directory_quotes_args _________________ def test_temporary_docker_directory_quotes_args(): with tempfile.TemporaryDirectory() as td: os.chdir(td) open(""hello"", ""w"").write(""world"") with utils.temporary_docker_directory( files=[""hello""], name=""t"", metadata=None, extra_options=""--$HOME"", branch=None, template_dir=None, plugins_dir=None, static=[], install=[], spatialite=False, version_note=""$PWD"", ) as temp_docker: df = os.path.join(temp_docker, ""Dockerfile"") df_contents = open(df).read() assert ""'$PWD'"" in df_contents > assert ""'--$HOME'"" in df_contents ..\..\..\..\..\build\simonw\datasette\tests\test_utils.py:289: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ c:\python37\lib\contextlib.py:119: in __exit__ next(self.gen) ..\..\..\..\..\build\simonw\datasette\datasette\utils\__init__.py:397: in temporary_docker_directory tmp.cleanup() c:\python37\lib\tempfile.py:809: in cleanup _shutil.rmtree(self.name) c:\python37\lib\shutil.py:516: in rmtree return _rmtree_unsafe(path, onerror) c:\python37\lib\shutil.py:395: in _rmtree_unsafe _rmtree_unsafe(fullname, onerror) c:\python37\lib\shutil.py:404: in _rmtree_unsafe onerror(os.rmdir, path, sys.exc_info()) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ path = 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmps8mll2fo\\t' onerror = .onerror at 0x0000017D0230C948> def _rmtree_unsafe(path, onerror): try: with os.scandir(path) as scandir_it: entries = list(scandir_it) except OSError: onerror(os.scandir, path, sys.exc_info()) entries = [] for entry in entries: fullname = entry.path try: is_dir = entry.is_dir(follow_symlinks=False) except OSError: is_dir = False if is_dir: try: if entry.is_symlink(): # This can only happen if someone replaces # a directory with a symlink after the call to # os.scandir or entry.is_dir above. raise OSError(""Cannot call rmtree on a symbolic link"") except OSError: onerror(os.path.islink, fullname, sys.exc_info()) continue _rmtree_unsafe(fullname, onerror) else: try: os.unlink(fullname) except OSError: onerror(os.unlink, fullname, sys.exc_info()) try: > os.rmdir(path) E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\travis\\AppData\\Local\\Temp\\tmps8mll2fo\\t' c:\python37\lib\shutil.py:402: PermissionError ========= 25 failed, 325 passed, 3 skipped, 1 error in 476.71 seconds ========= travis_time:end:07fbb22c:start=1563238899952083900,finish=1563239378532569000,duration=478580485100 The command ""pytest"" exited with 1. ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",466996584,