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-39323: Fix directory separator of imghdr cli output #17993

Open
wants to merge 2 commits into
base: master
from

Conversation

@tirkarthi
Copy link
Contributor

tirkarthi commented Jan 13, 2020

  • Use os.sep to indicate directory separator in imghdr cli output.
  • Add tests for imghdr cli.

https://bugs.python.org/issue39323

tirkarthi added 2 commits Jan 11, 2020
* Use os.sep to display path directories for better compatibility
* Add tests for imghdr cli
Copy link
Member

corona10 left a comment

LGTM for test code :) and I left a comment on Lib/imghdr.py

@@ -148,7 +148,7 @@ def testall(list, recursive, toplevel):
import os
for filename in list:
if os.path.isdir(filename):
print(filename + '/:', end=' ')
print(filename + os.sep +':', end=' ')

This comment has been minimized.

Copy link
@corona10

corona10 Jan 14, 2020

Member

I don't know this kind of code churn is proper,
But if this is needed, what about this?

print(f'{filename}{os.sep}:', end=' ')

This comment has been minimized.

Copy link
@tirkarthi

tirkarthi Jan 14, 2020

Author Contributor

As a personal opinion, I don't see much improvement here in changing. It's just concatenating two separate variables and there are no other strings also as part of string like a + " equals " + b to f"{a} equals {b}" .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.