-R option missing and traceback visible in manpage

Bug #1851378 reported by Jens KLEIN
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
rpl (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

After installing "rpl" in "eoan" I wondered why the recursive feature "-R" was gone.

Then I looked at the man page and found the Python traceback in it, after:

$ man rpl

I got:

-snip--------------
TRACEBACK(1) User Commands TRACEBACK(1)

NAME
       Traceback - replace strings in files

DESCRIPTION
       Basic usage is to specify two strings and one or more filenames or directories on the command line. The first string is the string
       to replace, and the second string is the replacement string.

   Traceback (most recent call last):
              File "./rpl", line 16, in <module>

              from chardet.universaldetector import UniversalDetector

       ModuleNotFoundError: No module named 'chardet'

              File "./rpl", line 16, in <module>

              from chardet.universaldetector import UniversalDetector

       ModuleNotFoundError: No module named 'chardet'

EXAMPLES
       Replace all occurrences of ‘F’ (on word boundaries) with ‘A’ in all text files under the grades/ directory:

              find grades/ -name '*.txt' | xargs rpl -wd 'F' 'A'

AUTHOR
       Written by Göran Weinholt and Reuben Thomas.

COPYRIGHT
       This program was written for Debian as a free replacement for the non-free rpl program by Joe Laffey.

SEE ALSO
       find(1), sed(1).

Traceback (most recent call last): August 2019 TRACEBACK(1)
-/snip--------------

Above is also visible here:
http://manpages.ubuntu.com/manpages/eoan/en/man1/rpl.1.html

My installed version is as below:

-snip--------------
Package: rpl
Version: 1.6.1-3
Priority: optional
Section: universe/utils
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian QA Group <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 37,9 kB
Depends: python3-chardet, python3:any
Homepage: https://github.com/rrthomas/rpl
Download-Size: 9.340 B
APT-Manual-Installed: yes
APT-Sources: http://at.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
Description: replace strings in files
 rpl is an intelligent search and replacement utility. It will change strings
 with new strings in multiple text files at the same time.
 .
 rpl can verify, find and edit several plain texts quickly.
-/snip--------------

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in rpl (Ubuntu):
status: New → Confirmed
Revision history for this message
Todor Dragnev (t0d0r) wrote :

Hi, looks like rpl is complete new package/app with different arguments...

Why this replacement?

The old and original rpl was taken from there: http://rpl.sourceforge.net

Current package in 20.04 use this source: https://github.com/rrthomas/rpl...

Revision history for this message
Benjamin Baez (benbaez4) wrote :

I got confused using rpl in 20.04, thanks to this page it is clarified. What was the reason changing to a different source? Using -R option in the original package was more reliable. SF.net version did not have issues while the Ubuntu version did.

aa0001@test:~/projects/biospectra/cvs$ find . -name '*.php' | xargs rpl -s "\$form->ACTION = \$conf['paths']['http'] . \$_SERVER['REQUEST_URI']" "\$form->ACTION = comHttpProtocolUrl( \$conf['paths']['serverName'] . \$_SERVER['REQUEST_URI'] )"

rpl: Simulating replacement of "$form->ACTION = $conf['paths']['http'] . $_SERVER['REQUEST_URI']" with "$form->ACTION = comHttpProtocolUrl( $conf['paths']['serverName'] . $_SERVER['REQUEST_URI'] )" (case sensitive; partial words matched)

rpl: The files listed below would be modified in a replace operation

rpl: could not guess encoding; using locale default 'UTF-8'
  ...
Traceback (most recent call last):
  File "/usr/bin/rpl", line 377, in <module>
    matches = replace(f, o, regex, old_str, new_str, encoding)
  File "/usr/bin/rpl", line 178, in replace
    parts = regex.split(tonext + block)
TypeError: can only concatenate str (not "bytes") to str

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.