Package: rpl
Version: 1.5.6-1
Severity: important
Tags: upstream
When running rpl recursively to replace files with a specific extension int he
current directory, it stops an error (without replacing anything).
Command run:
rpl -R -x'.txt' 'WordA' 'WordB' .
Error message / output:
Replacing "WordA" with "WordB" (case sensitive) (partial words matched)
Traceback (most recent call last):
File "/usr/bin/rpl", line 315, in <module>
main()
File "/usr/bin/rpl", line 201, in main
files = get_files(files, opts.recurse, opts.suffixen, opts.verbose,
opts.hidden_files)
File "/usr/bin/rpl", line 53, in get_files
hidden_files, encodeen)
NameError: name 'encodeen' is not defined
When checking the definition of the function, its clear where is the problem
(line 30):
def get_files(filenames, recurse, suffixen, verbose, hidden_files):
but the function is being called with one parameter too much(line 51):
new_files += get_files([os.path.join(filename, f)], recurse, suffixen, verbose,
hidden_files, encodeen)
Therefore a small patch is attached.
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.7.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages rpl depends on:
pn python3:any <none>
rpl recommends no packages.
rpl suggests no packages.
-- no debconf information
--- rpl 2016-10-20 13:04:00.000000000 +0200
+++ rpl-fixed 2016-10-28 03:18:56.293891147 +0200
@@ -50,7 +50,7 @@
continue
new_files += get_files([os.path.join(filename, f)],
recurse, suffixen, verbose,
- hidden_files, encodeen)
+ hidden_files)
else:
if verbose:
sys.stderr.write("Directory: %s skipped.\n" % filename)