Skip to content

bpo-39361: Document the removal of tp_print#18125

Merged
vstinner merged 2 commits intopython:masterfrom
ammaraskar:tp_print_remove
Jan 24, 2020
Merged

bpo-39361: Document the removal of tp_print#18125
vstinner merged 2 commits intopython:masterfrom
ammaraskar:tp_print_remove

Conversation

@ammaraskar
Copy link
Copy Markdown
Member

@ammaraskar ammaraskar commented Jan 22, 2020

Looks like there are still some remnants of tp_print in test_defaultdict.py:

# NOTE: We can't use tempfile.[Named]TemporaryFile since this
# code must exercise the tp_print C code, which only gets
# invoked for *real* files.
tfn = tempfile.mktemp()
try:
f = open(tfn, "w+")
try:
print(d1, file=f)
print(d2, file=f)
f.seek(0)
self.assertEqual(f.readline(), repr(d1) + "\n")
self.assertEqual(f.readline(), repr(d2) + "\n")
finally:
f.close()
finally:
os.remove(tfn)

The tp_print function was removed as part of 346f1a8 but the test exercising that path was never changed. Should changing that be done here as well or a separate issue/PR?

https://bugs.python.org/issue39361

@vstinner vstinner merged commit 2d50976 into python:master Jan 24, 2020
@vstinner
Copy link
Copy Markdown
Member

Thanks @ammaraskar

shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants