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

Paths which include special characters in the name cause an exception #29

Open
xrouge opened this issue Jul 7, 2024 · 0 comments
Open

Comments

@xrouge
Copy link

xrouge commented Jul 7, 2024

Similar to: #3

Python 3.12
For example, @ in the path:

Traceback (most recent call last):
  File "D:\dev\my\p4transfer\P4Transfer.py", line 2664, in replicate
    num_changes = self.replicate_changes()
                  ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\dev\my\p4transfer\P4Transfer.py", line 2478, in replicate_changes
    targetChange = self.target.replicateChange(fileRevs, specialMoveRevs, srcFileLogs, change, self.source.p4.port)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\dev\my\p4transfer\P4Transfer.py", line 1585, in replicateChange
    self.processChangeRevs(fileRevs, specialMoveRevs, srcFileLogs)
  File "D:\dev\my\p4transfer\P4Transfer.py", line 1514, in processChangeRevs
    self.replicateBranch(f, dirty=False)
  File "D:\dev\my\p4transfer\P4Transfer.py", line 1901, in replicateBranch
    self.p4cmd('sync', '-k', file.fixedLocalFile)
  File "D:\dev\my\p4transfer\P4Transfer.py", line 1044, in p4cmd
    output = self.p4.run(args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\dev\my\p4transfer\.venv\Lib\site-packages\P4.py", line 624, in run
    raise e
  File "D:\dev\my\p4transfer\.venv\Lib\site-packages\P4.py", line 618, in run
    result = P4API.P4Adapter.run(self, *flatArgs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
P4.P4Exception: [P4#run] Errors during command execution( "p4 sync -k D:\dev\p4transfer\nodejs\6.11.0-win-x64\node_modules\npm\node_modules\node-gyp\node_modules\path-array\node_modules\array-index\node_modules\es6-symbol\node_modules\es5-ext\array\#\@@iterator\implement.js" )

        [Error]: "Invalid revision number '\\@@iterator\\implement.js'."

`2024-07-07 09:03:57,755:P4Transfer:DEBUG: processing:0230 add`

escapeWildCards() should handle this, but maybe it's not called from this code path. I understand that the special characters are allowed only when adding files, but ASCII expansion should be used in all other commands
https://www.perforce.com/manuals/v22.2/p4guide/Content/P4Guide/syntax.syntax.restrictions.html

therefore fixedLocalFile shouldn't be used here because setLocalFile has the opposite intent:

self.p4cmd('sync', '-k', file.fixedLocalFile)

maybe file.localFile instead of file.fixedLocalFile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant