Commits

Georg Brandl  committed d0a898f Draft

urllib.request: fix spacing errors in exception/warning messages.

  • Participants
  • Parent commits 64f5d76

Comments (0)

Files changed (1)

File Lib/urllib/request.py

         self.proxies = proxies
         for type, url in proxies.items():
             setattr(self, '%s_open' % type,
-                    lambda r, proxy=url, type=type, meth=self.proxy_open: \
-                    meth(r, proxy, type))
+                    lambda r, proxy=url, type=type, meth=self.proxy_open:
+                        meth(r, proxy, type))
 
     def proxy_open(self, req, proxy, type):
         orig_type = req.type
         if request.data is not None:  # POST
             data = request.data
             if isinstance(data, str):
-                msg = "POST data should be bytes or an iterable of bytes."\
-                      "It cannot be str"
+                msg = "POST data should be bytes or an iterable of bytes. " \
+                      "It cannot be of type str."
                 raise TypeError(msg)
             if not request.has_header('Content-type'):
                 request.add_unredirected_header(
 
     # Constructor
     def __init__(self, proxies=None, **x509):
-        msg = "%(class)s style of invoking requests is deprecated."\
+        msg = "%(class)s style of invoking requests is deprecated. " \
               "Use newer urlopen functions/methods" % {'class': self.__class__.__name__}
         warnings.warn(msg, DeprecationWarning, stacklevel=3)
         if proxies is None: