-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Escape backslashes in source string before loading properties #3172
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
Open
belljun3395
wants to merge
1
commit into
spring-projects:main
from
belljun3395:escape-backslashes-before-loading-properties
Open
Escape backslashes in source string before loading properties #3172
belljun3395
wants to merge
1
commit into
spring-projects:main
from
belljun3395:escape-backslashes-before-loading-properties
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@spring-projects-issues
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Jun 22, 2025
Signed-off-by: belljun3395 <195850@jnu.ac.kr>
@belljun3395
belljun3395
force-pushed
the
escape-backslashes-before-loading-properties
branch
from
June 22, 2025 05:05
862bbe7
to
d7cab20
Compare
@mp911de
mp911de
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Jun 23, 2025
Thank you @belljun3395. LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Overview
This PR resolves an
IllegalArgumentException
that occurs when parsing the RedisINFO
command response in a Windows environment. This issue is described in GitHub issue #3099 and is also related to the previously closed issue #1281.The Problem
On Windows, the Redis
INFO
command output can contain values with backslashes (\
), such as the path to the executable (executable:C:\Users\...
). TheConverters.toProperties(String)
method inspring-data-redis
usesjava.util.Properties.load()
internally to parse this response.However,
Properties.load()
treats the backslash as a special escape character. Consequently, it misinterprets sequences like\u
in a file path as a Unicode escape sequence, leading to anIllegalArgumentException
. This poses a challenge for developers working in a Windows environment.The Solution
To address this while preserving the existing code structure, I've introduced a minimal change to the
Converters.toProperties(String)
method. Before callingProperties.load()
, all backslashes (\
) in the input string are replaced with double backslashes (\\
).Before:
After:
This simple change ensures that
Properties.load()
correctly interprets backslashes as literal characters, preventing any parsing errors. The fix is applied to theConverters
class, which is shared by bothJedis
andLettuce
client implementations, resolving the issue for both drivers.Related Issue