Skip to content

Commit 9f6dd09

Browse files
committed
WIP: Fix doc
1 parent 68bd800 commit 9f6dd09

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

Doc/whatsnew/3.15.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ New modules
8989
Improved modules
9090
================
9191

92+
calendar
93+
--------
94+
95+
* The default *encoding* parameter value in :meth:`calendar.HTMLCalendar.formatyearpage`
96+
is now utf-8.
97+
(Contributed by Jiahao Li in :gh:`135001`.)
98+
9299
difflib
93100
-------
94101

@@ -138,13 +145,6 @@ Deprecated
138145
Removed
139146
=======
140147

141-
calendar
142-
--------
143-
144-
* The default *encoding* parameter value in :meth:`calendar.HTMLCalendar.formatyearpage`
145-
is now utf-8.
146-
(Contributed by Jiahao Li in :gh:`135001`.)
147-
148148
ctypes
149149
------
150150

@@ -243,6 +243,11 @@ New features
243243
Porting to Python 3.15
244244
----------------------
245245

246+
* The default *encoding* parameter value in :meth:`calendar.HTMLCalendar.formatyearpage`
247+
is now utf-8.
248+
249+
(Contributed by Jiahao Li in :gh:`135001`.)
250+
246251
* :class:`sqlite3.Connection` APIs has been cleaned up.
247252

248253
* All parameters of :func:`sqlite3.connect` except *database* are now keyword-only.

Lib/calendar.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ def formatyearpage(self, theyear, width=3, css='calendar.css', encoding='utf-8')
564564
"""
565565
Return a formatted year as a complete HTML page.
566566
"""
567+
if encoding is None:
568+
encoding = 'utf-8'
567569
v = []
568570
a = v.append
569571
a('<?xml version="1.0" encoding="%s"?>\n' % encoding)

Lib/test/test_calendar.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,11 +413,8 @@ def test_output_textcalendar(self):
413413
def test_output_htmlcalendar_encoding_ascii(self):
414414
self.check_htmlcalendar_encoding('ascii', 'ascii')
415415

416-
def test_output_htmlcalendar_encoding_utf8(self):
417-
self.check_htmlcalendar_encoding('utf-8', 'utf-8')
418-
419-
def test_output_htmlcalendar_encoding_default(self):
420-
self.check_htmlcalendar_encoding(None, sys.getdefaultencoding())
416+
def test_output_htmlcalendar_encoding_none(self):
417+
self.check_htmlcalendar_encoding(None, 'utf-8')
421418

422419
def test_yeardatescalendar(self):
423420
def shrink(cal):

0 commit comments

Comments
 (0)