p4cmd 2.10.1__tar.gz → 2.10.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {p4cmd-2.10.1 → p4cmd-2.10.2}/PKG-INFO +1 -1
  2. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/__init__.py +1 -1
  3. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/p4cmd.py +1 -1
  4. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/PKG-INFO +1 -1
  5. {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_p4client.py +18 -0
  6. {p4cmd-2.10.1 → p4cmd-2.10.2}/LICENSE +0 -0
  7. {p4cmd-2.10.1 → p4cmd-2.10.2}/README.md +0 -0
  8. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/p4errors.py +0 -0
  9. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/p4file.py +0 -0
  10. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/__init__.py +0 -0
  11. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_DEPOT_ONLY.png +0 -0
  12. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_MOVED.png +0 -0
  13. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_NEED_SYNC.png +0 -0
  14. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_OPEN_FOR_ADD.png +0 -0
  15. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_OPEN_FOR_DELETE.png +0 -0
  16. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_OPEN_FOR_EDIT.png +0 -0
  17. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_UNKNOWN.png +0 -0
  18. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_UNTRACKED.png +0 -0
  19. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/resources/perforce_UP_TO_DATE.png +0 -0
  20. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd/utils.py +0 -0
  21. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/SOURCES.txt +0 -0
  22. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/dependency_links.txt +0 -0
  23. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/requires.txt +0 -0
  24. {p4cmd-2.10.1 → p4cmd-2.10.2}/p4cmd.egg-info/top_level.txt +0 -0
  25. {p4cmd-2.10.1 → p4cmd-2.10.2}/setup.cfg +0 -0
  26. {p4cmd-2.10.1 → p4cmd-2.10.2}/setup.py +0 -0
  27. {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/__init__.py +0 -0
  28. {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/conftest.py +0 -0
  29. {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_integration.py +0 -0
  30. {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_p4file.py +0 -0
  31. {p4cmd-2.10.1 → p4cmd-2.10.2}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p4cmd
3
- Version: 2.10.1
3
+ Version: 2.10.2
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -1,4 +1,4 @@
1
- VERSION = "2.10.1"
1
+ VERSION = "2.10.2"
2
2
 
3
3
  from .p4cmd import P4Client
4
4
  from .p4file import P4File
@@ -138,7 +138,7 @@ class P4Client(object):
138
138
  except ValueError as error:
139
139
  output_dict = {
140
140
  "command": command,
141
- "code": "error",
141
+ "code": "raw",
142
142
  "error": str(error),
143
143
  "raw_output": subprocess.check_output(command, stderr=subprocess.STDOUT, shell=True, cwd=self.perforce_root)
144
144
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p4cmd
3
- Version: 2.10.1
3
+ Version: 2.10.2
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -667,6 +667,24 @@ def test_run_cmd_handles_string_key_error_dicts(p4client, caplog):
667
667
  assert "some error" in caplog.text
668
668
 
669
669
 
670
+ def test_run_cmd_value_error_fallback_no_warning(p4client, caplog):
671
+ """run_cmd's ValueError fallback (e.g. `p4 set`) must not log spurious error warnings."""
672
+ with patch("subprocess.Popen") as mock_popen, \
673
+ patch("p4cmd.p4cmd.subprocess.check_output", return_value=b"P4USER=niels.vaes (set)\n"):
674
+ # Empty stdout triggers ValueError on marshal.load (unknown type code in this case
675
+ # would also work; here we use bytes that aren't valid marshal data).
676
+ import io as _io
677
+ buf = _io.BytesIO(b"\xff\xff\xff\xff") # invalid marshal type code -> ValueError
678
+ mock_popen.return_value.__enter__ = lambda s: s
679
+ mock_popen.return_value.__exit__ = MagicMock(return_value=False)
680
+ mock_popen.return_value.stdout = buf
681
+ mock_popen.return_value.kill = MagicMock()
682
+ with caplog.at_level(logging.WARNING):
683
+ result = p4client.get_p4_setting("P4USER")
684
+ assert result == "niels.vaes"
685
+ assert caplog.records == []
686
+
687
+
670
688
  def test_get_local_paths_missing_path(p4client):
671
689
  """get_local_paths skips entries where path is missing (e.g. unmapped paths from p4 where)."""
672
690
  info_dicts = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes