Textwrapping with paragraphs, was RE: Confusing textwrap parameters, and request for RE help
Steve Smith wrote:
> I am having the same issue. I can either get the text to wrap, which makes
> all the text wrap, or I can get the text to ignore independent '/n'
> characters, so that all the blank space is removed. I'd like to set up my
> code, so that only 1 blank space is remaining (I'll settle for none at
> this point), an the text wraps up to 100 chars or so out per line. Does
> anyone have any thoughts on the attached code? And what I'm not doing
> correctly?
>
>
> #import statements
> import textwrap
> import requests
> from bs4 import BeautifulSoup
>
> #class extension of textwrapper
> class DocumentWrapper(textwrap.TextWrapper):
>
> def wrap(self, text):
> split_text = text.split('\n')
> lines = [line for para in split_text for line in
> textwrap.TextWrapper.wrap(self, para)] return lines
>
> #import statement of text.
> page = requests.get("http://classics.mit.edu/Aristotle/rhetoric.mb.txt";)
> soup = BeautifulSoup(page.text, "html.parser")
>
> #instantiation of extension of textwrap.wrap.
> d = DocumentWrapper(width=110,initial_indent='',fix_sentence_endings=True
> ) new_string = d.fill(page.text)
>
> #set up an optional variable, even attempted applying BOTH the extended
> #method and the original method to the issue... nothing has worked.
> #new_string_2 = textwrap.wrap(new_string,90)
>
> #with loop with JUST the class extension of textwrapper.
> with open("Art_of_Rhetoric.txt", "w") as f:
> f.writelines(new_string)
>
> #with loop with JUST the standard textwrapper.text method applied to it.
> with open("Art_of_Rhetoric2.txt", "w") as f:
> f.writelines(textwrap.wrap(page.text,90))
I think in your case the problem is that newlines in the source text do not
indicate paragraphs -- thus you should not keep them. Instead try
interpreting empty lines as paragraph separators:
$ cat tmp.py
import sys
import textwrap
import itertools
import requests
from bs4 import BeautifulSoup
class DocumentWrapper(textwrap.TextWrapper):
def wrap(self, text):
paras = (
"".join(group) for non_empty, group in itertools.groupby(
text.splitlines(True),
key=lambda line: bool(line.strip())
) if non_empty
)
wrap = super().wrap
lines = [line for para in paras for line in wrap(para)]
return lines
page = requests.get("http://classics.mit.edu/Aristotle/rhetoric.mb.txt";).text
d = DocumentWrapper(width=110, initial_indent='', fix_sentence_endings=True)
new_string = d.fill(page)
sys.stdout.write(new_string)
$ python3 tmp.py | head -n10
Provided by The Internet Classics Archive. See bottom for copyright.
Available online at
http://classics.mit.edu//Aristotle/rhetoric.html
Rhetoric By Aristotle
Translated by W. Rhys Roberts
--
BOOK I
Part 1
Rhetoric is the counterpart of Dialectic. Both alike are concerned with such
things as come, more or less,
within the general ken of all men and belong to no definite science.
Accordingly all men make use, more or
less, of both; for to a certain extent all men attempt to discuss statements
and to maintain them, to defend
Traceback (most recent call last):
File "tmp.py", line 27, in
sys.stdout.write(new_string)
BrokenPipeError: [Errno 32] Broken pipe
$
--
https://mail.python.org/mailman/listinfo/python-list
how to specify trusted hosts in windows config file
Hi, I'm able to get past the CERTIFICATE_VERIFY_FAILED error with various packages by specifying trusted host on the command line. But I can't seem to upgrade pip itself. I keep getting the message "You are using pip version 19.2.3, however 20.0.2 is available." But none of the commands on the web seem to be able to upgrade pip, without getting either the CERTIFICATE_VERIFY_FAILED error, or the above message. There are mentions of a pip.ini file that can be edited bypass the Certificate errors. But I've done a global search on my hard drive, and cannot locate this pip.ini. Is there some way of simply downloading the latest pip version, and extracting into the python\scripts folder? -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On Tue, Mar 31, 2020 at 2:31 AM wrote: > > Hi, > > I'm able to get past the > > CERTIFICATE_VERIFY_FAILED > > > error with various packages by specifying trusted host on the command line. > > > But I can't seem to upgrade pip itself. I keep getting the message > > "You are using pip version 19.2.3, however 20.0.2 is available." > > But none of the commands on the web seem to be able to upgrade pip, without > getting either the CERTIFICATE_VERIFY_FAILED error, or the above message. > Before trying to solve the symptom, see what the underlying problem is. Are you actually sure you're getting to the right server? Maybe the actual problem is that you aren't able to connect to the true PyPI, and that's what the cert failure is warning you of. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On 2020-03-30 16:25, [email protected] wrote: Hi, I'm able to get past the CERTIFICATE_VERIFY_FAILED error with various packages by specifying trusted host on the command line. But I can't seem to upgrade pip itself. I keep getting the message "You are using pip version 19.2.3, however 20.0.2 is available." But none of the commands on the web seem to be able to upgrade pip, without getting either the CERTIFICATE_VERIFY_FAILED error, or the above message. There are mentions of a pip.ini file that can be edited bypass the Certificate errors. But I've done a global search on my hard drive, and cannot locate this pip.ini. Is there some way of simply downloading the latest pip version, and extracting into the python\scripts folder? Have you tried: py -m pip install --upgrade pip -- https://mail.python.org/mailman/listinfo/python-list
0x80070643 python download error
I am trying to download python on my laptop and this error came up. How do I fix this error appearing and download python 3.8.2? -- https://mail.python.org/mailman/listinfo/python-list
Re: [baseline 1.0.0] Easy String Baseline
how can we complete this project..
For this project, you’ll create a “word cloud” from a text by writing a
script. This script needs to process the text, remove punctuation, count
the frequencies, and ignore uninteresting or irrelevant words.
On Mon, Mar 30, 2020 at 6:00 PM Dan Gass wrote:
> I am please to announce the availability of the first major release of the
> "baseline" package.
>
> This tool streamlines creation and maintenance of tests which compare
> string
> output against a baseline. It offers a mechanism to compare a string
> against
> a baselined copy and update the baselined copy to match the new value when
> a
> mismatch occurs. The update process includes a manual step to facilitate a
> review of the change before acceptance. The tool uses multi-line string
> format
> for string baselines to improve readability for human review.
>
> Docs: https://baseline.readthedocs.io/en/latest/
> PyPi: https://pypi.org/project/baseline/
> Repo: https://github.com/dmgass/baseline
>
> License: MIT
>
> With Regards,
> Dan Gass
> (dan.gass at gmail)
>
> ***
> Changes
> ***
>
> The following summarizes changes since the previous "beta" release (the
> major revision bump signifies backwards incompatible changes):
>
> + Improve baseline update when multiple values compared against the
> same baseline. Generate a single multi-line baseline with headers
> between the various alternative values. This facilitates updating
> the baseline again.
>
> + Support Python 3.8. Previously, when run using 3.8, the baseline
> update tool misplaced baseline updates in the first triple quoted
> string found above the baseline. (Python 3.8 stack frames now
> report the line number of the first line in a statement rather
> than the last.)
>
> + Change behavior of ``Baseline`` to use raw strings when updating
> baselines when possible to improve readability.
>
> + Deprecate ``RawBaseline`` since ``Baseline`` now incorporates
> its behavior.
>
>
> ***
> Quick Start
> ***
>
> Create an empty baseline with a triple quoted multi-line string. Place
> the ending triple quote on a separate line and indent it to the level
> you wish the string baseline update to be indented to. Add a compare of
> the string being tested to the baseline string. Then save the file as
> ``fox.py``:
>
> .. code-block:: python
>
> from baseline import Baseline
>
> expected = Baseline("""
> """)
>
> test_string = """THE QUICK BROWN FOX
> JUMPS
> OVER THE LAZY DOG."""
>
> assert test_string == expected
>
>
> Run ``fox.py`` and observe that the ``assert`` raises an exception since
> the strings are not equal. Because the comparison failed, the tool located
> the triple quoted baseline string in the source file and updated it with
> the
> mis-compared value. When the interpreter exited, the tool saved the updated
> source file but changed the file name to ``fox.update.py``:
>
> .. code-block:: python
>
> from baseline import Baseline
>
> expected = Baseline("""
> THE QUICK BROWN FOX
> JUMPS
> OVER THE LAZY DOG.
> """)
>
> test_string = """THE QUICK BROWN FOX
> JUMPS
> OVER THE LAZY DOG."""
>
> assert test_string == expected
>
>
> After reviewing the change with your favorite file differencing tool,
> accept the change by either manually overwriting the original file or use
> the ``baseline`` command line tool to scan the directory for updated
> scripts and accept them:
>
> .. code-block:: shell
>
> $ python -m baseline *
> Found updates for:
> fox.py
>
> Hit [ENTER] to update, [Ctrl-C] to cancel
>
> fox.update.py -> fox.py
>
>
> Run ``fox.py`` again and observe the ``assert`` does not raise an exception
> nor is a source file update generated. If in the future the test value
> changes, the ``assert`` will raise an exception and cause a new source file
> update to be generated. Simply repeat the review and acceptance step and
> you
> are back in business!
>
>
> https://baseline.readthedocs.io/en/latest/
> --
> Python-announce-list mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> https://mail.python.org/mailman3/lists/python-announce-list.python.org/
>
> Support the Python Software Foundation:
> http://www.python.org/psf/donations/
>
--
https://mail.python.org/mailman/listinfo/python-list
Re: [baseline 1.0.0] Easy String Baseline
On Tue, Mar 31, 2020 at 4:01 AM JAYA KANOJIYA wrote: > > how can we complete this project.. > For this project, you’ll create a “word cloud” from a text by writing a > script. This script needs to process the text, remove punctuation, count > the frequencies, and ignore uninteresting or irrelevant words. > You're replying to an unrelated post to ask for homework help. Recommendation: Do your own homework. Reread your study materials and *do the work*. You can't become a programmer by asking people to write your code for you. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: Confusing textwrap parameters, and request for RE help
On Tue, Mar 31, 2020 at 3:53 AM Dennis Lee Bieber wrote:
>
> On Sun, 29 Mar 2020 04:21:04 +, Steve Smith
> declaimed the following:
>
> >I am having the same issue. I can either get the text to wrap, which makes
> >all the text wrap, or I can get the text to ignore independent '/n'
> >characters, so that all the blank space is removed. I'd like to set up my
> >code, so that only 1 blank space is remaining (I'll settle for none at this
> >point), an the text wraps up to 100 chars or so out per line. Does anyone
> >have any thoughts on the attached code? And what I'm not doing correctly?
> >
> >
> >#import statements
> >import textwrap
> >import requests
> >from bs4 import BeautifulSoup
> >
> >#class extension of textwrapper
> >class DocumentWrapper(textwrap.TextWrapper):
> >
> >def wrap(self, text):
> >split_text = text.split('\n')
> >lines = [line for para in split_text for line in
> > textwrap.TextWrapper.wrap(self, para)]
>
> That... Looks rather incorrect.
>
> In most all list-comprehensions, the result item is on the left, and
> the rest is the iteration clause... And why the (self, ...)? You inherited
> from textwrap.TextWrapper, yet here you bypass the inherited to invoke the
> wrap method (without instantiating it!).
>
I think this is a reasonable thing to do, but an awkward way to spell
it. If you mean to call the original wrap method, it would normally be
spelled super().wrap(para) instead.
Is that what you were intending, Steve?
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On Monday, March 30, 2020 at 12:09:48 PM UTC-4, MRAB wrote: > On 2020-03-30 16:25, dcwhatthe wrote: > > Hi, > > > > I'm able to get past the > > > > CERTIFICATE_VERIFY_FAILED > > > > > > error with various packages by specifying trusted host on the command line. > > > > > > But I can't seem to upgrade pip itself. I keep getting the message > > > > "You are using pip version 19.2.3, however 20.0.2 is available." > > > > But none of the commands on the web seem to be able to upgrade pip, without > > getting either the CERTIFICATE_VERIFY_FAILED error, or the above message. > > > > > > There are mentions of a pip.ini file that can be edited bypass the > > Certificate errors. But I've done a global search on my hard drive, and > > cannot locate this pip.ini. > > > > > > Is there some way of simply downloading the latest pip version, and > > extracting into the python\scripts folder? > > > Have you tried: > > py -m pip install --upgrade pip Yes. CERTIFICATE error. -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On Monday, March 30, 2020 at 12:08:54 PM UTC-4, Chris Angelico wrote: > On Tue, Mar 31, 2020 at 2:31 AM wrote: > > > > Hi, > > > > I'm able to get past the > > > > CERTIFICATE_VERIFY_FAILED > > > > > > error with various packages by specifying trusted host on the command line. > > > > > > But I can't seem to upgrade pip itself. I keep getting the message > > > > "You are using pip version 19.2.3, however 20.0.2 is available." > > > > But none of the commands on the web seem to be able to upgrade pip, without > > getting either the CERTIFICATE_VERIFY_FAILED error, or the above message. > > > > Before trying to solve the symptom, see what the underlying problem > is. Are you actually sure you're getting to the right server? Maybe > the actual problem is that you aren't able to connect to the true > PyPI, and that's what the cert failure is warning you of. > > ChrisA Hi ChrisA, Nope, I'm not certain. I just copied and pasted a command line on the web. The command line doesn't specify a server. -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On Tue, Mar 31, 2020 at 4:21 AM wrote: > > On Monday, March 30, 2020 at 12:08:54 PM UTC-4, Chris Angelico wrote: > > On Tue, Mar 31, 2020 at 2:31 AM wrote: > > > > > > Hi, > > > > > > I'm able to get past the > > > > > > CERTIFICATE_VERIFY_FAILED > > > > > > > > > error with various packages by specifying trusted host on the command > > > line. > > > > > > > > > But I can't seem to upgrade pip itself. I keep getting the message > > > > > > "You are using pip version 19.2.3, however 20.0.2 is available." > > > > > > But none of the commands on the web seem to be able to upgrade pip, > > > without getting either the CERTIFICATE_VERIFY_FAILED error, or the above > > > message. > > > > > > > Before trying to solve the symptom, see what the underlying problem > > is. Are you actually sure you're getting to the right server? Maybe > > the actual problem is that you aren't able to connect to the true > > PyPI, and that's what the cert failure is warning you of. > > > > ChrisA > > Hi ChrisA, > > Nope, I'm not certain. I just copied and pasted a command line on the web. > The command line doesn't specify a server. > First off, try adding the "--verbose" option to pip, which should tell you the exact URLs that it's trying to download (which, in effect, will tell you the servers). When I do that, I'm seeing two key servers: pypi.org (https://pypi.org/simple/pip/) and files.pythonhosted.org (lots of https://files.pythonhosted.org/packages/ URLs). When I look up those names, I get these results: pypi.org. 86278 IN A 151.101.192.223 pypi.org. 86278 IN A 151.101.64.223 pypi.org. 86278 IN A 151.101.128.223 pypi.org. 86278 IN A 151.101.0.223 files.pythonhosted.org. 86400 IN CNAME dualstack.r.ssl.global.fastly.net. dualstack.r.ssl.global.fastly.net. 30 IN A 151.101.81.63 Check two things: firstly, do your URLs show the same domains? And secondly, are you connecting to the same IP addresses? If either of those is different, it's possible that you have a local PyPI mirror, or (more likely) something is blocking those requests and silently redirecting them to something else, such as a login page. But at that point, it's impossible to guess at anything, so start with the above. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
These are some of the command lines I've typed, and the results. It looks like it's going to https://pypi.org. I have no idea whether that's correct, or not. I'm able to get past the Certificate error with other packages like requests. But I just can't update pip. : [C:\TCMD25]python -m pip install --trusted-host pypi.org --trusted-host --upgrade pip Requirement already satisfied: pip in c:\users\blahblah\appdata\local\programs\python\python38-32\lib\site-packages (19.2.3) WARNING: You are using pip version 19.2.3, however version 20.0.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. [C:\..\Python\Python38-32\Scripts]python -m pip install --verbose --trusted-host pypi.org --trusted-host --upgrade pip Created temporary directory: ... Created requirements tracker ... Requirement already satisfied: pip in c:\users\dBlah2\appdata\local\programs\python\python38-32\lib\site-packages (19.2.3) Cleaning up... Removed build tracker 'C:\\Users\\DBlah2\\AppData\\Local\\Temp\\pip-req-tracker-1djqfhix' WARNING: You are using pip version 19.2.3, however version 20.0.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. [C:\..\Python\Python38-32\Scripts]python -m pip --verbose install --upgrade pip Created temporary directory: ... Created requirements tracker ... 1 location(s) to search for versions of pip: * https://pypi.org/simple/pip/ Getting page https://pypi.org/simple/pip/ Found index url https://pypi.org/simple Looking up "https://pypi.org/simple/pip/"; in the cache Request header has "max_age" as 0, cache bypassed Starting new HTTPS connection (1): pypi.org:443 Incremented Retry for (url='/simple/pip/'): Retry(total=4, connect=None, read=None, redirect=None, status=None) WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFIC ATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pip/ Starting new HTTPS connection (2): pypi.org:443 Incremented Retry for (url='/simple/pip/'): Retry(total=3, connect=None, read=None, redirect=None, status=None) WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFIC ATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pip/ Starting new HTTPS connection (3): pypi.org:443 Incremented Retry for (url='/simple/pip/'): Retry(total=2, connect=None, read=None, redirect=None, status=None) WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFIC ATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pip/ Starting new HTTPS connection (4): pypi.org:443 Incremented Retry for (url='/simple/pip/'): Retry(total=1, connect=None, read=None, redirect=None, status=None) WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFIC ATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pip/ Starting new HTTPS connection (5): pypi.org:443 Incremented Retry for (url='/simple/pip/'): Retry(total=0, connect=None, read=None, redirect=None, status=None) WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFIC ATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pip/ Starting new HTTPS connection (6): pypi.org:443 Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceed ed with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif icate (_ssl.c:1108)'))) - skipping Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect Given no hashes to check 0 links for project 'pip': discarding no candidates Installed version (19.2.3) is most up-to-date (past versions: none) Requirement already up-to-date: pip in c:\users\dBlah2\appdata\local\programs\python\python38-32\lib\site-packages (19.2.3) Cleaning up... Removed build tracker 'C:\\Users\\DBlah2\\AppData\\Local\\Temp\\pip-req-tracker-x0doslyv' WARNING: You are using pip version 19.2.3, however version 20.0.2 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command. -- https://mail.python.org/mailman/listinfo/
Re: how to specify trusted hosts in windows config file
On Tue, Mar 31, 2020 at 5:46 AM wrote: > > These are some of the command lines I've typed, and the results. It looks > like it's going to https://pypi.org. > > I have no idea whether that's correct, or not. > > I'm able to get past the Certificate error with other packages like requests. > But I just can't update pip. > That is the correct domain name. The question is, does it translate to the correct IP address? Try doing a DNS lookup and compare it to the results I got. And, don't think in terms of *getting past the error*. Try to solve the actual problem. The certificate error is protecting you against installing a forged version of PIP. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: 0x80070643 python download error
JimathyJim Jim <[email protected]> writes: > I am trying to download python on my laptop and this error came up. How do > I fix this error appearing and download python 3.8.2? Maybe you could specify what OS, and from what site/URL you are downloading. And at which moment the error appears. -- Pieter van Oostrum www: http://pieter.vanoostrum.org/ PGP key: [8DAE142BE17999C4] -- https://mail.python.org/mailman/listinfo/python-list
Re: Confusing textwrap parameters, and request for RE help
Chris Angelico wrote:
[Steve]
>>>def wrap(self, text):
>>>split_text = text.split('\n')
>>>lines = [line for para in split_text for line in
textwrap.TextWrapper.wrap(self, para)]
[Dennis]
>> That... Looks rather incorrect.
>>
>> In most all list-comprehensions, the result item is on the left,
and
>> the rest is the iteration clause... And why the (self, ...)? You
inherited
>> from textwrap.TextWrapper, yet here you bypass the inherited to invoke
the
>> wrap method (without instantiating it!).
> I think this is a reasonable thing to do,
Indeed, Steve's trying to apply the superclass algo on every paragraph of
the text.
> but an awkward way to spell it. If you mean to call the original wrap
> method, it would normally be spelled super().wrap(para) instead.
Probably a workaround because super() cannot do its magic in the list
comprehensions namespace. Another workaround is to define
wrap = super().wrap
and then use just wrap() in the listcomp.
--
https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On Monday, March 30, 2020 at 2:49:55 PM UTC-4, Chris Angelico wrote: > On Tue, Mar 31, 2020 at 5:46 AM dc wrote: > > > > These are some of the command lines I've typed, and the results. It looks > > like it's going to https://pypi.org. > > > > I have no idea whether that's correct, or not. > > > > I'm able to get past the Certificate error with other packages like > > requests. But I just can't update pip. > > > > That is the correct domain name. The question is, does it translate to > the correct IP address? Try doing a DNS lookup and compare it to the > results I got. > > And, don't think in terms of *getting past the error*. Try to solve > the actual problem. The certificate error is protecting you against > installing a forged version of PIP. > > ChrisA For pypi.org alone, my dns lookup differs from yours: 151.101.128.223. Chris, Is there a way to just install pip manually, and bypass all this? I mean, if we know we're downloading it from the appropriate ftp or git site, then doesn't that in itself avoid a faulty PIP version? -- https://mail.python.org/mailman/listinfo/python-list
Re: Confusing textwrap parameters, and request for RE help
On Tue, Mar 31, 2020 at 8:20 AM Peter Otten <[email protected]> wrote: > > Chris Angelico wrote: > > but an awkward way to spell it. If you mean to call the original wrap > > method, it would normally be spelled super().wrap(para) instead. > > Probably a workaround because super() cannot do its magic in the list > comprehensions namespace. Another workaround is to define > > wrap = super().wrap > > and then use just wrap() in the listcomp. > Ah ha, I didn't think of that. And yes, I would agree, that's probably the cleanest way. Alternatively, the longhand super(__class__, self) should work too, as I believe __class__ isn't redefined by the implicit closure. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
On Tue, Mar 31, 2020 at 8:21 AM wrote: > > On Monday, March 30, 2020 at 2:49:55 PM UTC-4, Chris Angelico wrote: > > On Tue, Mar 31, 2020 at 5:46 AM dc wrote: > > > > > > These are some of the command lines I've typed, and the results. It > > > looks like it's going to https://pypi.org. > > > > > > I have no idea whether that's correct, or not. > > > > > > I'm able to get past the Certificate error with other packages like > > > requests. But I just can't update pip. > > > > > > > That is the correct domain name. The question is, does it translate to > > the correct IP address? Try doing a DNS lookup and compare it to the > > results I got. > > > > And, don't think in terms of *getting past the error*. Try to solve > > the actual problem. The certificate error is protecting you against > > installing a forged version of PIP. > > > > ChrisA > > For pypi.org alone, my dns lookup differs from yours: 151.101.128.223. > > Chris, > > Is there a way to just install pip manually, and bypass all this? I mean, if > we know we're downloading it from the appropriate ftp or git site, then > doesn't that in itself avoid a faulty PIP version? > Ahh, I think I see what's happening. Something's interfering with your DNS - that's a Fastly IP address. I think the best solution would be to undo or bypass whatever's messing with your network, and then you'll be able to use pip normally without any sort of issues. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
