Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39361: Document the removal of tp_print #18125

Open
wants to merge 1 commit into
base: master
from

Conversation

@ammaraskar
Copy link
Member

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

@ammaraskar ammaraskar requested a review from vstinner Jan 22, 2020
@ammaraskar ammaraskar requested a review from jdemeyer Jan 22, 2020
@ammaraskar ammaraskar force-pushed the ammaraskar:tp_print_remove branch from 4a9a778 to b7179f4 Jan 22, 2020
@ammaraskar ammaraskar force-pushed the ammaraskar:tp_print_remove branch from b7179f4 to 60fa633 Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.