Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_unannex_etc fails on windows #7440

Closed
yarikoptic opened this issue Jun 27, 2023 · 7 comments · Fixed by #7443
Closed

test_unannex_etc fails on windows #7440

yarikoptic opened this issue Jun 27, 2023 · 7 comments · Fixed by #7443
Labels
platform-windows Issue concerned with Windows test-failure For new or recurring failures of tests during CI runs

Comments

@yarikoptic
Copy link
Member

After all fixes for recent git-annex we have 1 still failing on windows in datalad/git-annex tests

2023-06-27T05:58:34.9096187Z ______________________________ test_unannex_etc _______________________________
2023-06-27T05:58:34.9096461Z 
2023-06-27T05:58:34.9097707Z path = 'C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\datalad_temp_tree_z3nmgwld'
2023-06-27T05:58:34.9100281Z 
2023-06-27T05:58:34.9100481Z     @with_tree(tree=_test_unannex_tree)
2023-06-27T05:58:34.9100866Z     def test_unannex_etc(path=None):
2023-06-27T05:58:34.9101244Z         # Primarily to test if quote/unquote/not-quote'ing work for tricky
2023-06-27T05:58:34.9101904Z         # filenames. Ref: https://github.com/datalad/datalad/pull/7372
2023-06-27T05:58:34.9102316Z         repo = AnnexRepo(path)
2023-06-27T05:58:34.9103249Z         files = list(_test_unannex_tree)
2023-06-27T05:58:34.9103745Z         # here it is through json so kinda guaranteed to work but let's check too
2023-06-27T05:58:34.9104517Z         assert files == [x['file'] for x in repo.add(files)]
2023-06-27T05:58:34.9104939Z         assert sorted(files) == sorted(repo.get_annexed_files())
2023-06-27T05:58:34.9105686Z >       assert files == repo.unannex(files)
2023-06-27T05:58:34.9106068Z 
2023-06-27T05:58:34.9106551Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\support\tests\test_annexrepo.py:2424: 
2023-06-27T05:58:34.9107035Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2023-06-27T05:58:34.9108115Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\support\gitrepo.py:365: in _wrap_normalize_paths
2023-06-27T05:58:34.9108921Z     result = func(self, files_new, *args, **kwargs)
2023-06-27T05:58:34.9109903Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\support\annexrepo.py:1937: in unannex
2023-06-27T05:58:34.9110416Z     return [
2023-06-27T05:58:34.9110863Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\support\annexrepo.py:1939: in <listcomp>
2023-06-27T05:58:34.9111704Z     self._unquote_annex_path(line[len(prefix) + 1 : -(len(suffix) + 1)])
2023-06-27T05:58:34.9112117Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
2023-06-27T05:58:34.9112324Z 
2023-06-27T05:58:34.9112518Z cls = <class 'datalad.support.annexrepo.AnnexRepo'>, s = ";&%b5{}'.datc"
2023-06-27T05:58:34.9113145Z 
2023-06-27T05:58:34.9113815Z     @classmethod
2023-06-27T05:58:34.9114210Z     def _unquote_annex_path(cls, s):
2023-06-27T05:58:34.9114620Z         """Remove surrounding "" around the filename, and unquote \"
2023-06-27T05:58:34.9114917Z     
2023-06-27T05:58:34.9115398Z         This is minimal necessary transformation of the quoted filename in care of
2023-06-27T05:58:34.9115898Z         core.quotepath=false, i.e. whenever all unicode characters remain as is.
2023-06-27T05:58:34.9116263Z     
2023-06-27T05:58:34.9116594Z         All interfaces should aim to operate on --json machine readable output,
2023-06-27T05:58:34.9117270Z         so we are not striving to have it super efficient here since should not be used
2023-06-27T05:58:34.9117875Z         often.
2023-06-27T05:58:34.9118247Z         """
2023-06-27T05:58:34.9119109Z         respected = cls._check_version_kludges('quotepath-respected')
2023-06-27T05:58:34.9119507Z         if respected == 'no':
2023-06-27T05:58:34.9119761Z             return s
2023-06-27T05:58:34.9120486Z         quoted = s.startswith('"') and s.endswith('"')
2023-06-27T05:58:34.9121083Z         if respected == 'maybe':
2023-06-27T05:58:34.9121478Z             # not necessarily correct if e.g. filename has "" around it originally
2023-06-27T05:58:34.9122056Z             # but this is a check only for a range of development versions, so mostly
2023-06-27T05:58:34.9122633Z             # for local/CI runs ATM
2023-06-27T05:58:34.9122951Z             if not quoted:
2023-06-27T05:58:34.9123200Z                 return s
2023-06-27T05:58:34.9123514Z         elif respected == 'yes':
2023-06-27T05:58:34.9123849Z >           assert quoted
2023-06-27T05:58:34.9124587Z E           AssertionError
2023-06-27T05:58:34.9124793Z 
2023-06-27T05:58:34.9125141Z C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\support\annexrepo.py:589: AssertionError
2023-06-27T05:58:34.9125673Z ============================== warnings summary ===============================
2023-06-27T05:58:34.9126147Z distributed/tests/test_ria_basics.py::test_initremote_basic_httpsurl
2023-06-27T05:58:34.9126604Z tests/test_tests_utils_pytest.py::test_serve_path_via_http[True-None-test1.txt]
2023-06-27T05:58:34.9127127Z tests/test_tests_utils_pytest.py::test_serve_path_via_http[True-None-test_fpath1]
2023-06-27T05:58:34.9127634Z tests/test_tests_utils_pytest.py::test_serve_path_via_http[True-None-test_fpath2]
2023-06-27T05:58:34.9128417Z tests/test_tests_utils_pytest.py::test_serve_path_via_http[True-None-file with space test4]
2023-06-27T05:58:34.9129722Z tests/test_tests_utils_pytest.py::test_serve_path_via_http[True-None-\u0414\u0436\u044d\u0439\u0441\u043e\u043d]
2023-06-27T05:58:34.9130389Z tests/test_tests_utils_pytest.py::test_serve_path_via_http[True-None-;&%b5{}'.datc]
2023-06-27T05:58:34.9131741Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\urllib3\connection.py:463: SubjectAltNameWarning: Certificate for localhost has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/urllib3/urllib3/issues/497 for details.)
2023-06-27T05:58:34.9132785Z     warnings.warn(
2023-06-27T05:58:34.9132917Z 
2023-06-27T05:58:34.9133186Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete
2023-06-27T05:58:34.9134077Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:895: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9135445Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete is using nose-specific method: `setup(self)`
2023-06-27T05:58:34.9136271Z   To remove this warning, rename it to `setup_method(self)`
2023-06-27T05:58:34.9136922Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9137422Z     fixture_result = next(generator)
2023-06-27T05:58:34.9137627Z 
2023-06-27T05:58:34.9137896Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete
2023-06-27T05:58:34.9138574Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:911: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9139513Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete is using nose-specific method: `teardown(self)`
2023-06-27T05:58:34.9140503Z   To remove this warning, rename it to `teardown_method(self)`
2023-06-27T05:58:34.9141104Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9142134Z     next(it)
2023-06-27T05:58:34.9142314Z 
2023-06-27T05:58:34.9142609Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_archive_leading_dir
2023-06-27T05:58:34.9143344Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:895: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9144138Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_archive_leading_dir is using nose-specific method: `setup(self)`
2023-06-27T05:58:34.9144637Z   To remove this warning, rename it to `setup_method(self)`
2023-06-27T05:58:34.9145184Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9148132Z     fixture_result = next(generator)
2023-06-27T05:58:34.9148473Z 
2023-06-27T05:58:34.9148790Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_archive_leading_dir
2023-06-27T05:58:34.9149489Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:911: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9150299Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_archive_leading_dir is using nose-specific method: `teardown(self)`
2023-06-27T05:58:34.9151472Z   To remove this warning, rename it to `teardown_method(self)`
2023-06-27T05:58:34.9153157Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9153602Z     next(it)
2023-06-27T05:58:34.9153774Z 
2023-06-27T05:58:34.9158491Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop
2023-06-27T05:58:34.9163848Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:895: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9164768Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop is using nose-specific method: `setup(self)`
2023-06-27T05:58:34.9165272Z   To remove this warning, rename it to `setup_method(self)`
2023-06-27T05:58:34.9165821Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9166316Z     fixture_result = next(generator)
2023-06-27T05:58:34.9166686Z 
2023-06-27T05:58:34.9166959Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop
2023-06-27T05:58:34.9167621Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:911: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9168405Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop is using nose-specific method: `teardown(self)`
2023-06-27T05:58:34.9170561Z   To remove this warning, rename it to `teardown_method(self)`
2023-06-27T05:58:34.9171125Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9171861Z     next(it)
2023-06-27T05:58:34.9172029Z 
2023-06-27T05:58:34.9172326Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop_subdir
2023-06-27T05:58:34.9173071Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:895: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9173872Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop_subdir is using nose-specific method: `setup(self)`
2023-06-27T05:58:34.9174391Z   To remove this warning, rename it to `setup_method(self)`
2023-06-27T05:58:34.9174949Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9175999Z     fixture_result = next(generator)
2023-06-27T05:58:34.9176317Z 
2023-06-27T05:58:34.9176718Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop_subdir
2023-06-27T05:58:34.9177561Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:911: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9178402Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_add_delete_after_and_drop_subdir is using nose-specific method: `teardown(self)`
2023-06-27T05:58:34.9179077Z   To remove this warning, rename it to `teardown_method(self)`
2023-06-27T05:58:34.9179775Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9180420Z     next(it)
2023-06-27T05:58:34.9180672Z 
2023-06-27T05:58:34.9181034Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_override_existing_under_git
2023-06-27T05:58:34.9181923Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:895: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9182803Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_override_existing_under_git is using nose-specific method: `setup(self)`
2023-06-27T05:58:34.9183451Z   To remove this warning, rename it to `setup_method(self)`
2023-06-27T05:58:34.9184077Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9184605Z     fixture_result = next(generator)
2023-06-27T05:58:34.9184892Z 
2023-06-27T05:58:34.9185500Z local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_override_existing_under_git
2023-06-27T05:58:34.9186393Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\fixtures.py:911: PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.
2023-06-27T05:58:34.9187294Z   local/tests/test_add_archive_content.py::TestAddArchiveOptions::test_override_existing_under_git is using nose-specific method: `teardown(self)`
2023-06-27T05:58:34.9187948Z   To remove this warning, rename it to `teardown_method(self)`
2023-06-27T05:58:34.9188525Z   See docs: https://docs.pytest.org/en/stable/deprecations.html#support-for-tests-written-for-nose
2023-06-27T05:58:34.9189070Z     next(it)
2023-06-27T05:58:34.9189317Z 
2023-06-27T05:58:34.9189723Z tests/test_cmd.py::test_batched_close_wait
2023-06-27T05:58:34.9190705Z   C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\_pytest\unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function SafeDelCloseMixin.__del__ at 0x000001C2613FC310>
2023-06-27T05:58:34.9191610Z   
2023-06-27T05:58:34.9191957Z   Traceback (most recent call last):
2023-06-27T05:58:34.9194287Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 637, in process_queue
2023-06-27T05:58:34.9195772Z       file_number, state, data = self.output_queue.get(
2023-06-27T05:58:34.9197271Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\queue.py", line 178, in get
2023-06-27T05:58:34.9199294Z       raise Empty
2023-06-27T05:58:34.9208630Z   _queue.Empty
2023-06-27T05:58:34.9209125Z   
2023-06-27T05:58:34.9209598Z   During handling of the above exception, another exception occurred:
2023-06-27T05:58:34.9210237Z   
2023-06-27T05:58:34.9210575Z   Traceback (most recent call last):
2023-06-27T05:58:34.9211343Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\cmd.py", line 212, in __del__
2023-06-27T05:58:34.9218609Z       self.close()
2023-06-27T05:58:34.9219514Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\cmd.py", line 543, in close
2023-06-27T05:58:34.9226041Z       for source, data in self.generator:
2023-06-27T05:58:34.9226893Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\_collections_abc.py", line 317, in __next__
2023-06-27T05:58:34.9227461Z       return self.send(None)
2023-06-27T05:58:34.9228135Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 97, in send
2023-06-27T05:58:34.9228745Z       return self._locked_send(message)
2023-06-27T05:58:34.9229758Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 112, in _locked_send
2023-06-27T05:58:34.9247697Z       runner.process_queue()
2023-06-27T05:58:34.9248543Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 643, in process_queue
2023-06-27T05:58:34.9249212Z       if self.process_timeouts():
2023-06-27T05:58:34.9250010Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 582, in process_timeouts
2023-06-27T05:58:34.9250637Z       return self._update_timeouts()
2023-06-27T05:58:34.9251432Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 563, in _update_timeouts
2023-06-27T05:58:34.9252558Z       self._handle_source_timeout(source)
2023-06-27T05:58:34.9254167Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 551, in _handle_source_timeout
2023-06-27T05:58:34.9254997Z       self._handle_process_timeout()
2023-06-27T05:58:34.9255824Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\runner\nonasyncrunner.py", line 543, in _handle_process_timeout
2023-06-27T05:58:34.9259688Z       if self.protocol.timeout(None) is True:
2023-06-27T05:58:34.9261054Z     File "C:\hostedtoolcache\windows\Python\3.8.10\x64\lib\site-packages\datalad\cmd.py", line 181, in timeout
2023-06-27T05:58:34.9261885Z       raise timeout_error
2023-06-27T05:58:34.9262677Z   subprocess.TimeoutExpired: Command '['C:\\hostedtoolcache\\windows\\Python\\3.8.10\\x64\\python.exe', '-i', '-u', '-q', '-']' timed out after 0.5 seconds
2023-06-27T05:58:34.9263274Z   
2023-06-27T05:58:34.9263713Z     warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
2023-06-27T05:58:34.9264085Z 
2023-06-27T05:58:34.9264427Z -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
2023-06-27T05:58:34.9264988Z =========================== short test summary info ===========================
2023-06-27T05:58:34.9265578Z FAILED ..\datalad\support\tests\test_annexrepo.py::test_unannex_etc - AssertionError

so smells like it just quoting behaves differently on windows @joeyh? (I have no windows env handy ATM to check)

@yarikoptic yarikoptic added platform-windows Issue concerned with Windows test-failure For new or recurring failures of tests during CI runs labels Jun 27, 2023
@joeyh
Copy link

joeyh commented Jun 28, 2023

Certianly possible there is a bug on windows. And I wouldn't be very surprised if something about windows using utf-16 for filenames causes a problem with quoting of unicode on windows.

But looks like the filename in question is ;&%b5{}'.datc ? So no unicode issues. git-annex doesn't quote that on linux, and it is also apparently not being quoted on windows either since that's the input to _unquote_annex_path.
Looks like _unquote_annex_path is expecting it to be quoted and asserts when it's not, and that seems wrong to me.

@joeyh
Copy link

joeyh commented Jun 28, 2023

Also note that git-annex unannex supports --json since the latest release, so you could use that to avoid needing to unquote the path.

@yarikoptic
Copy link
Member Author

Also note that git-annex unannex supports --json since the latest release, so you could use that to avoid needing to unquote the path.

yes, we have plans to RF many commands to use --json where we don't yet, but our current minimal git-annex version we claim compatibility with is

❯ git grep 'ANNEX_MIN_VERSION ='
datalad/support/annexrepo.py:    GIT_ANNEX_MIN_VERSION = '8.20200309'

filed #7442 to collect/track where/what was already migrated or not to use --json

@yarikoptic
Copy link
Member Author

re quote/unquote -- indeed may be there is some wrong assumption coded in. And the difference in behavior on CI could be due to the fact that we do not add unicode symbols while testing on windows: https://github.com/datalad/datalad/blob/HEAD/datalad/tests/utils_pytest.py#L1467

but on a quick try of doing the same generally so also for linux I didn't get that test to fail locally
❯ git diff
diff --git a/datalad/tests/utils_pytest.py b/datalad/tests/utils_pytest.py
index 191f3b1e8..cff064d2f 100644
--- a/datalad/tests/utils_pytest.py
+++ b/datalad/tests/utils_pytest.py
@@ -1459,6 +1459,7 @@ UNICODE_FILENAME = u"ΔЙקم๗あ"
 # so Й might get recoded
 # (ref: https://github.com/datalad/datalad/pull/1921#issuecomment-385809366)
 if sys.getfilesystemencoding().lower() == 'utf-8':
+    UNICODE_FILENAME = ''
     if on_osx:
         # TODO: figure it really out
         UNICODE_FILENAME = UNICODE_FILENAME.replace(u"Й", u"")

the filename in question then (on linux) is a bit different and with newish git-annex we do get it quoted on linux:

$> (source ~/git-annexes/10.20230407+git237-g87e6c56a21.env; 'git' '-c' 'diff.ignoreSubmodules=none' '-c' 'core.quotepath=false' 'annex' 'unannex'  '-c' 'annex.dotfiles=true' '--' ' |;&%b5{}'\''"<> .datc ')
unannex " |;&%b5{}'\"<> .datc " ok
(recording state in git...)

so hence test passes... didn't have a check to see how behaves on windows

@yarikoptic
Copy link
Member Author

but there is indeed no quoting if filename doesn't contain any of those tricky characters

*$> (source ~/git-annexes/10.20230407+git237-g87e6c56a21.env; 'git' '-c' 'diff.ignoreSubmodules=none' '-c' 'core.quotepath=false' 'annex' 'unannex'  '-c' 'annex.dotfiles=true' '--' '123')
unannex 123 ok
(recording state in git...)

so the code assumption that it would always be quoted does not hold I think -- let me send a quick PR...

yarikoptic added a commit to yarikoptic/datalad that referenced this issue Jun 28, 2023
Lead to a failure on Windows.
Apparently with core.quotepath=false we would not get simple filenames
quoted, so we should decide to remove or not quotes "dynamically" on whether
we find them

Closes datalad#7440
@joeyh
Copy link

joeyh commented Jun 28, 2023

The " character causes git-annex to quote the file (otherwise quoted filenames would be ambiguous). The filename didn't have that on windows, and does on linux.

@yarikoptic-gitmate
Copy link
Collaborator

Issue fixed in 0.19.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-windows Issue concerned with Windows test-failure For new or recurring failures of tests during CI runs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants