Skip to content
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

Crash when using backspace for replace #34

Open
MuenchenSued opened this issue Dec 25, 2021 · 5 comments
Open

Crash when using backspace for replace #34

MuenchenSued opened this issue Dec 25, 2021 · 5 comments

Comments

@MuenchenSued
Copy link

bulky 1.8 crashes, when I enter a backspace character in the replacement line without activating "regular expression" before. Also, if a backspace is present in the replace-field and a unselect regular expressions afterwards, it crashed (it hangs, no reaction, must be killed)

@MuenchenSued
Copy link
Author

This also happens in bulky 2.1. To reproduce it, it is necessary to use it from nemo. Select any two files, call rename via RMB and enter a backslash into the "Replace:" line (in a german version this is called "Ersetzen:").

grafik

If you call it from the command line with e.g. "bulky *", you get a permanent message
"bad escape (end of pattern) at position 0"
so it should be easy to add an IF clause instead of throwing a permanent error message without the possibility to correct it by the user.

Neinei0k added a commit to Neinei0k/bulky that referenced this issue Mar 19, 2022
The program enters infinite loop when the user adds a backslash at the end of a string in "replace" field. It happens because reg.sub throws an exception when it sees a backslash at the end of "replace" variable. The fix was already implemented for the case where regular expression replacement is enabled - catch regex exception and return unchanged string.
mtwebster pushed a commit that referenced this issue Apr 25, 2022
The program enters infinite loop when the user adds a backslash at the end of a string in "replace" field. It happens because reg.sub throws an exception when it sees a backslash at the end of "replace" variable. The fix was already implemented for the case where regular expression replacement is enabled - catch regex exception and return unchanged string.
@wujastyk
Copy link

wujastyk commented Jun 7, 2022

Bulky 2.1
System: Kernel: 5.13.0-44-generic x86_64 bits: 64 compiler: N/A Desktop: Cinnamon 5.2.7
wm: muffin dm: LightDM Distro: Linux Mint 20.3 Una base: Ubuntu 20.04 focal

Same problem with entering a backslash character (\) in the replace field, either before or after selecting "regular expression". Program freezes and has to be manually killed.

@MuenchenSued
Copy link
Author

A fix has already been implemented but a new version was not released up to now. I replaced my /usr/lib/bulky/bulky.py with the file https://github.com/linuxmint/bulky/blob/master/usr/lib/bulky/bulky.py and now it works without a crash.

@wujastyk
Copy link

wujastyk commented Jun 8, 2022

Thank you, that worked!

fenilgmehta added a commit to fenilgmehta/bulky that referenced this issue Aug 13, 2022
mtwebster pushed a commit that referenced this issue Aug 30, 2022
@fenilgmehta
Copy link
Contributor

I think we can close this issue as it has been fixed with the pull request #47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants