Spaces:
Running
Running
Commit
·
2681e46
1
Parent(s):
7e10695
Update: fixed syntax issue and improvements
Browse files
app.log
ADDED
File without changes
|
fix.sh
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# File to patch
|
4 |
+
TARGET_FILE="/usr/local/lib/python3.10/site-packages/pyth/plugins/rtf15/reader.py"
|
5 |
+
|
6 |
+
# Backup first (good practice)
|
7 |
+
if [ -f "$TARGET_FILE" ]; then
|
8 |
+
echo "Backing up original file to ${TARGET_FILE}.bak"
|
9 |
+
cp "$TARGET_FILE" "${TARGET_FILE}.bak"
|
10 |
+
else
|
11 |
+
echo "Error: Target file not found: $TARGET_FILE"
|
12 |
+
exit 1
|
13 |
+
fi
|
14 |
+
|
15 |
+
# Perform the patch: replace ur'...' with r'...' on matching lines
|
16 |
+
echo "Patching file to remove 'u' from 'ur' strings..."
|
17 |
+
sed -i 's/ur"/r"/g; s/ur'\''/r'\''/g' "$TARGET_FILE"
|
18 |
+
|
19 |
+
# Confirm change
|
20 |
+
echo "Patch complete. Checking if patch was successful:"
|
21 |
+
grep "ur\"" "$TARGET_FILE" || grep "ur'" "$TARGET_FILE"
|
22 |
+
|
23 |
+
if [ $? -eq 0 ]; then
|
24 |
+
echo "⚠️ Warning: Some 'ur' strings may still remain. Please review manually."
|
25 |
+
else
|
26 |
+
echo "✅ Patch successful! No remaining 'ur' strings."
|
27 |
+
fi
|