This is an automated email from the ASF dual-hosted git repository.
fanng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 91beb1610 [minor] fix(dev): fix ValueError when parsing config file
with multiple '=' in one line (#5713)
91beb1610 is described below
commit 91beb161078dc805496610a3b94816a923f8d94e
Author: JUN <[email protected]>
AuthorDate: Tue Dec 3 14:46:08 2024 +0800
[minor] fix(dev): fix ValueError when parsing config file with multiple '='
in one line (#5713)
### What changes were proposed in this pull request?
Fix potential parsing error in the `rewrite_config.parse_config_file`
function.
### Why are the changes needed?
If a configuration line contains multiple '=' characters, the
`rewrite_config.parse_config_file` function will throw a `ValueError:
too many values to unpack`.
This change ensures the function correctly handles lines with multiple
'=' characters.
### Does this PR introduce any user-facing changes?
No.
### How was this patch tested?
Rebuilt the project and tested with configurations containing multiple
'=' characters in a single line.
---
dev/docker/iceberg-rest-server/rewrite_config.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dev/docker/iceberg-rest-server/rewrite_config.py
b/dev/docker/iceberg-rest-server/rewrite_config.py
index dce5479cf..484839fd0 100755
--- a/dev/docker/iceberg-rest-server/rewrite_config.py
+++ b/dev/docker/iceberg-rest-server/rewrite_config.py
@@ -48,7 +48,7 @@ def parse_config_file(file_path):
for line in file:
stripped_line = line.strip()
if stripped_line and not stripped_line.startswith('#'):
- key, value = stripped_line.split('=')
+ key, value = stripped_line.split('=', 1)
key = key.strip()
value = value.strip()
config_map[key] = value