Skip to content

Conversation

DimitrisJim
Copy link
Contributor

No description provided.

@mention-bot
Copy link

@DimitrisJim, thanks for your PR! By analyzing the history of the files in this pull request, we identified @freddrake, @ambv and @benjaminp to be potential reviewers.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would approve typo fixes, but the commit contains changes that can't be considered as typos.

Lib/asynchat.py Outdated
@@ -191,8 +191,8 @@ def handle_close(self):

def push(self, data):
if not isinstance(data, (bytes, bytearray, memoryview)):
raise TypeError('data argument must be byte-ish (%r)',
type(data))
raise TypeError('data argument must be a bytes-like object, not %r' %
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a typo. Open a new PR for this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

@@ -300,10 +300,10 @@ def __init__(self, source=None, filename=None):
# Exactly one of `source'/`filename' arguments has to be given.
# `filename' kept for compatibility.
if filename and source:
raise ValueError("Cannot specify both `filename' and `source'. "
"Use `source'.")
raise ValueError("Cannot specify both 'filename' and 'source'. "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a typo. This is just a quoting style.

Copy link
Contributor Author

@DimitrisJim DimitrisJim Mar 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like a really odd quotation style, though, it isn't used elsewhere in configparser.py and that's why I considered it a 'typo'. Should I remove it nonetheless?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in other modules. Yes, remove this change.

@@ -1766,7 +1766,7 @@ def __init__(self, filename=None, delayload=False, policy=None):
try:
filename+""
except:
raise ValueError("filename must be string-like")
raise ValueError("filename must be of type str")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a typo. And proposed wording is not correct.

@DimitrisJim
Copy link
Contributor Author

I addressed the issues you raised @serhiy-storchaka, thanks! Will now create a PR for the other issue.

@@ -766,7 +766,7 @@ def truncate(self, pos=None):

def flush(self):
if self.closed:
raise ValueError("flush of closed file")
raise ValueError("flush on closed file")
Copy link
Member

@bitdancer bitdancer Mar 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a typo, it is a wording choice. I don't see the point in changing it, and in fact as a native English speaker I think 'of' reads better here. To use 'on' you'd want to say "flush called on closed file object", which is wordier.

Copy link
Contributor Author

@DimitrisJim DimitrisJim Mar 25, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered this a typo mainly due to the wording used on other methods such as tell, truncate, seek (and some other ones). I might not see it but, is there anything special about flush (that doesn't apply to the other methods) that warrants the use of of instead of on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. That's a good point. 'seek on' sounds right, as does 'tell on'. 'truncate on' doesn't. but to make it "right" I'd want it to be 'truncation of', which would lose the method name.

So, upon consideration consistency is better than "better English" in this case. Keep the change.

@ambv ambv merged commit 1e73dbb into python:master Mar 26, 2017
@ambv
Copy link
Contributor

ambv commented Mar 26, 2017

The code coverage failure is obviously unrelated.

@DimitrisJim DimitrisJim deleted the fix_err_message_typos branch March 27, 2017 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants