Description: Workaround regression in py3.9.5 where '.' doesn't get treated as cwd. Update affected tests as well. Author: Dan Bungert Acked-By: Bryce Harrington Origin: vendor Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/breezy/+bug/1932313/ Forwarded: no Last-Update: 2021-08-03 --- a/breezy/plugin.py +++ b/breezy/plugin.py @@ -154,6 +154,8 @@ _install_importer_if_needed(extra_details) paths = _iter_plugin_paths(_env_plugin_path(), path) + # Workaround regression in py3.9.5 where '.' doesn't get treated as cwd + paths = [os.getcwd() if path == '.' else path for path in paths] return _Path(name, blocks, extra_details, paths) --- a/breezy/tests/test_plugins.py +++ b/breezy/tests/test_plugins.py @@ -310,7 +310,7 @@ open(name, 'w').close() log = self.load_and_capture(name) self.assertContainsRe(log, - r"Unable to load 'brz-bad plugin-name\.' in '\.' as a plugin " + r"Unable to load 'brz-bad plugin-name\.' in \'.*\' as a plugin " "because the file path isn't a valid module name; try renaming " "it to 'bad_plugin_name_'\\.") @@ -328,8 +328,8 @@ with open(name, 'w') as f: f.write('raise Exception("bad")\n') log = self.load_and_capture(name, warn_load_problems=True) - self.assertEqual( - 'Unable to load plugin \'some_error\' from \'.\': bad\n', log) + self.assertContainsRe(log, + r"Unable to load plugin \'some_error\' from \'.*\': bad\n") class TestPlugins(BaseTestPlugins):