尝试在Powershell上运行:>>> from pathlib import Path
>>> from unittest.mock import patch, mock_open
>>> opener = mock_open()
>>> def mocked_open(self, *args, **kwargs):
... return opener(self, *args, **kwargs)
...
>>> with patch.object(Path, 'open', mocked_open):
... print(Path.open)
... print(Path().open)
... with Path().open() as f:
... f.write('<file contents>')
... f.flush()
...
<function mocked_open at 0x12026f5c0>
<bound method mocked_open of PosixPath('.')>
<MagicMock name='open().flush()' id='4834728928'>
>>> opener.mock_calls
[call(PosixPath('.')),
call().__enter__(),
call().write('<file contents>'),
call().flush(),
call().__exit__(None, None, None)]
结果:flyway -password='pass"word'
在双引号的情况下如何转义flyway的参数值?
在赢10 x64上使用飞行路线5.2.4。
答案 0 :(得分:0)
看着Flyway GitHub存储库上的问题,我发现this暗示以下应该起作用:
'-password=pass"word'
您没有提供明确的密码示例,所以我最好的猜测是您的密码是pass"word
。