Title: Pre-commit install fails on Windows network mount drive · Issue #1802 · pre-commit/pre-commit · GitHub
Open Graph Title: Pre-commit install fails on Windows network mount drive · Issue #1802 · pre-commit/pre-commit
X Title: Pre-commit install fails on Windows network mount drive · Issue #1802 · pre-commit/pre-commit
Description: Hi, I'm trying to help some team members set up pre-commit on a Windows network mount drive, and they're encountering an issue with paths. Seems related to this comment in #1610, which seems to be a different issue than the one the origi...
Open Graph Description: Hi, I'm trying to help some team members set up pre-commit on a Windows network mount drive, and they're encountering an issue with paths. Seems related to this comment in #1610, which seems to be ...
X Description: Hi, I'm trying to help some team members set up pre-commit on a Windows network mount drive, and they're encountering an issue with paths. Seems related to this comment in #1610, which seem...
Opengraph URL: https://github.com/pre-commit/pre-commit/issues/1802
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Pre-commit install fails on Windows network mount drive","articleBody":"Hi, I'm trying to help some team members set up pre-commit on a Windows network mount drive, and they're encountering an issue with paths. Seems related to [this comment](https://github.com/pre-commit/pre-commit/issues/1610#issuecomment-719774326) in #1610, which seems to be a different issue than the one the original issue, as we are on the most recent version of pre-commit and git, and the fix that was merged in #1727 for that doesn't seem to address this issue. I also tried other versions of Git for Windows \u003c2.25, and the issue still seemed to persist.\r\n\r\nI tested the solution that @christopherdoyle proposed, and that does seems to fix this issue with network mount drives, though I saw that @asottile would prefer not to use `pathlib`. I am not able to propose a fix right now, but I wanted to raise this as an issue that still exists.\r\n\r\nFull error below:\r\n\r\n```\r\n ### version information\r\n \r\n ```\r\n pre-commit version: 2.10.1\r\n sys.version:\r\n 3.9.1 | packaged by conda-forge | (default, Jan 26 2021, 01:29:07) [MSC v.1916 64 bit (AMD64)]\r\n sys.executable: C:\\Users\\roderick\\.conda\\envs\\nmt\\python.exe\r\n os.name: nt\r\n sys.platform: win32\r\n ```\r\n \r\n ### error information\r\n \r\n ```\r\n An unexpected error has occurred: ValueError: path is on mount 'S:', start on mount '\\\\\\\\MyServer\\Directory'\r\n ```\r\n \r\n ```\r\n Traceback (most recent call last):\r\n File \"C:\\Users\\roderick\\.conda\\envs\\nmt\\lib\\site-packages\\pre_commit\\error_handler.py\", line 65, in error_handler\r\n yield\r\n File \"C:\\Users\\roderick\\.conda\\envs\\nmt\\lib\\site-packages\\pre_commit\\main.py\", line 333, in main\r\n _adjust_args_and_chdir(args)\r\n File \"C:\\Users\\roderick\\.conda\\envs\\nmt\\lib\\site-packages\\pre_commit\\main.py\", line 153, in _adjust_args_and_chdir\r\n args.config = os.path.relpath(args.config)\r\n File \"C:\\Users\\roderick\\.conda\\envs\\nmt\\lib\\ntpath.py\", line 703, in relpath\r\n raise ValueError(\"path is on mount %r, start on mount %r\" % (\r\n ValueError: path is on mount 'S:', start on mount '\\\\\\\\MyServer\\Directory'\r\n```\r\n\r\n```","author":{"url":"https://github.com/goroderickgo","@type":"Person","name":"goroderickgo"},"datePublished":"2021-02-17T14:52:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/1802/pre-commit/issues/1802"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4a99981d-1c64-3f0d-fb2d-e98bab9215f5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8470:3DA7AC:10F4413:1776C9C:6A55D2F4 |
| html-safe-nonce | 310139e2760142b3b17aceb84146ae36a9972348338663bb3e73770ee1d0bd00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDcwOjNEQTdBQzoxMEY0NDEzOjE3NzZDOUM6NkE1NUQyRjQiLCJ2aXNpdG9yX2lkIjoiNjg4NTkyODk5NjUyMzMzMjM0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 69bf4f64a64501ec58b14c186d7d0edeb079b2ae4615d1ede8d963ad1bad43ae |
| hovercard-subject-tag | issue:810253634 |
| github-keyboard-shortcuts | repository,issues,commits,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/1802/issue_layout |
| twitter:image | https://opengraph.githubassets.com/daf9bea572732ffcc9603973591aaa1905bf4715320549f3a739b8275798c8aa/pre-commit/pre-commit/issues/1802 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/daf9bea572732ffcc9603973591aaa1905bf4715320549f3a739b8275798c8aa/pre-commit/pre-commit/issues/1802 |
| og:image:alt | Hi, I'm trying to help some team members set up pre-commit on a Windows network mount drive, and they're encountering an issue with paths. Seems related to this comment in #1610, which seems to be ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | goroderickgo |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5665c84831ed9ac4fb79519c16c9c5580ba8092fb8bb6e3e72972ec7197348e |
| turbo-cache-control | no-preview |
| go-import | github.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git |
| octolytics-dimension-user_id | 6943086 |
| octolytics-dimension-user_login | pre-commit |
| octolytics-dimension-repository_id | 17689377 |
| octolytics-dimension-repository_nwo | pre-commit/pre-commit |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 17689377 |
| octolytics-dimension-repository_network_root_nwo | pre-commit/pre-commit |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8f8e1726192df8dce16872ceb503336c12e9ae78 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width