Skip to content

Commit

Permalink
Merge pull request #598 from kianmeng/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
edschofield authored Feb 21, 2024
2 parents 6153844 + f16e1c1 commit 350e87a
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion docs/3rd-party-py3k-compat-code/jinja2_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def encode_filename(filename):

def with_metaclass(meta, *bases):
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instanciation that replaces
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass. Because of internal type checks
# we also need to make sure that we downgrade the custom metaclass
# for one level to something closer to type (that's why __call__ and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"collapsed": false,
"input": [
"# Py3-style iterators written as new-style classes (subclasses of\n",
"# future.builtins.object) are backward compatibile with Py2:\n",
"# future.builtins.object) are backward compatible with Py2:\n",
"class Upper(object):\n",
" def __init__(self, iterable):\n",
" self._iter = iter(iterable)\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/standard_library_imports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ As of version 0.14, the ``future`` package comes with top-level packages for
Python 2.x that provide access to the reorganized standard library modules
under their Python 3.x names.

Direct imports are the preferred mechanism for accesing the renamed standard
Direct imports are the preferred mechanism for accessing the renamed standard
library modules in Python 2/3 compatible code. For example, the following clean
Python 3 code runs unchanged on Python 2 after installing ``future``::

Expand Down
4 changes: 2 additions & 2 deletions docs/whatsnew.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ This is a major bug-fix and feature release, including:
- Fix an issue with copyreg import under Py3 that results in unexposed stdlib functionality
- Export and document types in future.utils
- Update behavior of newstr.__eq__() to match str.__eq__() as per reference docs
- Fix raising and the raising fixer to handle cases where the syntax is ambigious
- Fix raising and the raising fixer to handle cases where the syntax is ambiguous
- Allow "default" parameter in min() and max() (Issue #334)
- Implement __hash__() in newstr (Issue #454)
- Future proof some version checks to handle the fact that Py4 won't be a major breaking release
Expand Down Expand Up @@ -127,7 +127,7 @@ This is a major bug-fix release, including:
- Fix ``past.translation`` on read-only file systems
- Fix Tkinter import bug introduced in Python 2.7.4 (issue #262)
- Correct TypeError to ValueError in a specific edge case for newrange
- Support inequality tests betwen newstrs and newbytes
- Support inequality tests between newstrs and newbytes
- Add type check to __get__ in newsuper
- Fix fix_divsion_safe to support better conversion of complex expressions, and
skip obvious float division.
Expand Down
2 changes: 1 addition & 1 deletion src/future/backports/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def today(cls):

@classmethod
def fromordinal(cls, n):
"""Contruct a date from a proleptic Gregorian ordinal.
"""Construct a date from a proleptic Gregorian ordinal.
January 1 of year 1 is day 1. Only the year, month and day are
non-zero in the result.
Expand Down
2 changes: 1 addition & 1 deletion src/future/backports/email/_header_value_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2867,7 +2867,7 @@ def parse_content_type_header(value):
_find_mime_parameters(ctype, value)
return ctype
ctype.append(token)
# XXX: If we really want to follow the formal grammer we should make
# XXX: If we really want to follow the formal grammar we should make
# mantype and subtype specialized TokenLists here. Probably not worth it.
if not value or value[0] != '/':
ctype.defects.append(errors.InvalidHeaderDefect(
Expand Down
4 changes: 2 additions & 2 deletions src/future/backports/email/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, _class=Message, **_3to2kwargs):
textual representation of the message.
The string must be formatted as a block of RFC 2822 headers and header
continuation lines, optionally preceeded by a `Unix-from' header. The
continuation lines, optionally preceded by a `Unix-from' header. The
header block is terminated either by the end of the string or by a
blank line.
Expand Down Expand Up @@ -92,7 +92,7 @@ def __init__(self, *args, **kw):
textual representation of the message.
The input must be formatted as a block of RFC 2822 headers and header
continuation lines, optionally preceeded by a `Unix-from' header. The
continuation lines, optionally preceded by a `Unix-from' header. The
header block is terminated either by the end of the input or by a
blank line.
Expand Down
2 changes: 1 addition & 1 deletion src/future/backports/xmlrpc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ def close(self):
# Send HTTP request.
#
# @param host Host descriptor (URL or (URL, x509 info) tuple).
# @param handler Targer RPC handler (a path relative to host)
# @param handler Target RPC handler (a path relative to host)
# @param request_body The XML-RPC request body
# @param debug Enable debugging if debug is true.
# @return An HTTPConnection.
Expand Down
2 changes: 1 addition & 1 deletion src/future/standard_library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import socketserver
import winreg # on Windows only
import test.support
import html, html.parser, html.entites
import html, html.parser, html.entities
import http, http.client, http.server
import http.cookies, http.cookiejar
import urllib.parse, urllib.request, urllib.response, urllib.error, urllib.robotparser
Expand Down
2 changes: 1 addition & 1 deletion src/future/types/newint.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def to_bytes(self, length, byteorder='big', signed=False):
bits = length * 8
num = (2**bits) + self
if num <= 0:
raise OverflowError("int too smal to convert")
raise OverflowError("int too small to convert")
else:
if self < 0:
raise OverflowError("can't convert negative int to unsigned")
Expand Down
2 changes: 1 addition & 1 deletion src/future/types/newrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def index(self, value):
raise ValueError('%r is not in range' % value)

def count(self, value):
"""Return the number of ocurrences of integer `value`
"""Return the number of occurrences of integer `value`
in the sequence this range represents."""
# a value can occur exactly zero or one times
return int(value in self)
Expand Down
2 changes: 1 addition & 1 deletion src/libfuturize/fixer_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def suitify(parent):
"""
for node in parent.children:
if node.type == syms.suite:
# already in the prefered format, do nothing
# already in the preferred format, do nothing
return

# One-liners have no suite node, we have to fake one up
Expand Down
4 changes: 2 additions & 2 deletions src/libfuturize/fixes/fix_metaclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

def has_metaclass(parent):
""" we have to check the cls_node without changing it.
There are two possiblities:
There are two possibilities:
1) clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
2) clsdef => simple_stmt => expr_stmt => Leaf('__meta')
"""
Expand All @@ -63,7 +63,7 @@ def fixup_parse_tree(cls_node):
# already in the preferred format, do nothing
return

# !%@#! oneliners have no suite node, we have to fake one up
# !%@#! one-liners have no suite node, we have to fake one up
for i, node in enumerate(cls_node.children):
if node.type == token.COLON:
break
Expand Down
4 changes: 2 additions & 2 deletions tests/test_future/test_http_cookiejar.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class CookieTests(unittest.TestCase):
## comma-separated list, it'll be a headache to parse (at least my head
## starts hurting every time I think of that code).
## - Expires: You'll get all sorts of date formats in the expires,
## including emtpy expires attributes ("expires="). Be as flexible as you
## including empty expires attributes ("expires="). Be as flexible as you
## can, and certainly don't expect the weekday to be there; if you can't
## parse it, just ignore it and pretend it's a session cookie.
## - Domain-matching: Netscape uses the 2-dot rule for _all_ domains, not
Expand Down Expand Up @@ -1734,7 +1734,7 @@ def test_session_cookies(self):
key = "%s_after" % cookie.value
counter[key] = counter[key] + 1

# a permanent cookie got lost accidently
# a permanent cookie got lost accidentally
self.assertEqual(counter["perm_after"], counter["perm_before"])
# a session cookie hasn't been cleared
self.assertEqual(counter["session_after"], 0)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_future/test_standard_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def test_future_moves_dbm(self):
from future.moves.dbm import ndbm


# Running the following tkinter test causes the following bizzare test failure:
# Running the following tkinter test causes the following bizarre test failure:
#
# ======================================================================
# FAIL: test_open_default_encoding (future.tests.test_builtins.BuiltinTest)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_future/test_urllib.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Regresssion tests for urllib"""
"""Regression tests for urllib"""
from __future__ import absolute_import, division, unicode_literals

import io
Expand Down Expand Up @@ -1229,7 +1229,7 @@ def open_spam(self, url):
# Everywhere else they work ok, but on those machines, sometimes
# fail in one of the tests, sometimes in other. I have a linux, and
# the tests go ok.
# If anybody has one of the problematic enviroments, please help!
# If anybody has one of the problematic environments, please help!
# . Facundo
#
# def server(evt):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_future/test_urllib_toplevel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Regresssion tests for urllib"""
"""Regression tests for urllib"""
from __future__ import absolute_import, division, unicode_literals

import io
Expand Down Expand Up @@ -1247,7 +1247,7 @@ def open_spam(self, url):
# Everywhere else they work ok, but on those machines, sometimes
# fail in one of the tests, sometimes in other. I have a linux, and
# the tests go ok.
# If anybody has one of the problematic enviroments, please help!
# If anybody has one of the problematic environments, please help!
# . Facundo
#
# def server(evt):
Expand Down

0 comments on commit 350e87a

Please sign in to comment.