[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2017-03-31 Thread Donald Stufft

Changes by Donald Stufft :


--
pull_requests: +1027

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-10-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

prweek() and pryear() are changed only in 3.7. If this breaks somebody's code, 
there is enough time to update this code or rollback changes.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4a3892f49e1a by Serhiy Storchaka in branch 'default':
Issue #28255: calendar.TextCalendar.prweek() no longer prints a space after
https://hg.python.org/cpython/rev/4a3892f49e1a

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-10-25 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8d54c2a1c796 by Serhiy Storchaka in branch '3.5':
Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
https://hg.python.org/cpython/rev/8d54c2a1c796

New changeset ebe5bd33f86f by Serhiy Storchaka in branch '3.6':
Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
https://hg.python.org/cpython/rev/ebe5bd33f86f

New changeset 049e58f74272 by Serhiy Storchaka in branch 'default':
Issue #28255: calendar.TextCalendar().prmonth() no longer prints a space
https://hg.python.org/cpython/rev/049e58f74272

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-10-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It looks to me that only prmonth() should be changed. prweek() and pryear() 
either match the behavior of PYthon 2 or are the good approximation of it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-28 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +belopolsky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Actually the behavior of the print statement in Python 2 is more complex.

"print x," doesn't output a space after x, but sets the softspace attribute of 
the file to true (unless x is a string ending with non-space whitespace 
character like \n or \t). print tests this flag before outputting a value and 
outputs a space if it is true. Any output to a file resets this flag. This 
behavior can't be exactly reproduced in Python 3.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-23 Thread Xiang Zhang

Xiang Zhang added the comment:

A single `print x,` seems to me won't add the trailing space. And I don't 
understand why in py2 repl even with comma there is still a newline:

>>> print 'a',
a
>>> 

>>> print('a', end='')
a>>>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-23 Thread Xiang Zhang

Changes by Xiang Zhang :


--
Removed message: http://bugs.python.org/msg277263

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-23 Thread Xiang Zhang

Xiang Zhang added the comment:

> prweek() in Python 2 adds a final space. Python 3 version looks correct.

Really? `print '1',` in my mind will output a newline and no trailing space. 
And I think we should also add a comma in pryear in py2.

--
Added file: http://bugs.python.org/file44791/calendar_whitespace_v2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

prweek() in Python 2 adds a final space. Python 3 version looks correct.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The patch LGTM. Could you please add tests?

I suppose this is a consequence of porting from Python 2 to Python 3 (maybe 
with 2to3). Usually "print x," in Python 2 corresponds to "print(x, end=' ')" 
in Python 3. But if x ends with \n, print with a comma in Python 2 don't add a 
space, this corresponds to "print(x, end='')". Similar issue was fixed not long 
ago. Maybe there are other similar issues in the stdlib or scripts.

--
type: enhancement -> behavior
versions: +Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28255] TextCalendar.prweek/month/year outputs an extra whitespace character

2016-09-23 Thread Xiang Zhang

New submission from Xiang Zhang:

Currently TextCalendar.prweek/month/year outputs an extra whitespace which 
makes the output weird:

>>> calendar.TextCalendar().prweek([(1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7)], 
>>> 2)
 1  2  3  4  5  6  7 >>> calendar.TextCalendar().prmonth(2016,9)
   September 2016
Mo Tu We Th Fr Sa Su
  1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
 >>>

--
components: Library (Lib)
files: calendar_whitespace.patch
keywords: patch
messages: 277256
nosy: serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: patch review
status: open
title: TextCalendar.prweek/month/year outputs an extra whitespace character
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file44790/calendar_whitespace.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com