Bug #16056

Donor mail extraction script ignores unsubscribed

Added by Anonymous 2018-10-16 10:53:12 . Updated 2018-10-24 15:00:13 .

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Fundraising
Target version:
Start date:
2018-10-16
Due date:
% Done:

100%

Feature Branch:
Type of work:
Code
Blueprint:

Starter:
Affected tool:
Deliverable for:

Description

$ ./scripts/report -p *.csv -x exclude.dat > tmp.txt 

Does not take into account the exclude list while it should.


Subtasks


Related issues

Related to Tails - Feature #16070: Support bash glob in donors-report Resolved 2018-10-23

History

#1 Updated by intrigeri 2018-10-16 12:33:46

  • Assignee deleted (intrigeri)

>

> $ ./scripts/report -p *.csv  > tmp.txt -x exclude.dat
> 

> Does not take into account the exclude list while it should.

And what if you actually pass the -x option to the report script, e.g. with $ ./scripts/report -x exclude.dat -p *.csv > tmp.txt?

#2 Updated by Anonymous 2018-10-16 13:19:49

  • Assignee set to intrigeri

Sorry, I copy pasted that weirdly to Redmine. I rightfully passed the option before the redirection.
And the problem persists. I would have gladly accepted that to be PEBKAC, but it’s not.

#3 Updated by Anonymous 2018-10-16 13:20:08

  • Description updated

#4 Updated by Anonymous 2018-10-16 13:23:29

intrigeri wrote:
> And what if you actually pass the -x option to the report script, e.g. with $ ./scripts/report -x exclude.dat -p *.csv > tmp.txt?

That does not work either. The option is ignored. And I seem to remember that exclude.dat should always be called even if one forgets to indicate that on the command line.

#5 Updated by intrigeri 2018-10-17 10:18:29

  • Target version set to Tails_3.10.1

After a few random tries, I’ve reproduced this with ./scripts/report -p data/PayPal_Zwiebelfreunde_2014-08-11_to_2015-12-31.csv . Next time, please share an exact reproducer (expanding shell globs because I don’t know what *.csv is for you, telling me what excluded email address you see in the output), so I don’t have to guess :)

Now diving into the code to find the bug!

In passing, note that -p *.csv is incorrect and won’t do what you think if *.csv expands to 2 files or more. You need to pass -p once per input file:

    -p --paypal_file: Array of Strings
        Input file to process (CSV exported by PayPal); use this option once
        per such input file.

#6 Updated by intrigeri 2018-10-17 10:19:54

  • Status changed from Confirmed to In Progress
  • Assignee deleted (intrigeri)
  • % Done changed from 0 to 50
  • QA Check set to Ready for QA

It’s now fixed for me, please confirm :)

#7 Updated by Anonymous 2018-10-17 13:19:13

intrigeri wrote:
> After a few random tries, I’ve reproduced this with ./scripts/report -p data/PayPal_Zwiebelfreunde_2014-08-11_to_2015-12-31.csv . Next time, please share an exact reproducer (expanding shell globs because I don’t know what *.csv is for you, telling me what excluded email address you see in the output), so I don’t have to guess :)

Sorry. Grepping the email address I’ve sent via -fundraising in these files would have helped finding out which file has been used for our donation campaign. It was files linked to Riseup, btw. I did not add this information here because I did not want to leak the contents of my folder setup nor exact filenames.

> Now diving into the code to find the bug!
>
> In passing, note that -p *.csv is incorrect and won’t do what you think if *.csv expands to 2 files or more. You need to pass -p once per input file.

It was just an example. But thanks for clarifying that anyway.

#8 Updated by sajolida 2018-10-23 20:58:35

Making this as part of the donation campaign.

#9 Updated by sajolida 2018-10-23 21:15:28

#10 Updated by Anonymous 2018-10-24 15:00:13

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
  • QA Check changed from Ready for QA to Pass

It works.