This is fixed in upstream github.com/s3tools/s3cmd master branch.  It failed to write to stdout after grep closed its stdin, thus tracebacked.  We no longer treat broken pipes as fatal in the upstream master branch.


On Wed, May 14, 2014 at 6:58 AM, Alexander Semigrodskikh <asemigr@netlabsystems.com> wrote:
Hello!

I executed the following command:

s3cmd ls s3://some-bucket-backups/Backup/SCTP/AppData/ | more


I encountered the following bug:

Problem: IOError: [Errno 32] Broken pipe
S3cmd:   1.0.0

Traceback (most recent call last):
  File "/usr/bin/s3cmd", line 2006, in <module>
    main()
  File "/usr/bin/s3cmd", line 1950, in main
    cmd_func(args)
  File "/usr/bin/s3cmd", line 125, in cmd_ls
    subcmd_bucket_list(s3, uri)
  File "/usr/bin/s3cmd", line 183, in subcmd_bucket_list
    "uri": uri.compose_uri(bucket, object["Key"]),
  File "/usr/bin/s3cmd", line 33, in output
    sys.stdout.write(message + "\n")
  File "/usr/lib64/python2.6/codecs.py", line 352, in write
    self.stream.write(data)
IOError: [Errno 32] Broken pipe

I found that I got 24736 as the result of the command

s3cmd ls s3://some-bucket-backups/Backup/SCTP/AppData/ | grep -c . 

while the real number of files was varying. In the end, the number of files would be about 38000.

I use the name s3://some-bucket-backups of the bucket to hide the real name of the backet, which I don't want to disclose.

Thanks.

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs