This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients bethard, eric.araujo, georg.brandl, travistouchdown
Date 2011-02-04.01:47:12
SpamBayes Score 1.1218188e-05
Marked as misclassified No
Message-id <1296784033.87.0.914652059317.issue9399@psf.upfronthosting.co.za>
In-reply-to
Content
Thanks for the new patch.  It does not apply cleanly to the py3k branch, but that’s very easily corrected.


        self.file.write(self.message)
        self.file.write('\n')

Could be replaced by
        print(self.message, file=self.file)

print will use the right EOL for the platform and is just coooler.


By the way, self.file should not be rebound in __call__:
        if self.file is None:
            self.file = _sys.stdout
→
        file = (self.file if self.file is not None else _sys.stdout)


> Second, there are cases where you want whitespaces to be preserved,
> like printing out the license of your program (as I mentioned in my
> first post) Just look at this BSD license: [...]
> This is just plain ugly.

Agreed, but I did not suggest that the output be like that.  In my previous message, I suggested that argparse could replace \n with spaces and do its own line wrapping, to adapt to terminal length while avoiding chunking ugliness.  That’s Steven’s call anyway, I don’t have any strong feeling in favor of preserving whitespace or rewrapping.  If argparse wraps lines to the terminal width in other cases (like with epilog text), I think it should do so here too.
History
Date User Action Args
2011-02-04 01:47:13eric.araujosetrecipients: + eric.araujo, georg.brandl, bethard, travistouchdown
2011-02-04 01:47:13eric.araujosetmessageid: <1296784033.87.0.914652059317.issue9399@psf.upfronthosting.co.za>
2011-02-04 01:47:13eric.araujolinkissue9399 messages
2011-02-04 01:47:12eric.araujocreate