{"action":"created","issue":{"url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/issues/1484","repository_url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer","labels_url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/issues/1484/comments","events_url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/issues/1484/events","html_url":"https://github.com/overviewer/Minecraft-Overviewer/issues/1484","id":364577958,"node_id":"MDU6SXNzdWUzNjQ1Nzc5NTg=","number":1484,"title":"Fails if Output is on a Samba Share","user":{"login":"Enverex","id":958670,"node_id":"MDQ6VXNlcjk1ODY3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/958670?v=4","gravatar_id":"","url":"https://api.github.com/users/Enverex","html_url":"https://github.com/Enverex","followers_url":"https://api.github.com/users/Enverex/followers","following_url":"https://api.github.com/users/Enverex/following{/other_user}","gists_url":"https://api.github.com/users/Enverex/gists{/gist_id}","starred_url":"https://api.github.com/users/Enverex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Enverex/subscriptions","organizations_url":"https://api.github.com/users/Enverex/orgs","repos_url":"https://api.github.com/users/Enverex/repos","events_url":"https://api.github.com/users/Enverex/events{/privacy}","received_events_url":"https://api.github.com/users/Enverex/received_events","type":"User","site_admin":false},"labels":[{"id":25859934,"node_id":"MDU6TGFiZWwyNTg1OTkzNA==","url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/labels/Bug","name":"Bug","color":"e10c02","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-27T17:29:20Z","updated_at":"2018-09-27T19:35:51Z","closed_at":null,"author_association":"NONE","body":"Running on a Linux client with a mounted Samba share (a Linux server) causes the generator to throw an error.\r\n\r\n```\r\n[06:27:21] arcade@arcade ~/Games/Minecraft-ATM3 $ overviewer.py \"Acai\" /mnt/emerald/Web/http/mcmap/\r\n2018-09-27 18:27:25  Welcome to Minecraft Overviewer!\r\n2018-09-27 18:27:25 E An error has occurred. This may be a bug. Please let us know!\r\nSee http://docs.overviewer.org/en/latest/index.html#help\r\n\r\nThis is the error that occurred:\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/overviewer.py\", line 624, in <module>\r\n    ret = main()\r\n  File \"/usr/bin/overviewer.py\", line 427, in main\r\n    assetMrg = assetmanager.AssetManager(destdir, config.get('customwebassets', None))\r\n  File \"/usr/lib/python2.7/site-packages/overviewer_core/assetmanager.py\", line 48, in __init__\r\n    self.fs_caps = get_fs_caps(self.outputdir)\r\n  File \"/usr/lib/python2.7/site-packages/overviewer_core/files.py\", line 28, in get_fs_caps\r\n    \"rename_works\": does_rename_work(dir_to_test)\r\n  File \"/usr/lib/python2.7/site-packages/overviewer_core/files.py\", line 61, in does_rename_work\r\n    open(f1.name, 'w').close()\r\n  File \"/usr/lib/python2.7/tempfile.py\", line 440, in __exit__\r\n    self.close()\r\n  File \"/usr/lib/python2.7/tempfile.py\", line 431, in close\r\n    self.unlink(self.name)\r\nOSError: [Errno 2] No such file or directory: '/mnt/emerald/Web/http/mcmap/tmpMvkQBJ'\r\n```\r\n\r\nWorks fine if I use a local folder instead. Permissions are fine on the share, I can (as this user) create, move, delete files and folders, etc."},"comment":{"url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/issues/comments/425216797","html_url":"https://github.com/overviewer/Minecraft-Overviewer/issues/1484#issuecomment-425216797","issue_url":"https://api.github.com/repos/overviewer/Minecraft-Overviewer/issues/1484","id":425216797,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTIxNjc5Nw==","user":{"login":"CounterPillow","id":308818,"node_id":"MDQ6VXNlcjMwODgxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/308818?v=4","gravatar_id":"","url":"https://api.github.com/users/CounterPillow","html_url":"https://github.com/CounterPillow","followers_url":"https://api.github.com/users/CounterPillow/followers","following_url":"https://api.github.com/users/CounterPillow/following{/other_user}","gists_url":"https://api.github.com/users/CounterPillow/gists{/gist_id}","starred_url":"https://api.github.com/users/CounterPillow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CounterPillow/subscriptions","organizations_url":"https://api.github.com/users/CounterPillow/orgs","repos_url":"https://api.github.com/users/CounterPillow/repos","events_url":"https://api.github.com/users/CounterPillow/events{/privacy}","received_events_url":"https://api.github.com/users/CounterPillow/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T19:35:51Z","updated_at":"2018-09-27T19:35:51Z","author_association":"MEMBER","body":"can you try this untested patch and tell me whether this fixes the issue?\r\n\r\n```patch\r\ndiff --git a/overviewer_core/files.py b/overviewer_core/files.py\r\nindex 15647fe..ea68cb1 100644\r\n--- a/overviewer_core/files.py\r\n+++ b/overviewer_core/files.py\r\n@@ -47,18 +47,22 @@ def does_chmod_work(dir_to_test):\r\n     return chmod_works\r\n \r\n def does_rename_work(dir_to_test):\r\n-    with tempfile.NamedTemporaryFile(dir=dir_to_test) as f1:\r\n-        with tempfile.NamedTemporaryFile(dir=dir_to_test) as f2:\r\n-            try:\r\n-                os.rename(f1.name,f2.name)\r\n-            except OSError:\r\n-                renameworks = False\r\n-                logging.debug(\"Detected that overwriting renames do NOT work in %r\" % dir_to_test)\r\n-            else:\r\n-                renameworks = True\r\n-                logging.debug(\"Detected that overwriting renames work in %r\" % dir_to_test)\r\n-                # re-make this file so it can be deleted without error\r\n-                open(f1.name, 'w').close()\r\n+    f1 = tempfile.NamedTemporaryFile(dir=dir_to_test)\r\n+    f2 = tempfile.NamedTemporaryFile(dir=dir_to_test)\r\n+    try:\r\n+        os.rename(f1.name,f2.name)\r\n+    except OSError:\r\n+        renameworks = False\r\n+        logging.debug(\"Detected that overwriting renames do NOT work in %r\" % dir_to_test)\r\n+    else:\r\n+        renameworks = True\r\n+        logging.debug(\"Detected that overwriting renames work in %r\" % dir_to_test)\r\n+    finally:\r\n+        try:\r\n+            f1.close()\r\n+        except OSError:\r\n+            pass\r\n+        f2.close()\r\n     return renameworks\r\n \r\n ## useful recursive copy, that ignores common OS cruft\r\n```"}}
{"actor":{"display_login":"CounterPillow"}}