[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2017-07-27 Thread John Nagle
John Nagle added the comment: As the original author of the predecessor bug report (issue 15873) in 2012, I would suggest that there's too much bikeshedding here. I filed this bug because there was no usable ISO8601 date parser available. PyPi contained four slightly different buggy ones

[issue28756] robotfileparser always uses default Python user-agent

2016-11-20 Thread John Nagle
John Nagle added the comment: (That's from a subclass I wrote. As a change to RobotFileParser, __init__ should start like this.) def __init__(self, url='', user_agent=None): self.user_agent = user_agent# save user agent

[issue28756] robotfileparser always uses default Python user-agent

2016-11-20 Thread John Nagle
John Nagle added the comment: Suggest adding a user_agent optional parameter, as shown here: def __init__(self, url='', user_agent=None): urllib.robotparser.RobotFileParser.__init__(self, url) # init parent self.user_agent = user_agent# save user agent

[issue28756] robotfileparser always uses default Python user-agent

2016-11-20 Thread John Nagle
New submission from John Nagle: urllib.robotparser.RobotFileParser always uses the default Python user agent. This agent is now blacklisted by many sites, and it's not possible to read the robots.txt file at all. -- components: Library (Lib) messages: 281314 nosy: nagle priority

[issue27065] robotparser user agent considered hostile by mod_security rules.

2016-05-19 Thread John Nagle
New submission from John Nagle: "robotparser" uses the default Python user agent when reading the "robots.txt" file, and there's no parameter for changing that. Unfortunately, the "mod_security" add-on for Apache web server, when used with the standard OWASP ru

[issue24985] Python install test fails - OpenSSL - "dh key too small"

2015-09-02 Thread John Nagle
New submission from John Nagle: Installing Python 3.4.3 on a new CentOS Linux release 7.1.1503 server. Started with source tarball, did usual ./configure; make; make test SSL test fails with "dh key too small". See below. OpenSSL has recently been modified to reject short

[issue23843] ssl.wrap_socket doesn't handle virtual TLS hosts

2015-04-02 Thread John Nagle
John Nagle added the comment: I'm using wrap_socket because I want to read the details of a server's SSL certificate. Starting from Python 3.2, it can be more flexible to use SSLContext.wrap_socket() instead does not convey that ssl.wrap_socket() will fail to connect to some servers

[issue23843] ssl.wrap_socket doesn't handle virtual TLS hosts

2015-04-01 Thread John Nagle
New submission from John Nagle: ssl.wrap_socket() always uses the SSL certificate associated with the raw IP address, rather than using the server_host feature of TLS. Even when wrap_socket is used before calling connect(port, host), the host parameter isn't used by TLS. To get proper TLS

[issue23588] Errno conflicts in ssl.SSLError

2015-04-01 Thread John Nagle
John Nagle added the comment: If SSL error reporting is getting some attention, something should be done to provide better text messages for the SSL errors. All certificate verify exceptions return the string certificate verify failed (_ssl.c:581). The line number in _ssl.c

[issue23736] make test on clean py3 install on CentOS 6.2 - 2 tests fail

2015-03-21 Thread John Nagle
New submission from John Nagle: Installing Python 3.4.2 on CentOS 6. Clean install. Using procedure in README file: ./configure make make test 2 tests fail in make test The first one is because the FTP client test is trying to test against a site that is long gone, the Digital Equipment

[issue23655] Memory corruption using pickle over pipe to subprocess

2015-03-15 Thread John Nagle
John Nagle added the comment: More info: the problem is on the unpickle side. If I use _Unpickle and Pickle, so the unpickle side is in Python, but the pickle side is in C, no problem. If I use Unpickle and _Pickle, so the unpickle side is C, crashes

[issue23655] Memory corruption using pickle over pipe to subprocess

2015-03-13 Thread John Nagle
John Nagle added the comment: minimize you data - that's a big job here. Where are the tests for pickle? Is there one that talks to a subprocess over a pipe? Maybe I can adapt that. -- ___ Python tracker rep...@bugs.python.org http

[issue23655] Memory corruption using pickle over pipe to subprocess

2015-03-13 Thread John Nagle
John Nagle added the comment: Or just use pickle._Pickler instead of pickle.Pickler and like (implementation detail!). Tried that. Changed my own code as follows: 25a26 71,72c72,73 self.reader = pickle.Unpickler(self.proc.stdout)# set up reader self.writer

[issue23655] Memory corruption using pickle over pipe to subprocess

2015-03-13 Thread John Nagle
New submission from John Nagle: I'm porting a large, working system from Python 2 to Python 3, using six, so the same code works with both. One part of the system works a lot like the multiprocessing module, but predates it. It launches child processes with Popen and talks to them using

[issue9679] unicode DNS names in urllib, urlopen

2015-03-06 Thread John Nagle
John Nagle added the comment: Three years later, I'm converting to Python 3. Did this get fixed in Python 3? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9679

[issue23476] SSL cert verify fail for www.verisign.com

2015-03-05 Thread John Nagle
John Nagle added the comment: Will this be applied to the Python 2.7.9 library as well? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23476

[issue23476] SSL cert verify fail for www.verisign.com

2015-02-20 Thread John Nagle
John Nagle added the comment: The fix in Ubuntu was to the Ubuntu certificate store, which is a directory tree with one cert per file, with lots of symbolic links with names based on hashes to express dependencies. Python's SSL isn't using that. Python is taking in one big text file of SSL

[issue23476] SSL cert verify fail for www.verisign.com

2015-02-17 Thread John Nagle
John Nagle added the comment: Add cert file for testing. Source of this file is http://curl.haxx.se/ca/cacert.pem -- Added file: http://bugs.python.org/file38166/cacert.pem ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23476

[issue23476] SSL cert verify fail for www.verisign.com

2015-02-17 Thread John Nagle
John Nagle added the comment: To try this with the OpenSSL command line client, use this shell command: openssl s_client -connect www.verisign.com:443 -CAfile cacert.pem This provides more detailed error messages than Python provides. verify error:num=20:unable to get local issuer

[issue23476] SSL cert verify fail for www.verisign.com

2015-02-17 Thread John Nagle
New submission from John Nagle: SSL certificate verification fails for www.verisign.com when using the cert list from Firefox. Other sites (google.com, python.org) verify fine. This may be related to a known, and fixed, OpenSSL bug. See: http://rt.openssl.org/Ticket/Display.html?id=2732user

[issue20916] ssl.enum_certificates() will not return all certificates trusted by Windows

2015-02-11 Thread John Nagle
John Nagle added the comment: Amusingly, I'm getting this failure on verisign.com on Windows 7 with Python 2.7.9: HTTP error - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)..) The current Verisign root cert (Class 3 public) is, indeed, not in the Windows 7 cert

[issue22873] Re: SSLsocket.getpeercert - return ALL the fields of the certificate.

2014-11-14 Thread John Nagle
New submission from John Nagle: In each revision of getpeercert, a few more fields are returned. Python 3.2 added issuer and notBefore. Python 3.4 added crlDistributionPoints, caIssuers, and OCSP URLS. But some fields still aren't returned. I happen to need CertificatePolicies, which is how

[issue22873] Re: SSLsocket.getpeercert - return ALL the fields of the certificate.

2014-11-14 Thread John Nagle
John Nagle added the comment: May be a duplicate of Issue 204679: ssl.getpeercert() should include extensions http://bugs.python.org/issue20469 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22873

[issue18907] urllib2.open FTP open times out at 20 secs despite timeout parameter

2013-09-14 Thread John Nagle
John Nagle added the comment: The server operator at the US Securities and Exchange Commission writes to me: There was a DNS issue that affected the availability of FTP at night. We believe it is resolved. Please let us know if you encounter any further problems. Thanks, SEC Webmaster. So

[issue18907] urllib2.open FTP open times out at 20 secs despite timeout parameter

2013-09-02 Thread John Nagle
New submission from John Nagle: urllib2.open for an FTP url does not obey the timeout parameter. Attached test program times out on FTP open after 21 seconds, even though the specified timeout is 60 seconds. Timing is consistent; times have ranged from 21.03 to 21.05 seconds. Python

[issue18907] urllib2.open FTP open times out at 20 secs despite timeout parameter

2013-09-02 Thread John Nagle
John Nagle added the comment: Reproduced problem in Python 3.3 (Win32). Error message there is: Open of ftp://ftp.sec.gov/edgar/daily-index failed after 21.08 seconds: urlopen error ftp error: TimeoutError(10060, 'A connection attempt failed because the connected party did not properly

[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-09 Thread John Nagle
John Nagle added the comment: For what parts of ISO 8601 to accept, there's a standard: RFC3339, Date and Time on the Internet: Timestamps. See section 5.6: date-fullyear = 4DIGIT date-month = 2DIGIT ; 01-12 date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based

[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-06 Thread John Nagle
New submission from John Nagle: The datetime module has support for output to a string of dates and times in ISO 8601 format (2012-09-09T18:00:00-07:00), with the object method isoformat([sep]). But there's no support for parsing such strings. A string to datetime class method should

[issue15873] datetime cannot parse ISO 8601 dates and times

2012-09-06 Thread John Nagle
John Nagle added the comment: Re: %z format is supported. That's platform-specific; the actual parsing is delegated to the C library. It's not in Python 2.7 / Win32: ValueError: 'z' is a bad directive in format '%Y-%m-%dT%H:%M:%S%z' It really shouldn't be platform-specific; the underlying

[issue9679] unicode DNS names in urllib, urlopen

2012-06-13 Thread John Nagle
John Nagle na...@users.sourceforge.net added the comment: A IRI library is not needed to fix this problem. It's already fixed in the sockets library and the http library. We just need consistency in urllib2. urllib2 functions which take a url parameter should apply encodings.idna.ToASCII

[issue9679] unicode DNS names in urllib, urlopen

2012-06-13 Thread John Nagle
John Nagle na...@users.sourceforge.net added the comment: The current convention is that domains go into DNS lookup as punycode, and the port, query, and fragment fields of the URL are encoded with percent-escapes. See http://lists.w3.org/Archives/Public/ietf-http-wg/2011OctDec/0155.html

[issue11900] 2.7.1 unicode subclasses not calling __str__() for print statement

2011-12-15 Thread John Nagle
John Nagle na...@users.sourceforge.net added the comment: This has nothing to do with Python 3. There's a difference in __str__ handling between Python 2.6 and Python 2.7.2. It's enough to crash BeautifulSoup: [Thread-8] Unexpected EXCEPTION while processing page http://www.verisign.com

[issue13288] SSL module doesn't allow access to cert issuer information

2011-10-28 Thread John Nagle
New submission from John Nagle na...@users.sourceforge.net: The SSL module still doesn't return much information from the certificate. SSLSocket.getpeercert only returns a few basic items about the certificate subject. You can't retrieve issuer information, and you can't get the extensions

[issue10202] ftplib doesn't check close status after sending file

2010-10-26 Thread John Nagle
New submission from John Nagle na...@users.sourceforge.net: ftplib doesn't check the status on socket close after writing. This can lead to silently truncated files when sending files with ftplib. A report of truncated files on comp.lang.python led me to check the source code. The ftplib

[issue10202] ftplib doesn't check close status after sending file

2010-10-26 Thread John Nagle
John Nagle na...@users.sourceforge.net added the comment: Proper behavior for ftplib when sending is to send all desired data, then call sock.shutdown(socket.SHUT_RDWR). This indicates that no more data will be sent, and blocks until the receiver has acknowledged all their data

[issue7558] Python 3.1.1 installer botches upgrade when installation is not on C drive.

2009-12-21 Thread John Nagle
New submission from John Nagle na...@users.sourceforge.net: I just installed python3.1.1.msi on a system that had python3.1.msi installed in D:/python31. In this situation, the installer does not ask the user for a destination directory. The installer found the old installation in D:/python31

[issue7558] Python 3.1.1 installer botches upgrade when installation is not on C drive.

2009-12-21 Thread John Nagle
John Nagle na...@users.sourceforge.net added the comment: Cancel bug report. It was my error. The installer says it is replacing the existing installation, but by default installs it in C:. But that can be overridden in the directory entry field below the big empty white entry box

[issue1712522] urllib.quote throws exception on Unicode URL

2009-04-22 Thread John Nagle
John Nagle na...@users.sourceforge.net added the comment: Note that the problem can't be solved by telling end users to call a different quote function. The problem is down inside a library module. robotparser is calling urllib.quote. One of those two library modules needs to be fixed

[issue1637] urlparse.urlparse misparses URLs with query but no path

2007-12-19 Thread John Nagle
John Nagle added the comment: I tried downloading the latest rev of urlparse.py (59480) and it flunked its own unit test, urlparse.test() Two test cases fail. So I don't want to try to fix the module until the last people to change it fix their unit test problems. The fix I provided should fix

[issue1637] urlparse.urlparse misparses URLs with query but no path

2007-12-16 Thread John Nagle
New submission from John Nagle: urlparse.urlparse will mis-parse URLs which have a / after a ?. sa1 = 'http://example.com?blahblah=/foo' sa2 = 'http://example.com?blahblah=foo' print urlparse.urlparse(sa1) ('http', 'example.com?blahblah=', '/foo', '', '', '') # WRONG print