On 08/17/2017 05:53 PM, Chris Angelico wrote:
On Fri, Aug 18, 2017 at 10:30 AM, John Nagle <na...@animats.com> wrote:
On 08/17/2017 05:14 PM, John Nagle wrote:
I'm cleaning up some data which has text description fields from
multiple sources.
A few more cases:
bytearray(b'\xe5\x8
e lower casing algorithm, that's a reasonable
assumption. Thanks for looking at this, everyone. If a string won't
parse as either UTF-8 or Windows-1252, I'm just going to convert the
bogus stuff to the Unicode replacement character. I might remove
0x9d chars, since that never seems to affect r
On 08/17/2017 05:53 PM, Chris Angelico wrote:> On Fri, Aug 18, 2017 at
10:30 AM, John Nagle <na...@animats.com> wrote:
>> On 08/17/2017 05:14 PM, John Nagle wrote:
>>> I'm cleaning up some data which has text description fields from
>>> mult
On 08/17/2017 05:14 PM, John Nagle wrote:
> I'm cleaning up some data which has text description fields from
> multiple sources.
A few more cases:
bytearray(b'miguel \xe3\x81ngel santos')
bytearray(b'lidija kmeti\xe4\x8d')
bytearray(b'\xe5\x81ukasz zmywaczyk')
bytearray(b'M\x81\x81\xf
a\\"\x9d Each time'
That just converts 0x9d in the input to 0x9d in Unicode.
That's "Operating System Command" (the "Windows" key?)
That's clearly wrong; some kind of quote was intended.
Any ideas?
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
rejects "u" Unicode string constants and
has other problems in the MySQL area.)
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
I
have to sysadmin, just a small shared
hosting account.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
2.7, 3.x), and doesn't do "readline" processing?
(No, I don't want to use signals, a GUI, etc. This is simulating
a serial input device while logging messages appear. It's a debug
facility to be able to type input in the console window.)
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
on-3-5
cx_freeze has been suggested as an alternative, but its own
documents indicate it's only been tested through Python 3.4.
Someone reported success with a development version.
I guess people don't create Python executables much.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
ld_archive
assert mod.__file__.endswith(EXTENSION_SUFFIXES[0])
AssertionError
Python 3.5.2 / Win7 / AMD64.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
On 3/29/2015 7:11 PM, John Nagle wrote:
Meanwhile, I've found two more variants on flup
https://pypi.python.org/pypi/flipflop
https://pypi.python.org/pypi/flup6
All of these are descended from the original flup code base.
PyPi also has
fcgi-python (Python 2.6
. I now have workarounds for all of those,
but not fixes. The bug reports I listed last time contain the
workaround code.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
interface. That's not what the Python documentation recommends as
the first choice, but it's a standard module.
I keep thinking I'm almost done with Python 3 hell, but then I
get screwed by Python 3 again.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
On 3/29/2015 1:19 PM, John Nagle wrote:
On 3/29/2015 12:11 PM, Ben Finney wrote:
John Nagle na...@animats.com writes:
The Python 3 documentation at
https://docs.python.org/3/howto/webservers.html
recommends flup
I disagree. In a section where it describes FastCGI, it presents a tiny
.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
have a workaround for that.
All this has cost me about two weeks of work so far.
The everything is just fine comments are not helpful.
Denial is not a river in Egypt.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
On 3/14/2015 1:00 AM, Marko Rauhamaa wrote:
John Nagle na...@animats.com:
I'm approaching the end of converting a large system from Python 2
to Python 3. Here's why you don't want to do this.
A nice report, thanks. Shows that the slowness of Python 3 adoption is
not only social inertia
.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
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
packages because the Python 2
package didn't make it to Python 3.
All the bugs I'm discussing reflect forced package
changes or upgrades. None were voluntary on my part.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
On 3/12/2015 5:18 PM, John Nagle wrote:
On 3/12/2015 2:56 PM, Cameron Simpson wrote:
On 12Mar2015 12:55, John Nagle na...@animats.com wrote:
I have working code from Python 2 which uses pickle to talk to a
subprocess via stdin/stdio. I'm trying to make that work in Python
3.
I'm starting
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
interface
error. But now I get the pickle error Ran out of input
on the process child side. Probably because there's a
str/bytes incompatibility somewhere.
So how do I get clean binary byte streams between parent
and child process?
John Nagle
--
https://mail.python.org
On 3/12/2015 2:56 PM, Cameron Simpson wrote:
On 12Mar2015 12:55, John Nagle na...@animats.com wrote:
I have working code from Python 2 which uses pickle to talk to a
subprocess via stdin/stdio. I'm trying to make that work in Python
3. First, the subprocess Python is invoked with the -d
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
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
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
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
is [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed
(_ssl.c:581)., which is a generic message for most OpenSSL errors.
John Nagle
On 2/17/2015 12:00 AM, Laura Creighton wrote:
I've seen something like this:
The requests module http://docs.python
try that and let me know what happens on
other platforms. Works with Python 2.7.9 or 3.x.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
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
ssl.OPENSSL_VERSION from Python, I get OpenSSL 1.0.1j 15 Oct
2014. That's an OK version.
Something about that cert is unacceptable to the Python SSL module, but
what? CERTIFICATE VERIFY FAILED doesn't tell me enough to
diagnose the problem.
John Nagle
--
https://mail.python.org
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
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
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
}
How about just returning ALL the remaining fields and finishing
the job? Thanks.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
are at
different skills. And recruiters use MetaBright to find outrageously skilled
job candidates.
With tracking cookies blocked, you get 0 points.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
in debug
vs. release mode.
Sigh.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
so it can generate efficient type-specific C++ code. That's
much harder to do, and has trouble with very dynamic code, but
what comes out is fast.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
On 10/23/2013 12:25 AM, Philip Herron wrote:
On Wednesday, 23 October 2013 07:48:41 UTC+1, John Nagle wrote:
On 10/20/2013 3:10 PM, victorgarcia...@gmail.com wrote:
On Sunday, October 20, 2013 3:56:46 PM UTC-2, Philip Herron
wrote:
Nagle replies:
Documentation can be found
http
to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS End of Disclaimer INFOSYS***
Because of the above restriction, we are unable to reply to your
question.
John Nagle
SiteTruth
.
Is this related to Python? What is “PID tuning”, and what have you
tried already?
See
http://sts.bwk.tue.nl/7y500/readers/.%5CInstellingenRegelaars_ExtraStof.pdf;
You might also try the OpenHRP3 forums.
John Nagle
--
https://mail.python.org/mailman/listinfo
to understand
all this, there's a good writeup in one of the Graphics Gems
books.
Unlike complex numbers, these quaternions are always unit vectors.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
, or variable in any other thread. The ability
for anything to use setattr() on anything carries a high
performance price. That's part of why Unladen Swallow failed
and why PyPy development is so slow.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
for anything. I'd suggest deprecating it and
documenting that.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
versions add symbols to the executable is probably only usable for
executables compiled using gcc isn't even a sentence.
The documentation needs to be updated. Please submit a patch.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
If you really want that data, and aren't just hacking, buy it.
There are data brokers that will sell it to you. DB, FindTheCompany,
Infot, etc.
Sounds like you want to spam. Don't.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
from? They're
way out of sync with the GCC version.
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
On 10/11/2013 11:50 PM, Christian Gollwitzer wrote:
Am 12.10.13 08:34, schrieb John Nagle:
I'm trying to find out which version of glibc Python is using.
I need a fix that went into glibc 2.10 back in 2009.
(http://udrepper.livejournal.com/20948.html)
So I try the recommended way to do
On 10/8/2013 10:36 PM, Christian Gollwitzer wrote:
Dear John,
Am 09.10.13 07:28, schrieb John Nagle:
This is the basic transformation of 3D graphics. Take
a 3D point, make it 4D by adding a 1 on the end, multiply
by a transformation matrix to get a new 4-element vector,
discard
it?
John Nagle
--
https://mail.python.org/mailman/listinfo/python-list
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
has failed to respond
But in both cases, the command line FTP client will work, after a
consistent 20 second delay before the login prompt. So the
Python timeout parameter isn't working.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
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
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
, with different libraries, and lots of
things that still don't work. Many old applications will never
be converted.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
devices. Serial port devices are particularly annoying, because their
port number is somewhat random when there's more than one, and changes
on hot-plugging.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
in your
chosen directory for this program.)
Run: python baudotrss.py --help
I'm thinking of switching to Go.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 3/7/2013 5:10 AM, Dave Angel wrote:
On 03/07/2013 01:33 AM, John Nagle wrote:
Here's a traceback that's not helping:
A bit more context would be helpful. Starting with Python version.
Sorry, Python 2.7.
If that isn't enough, then please give the whole context, such as where
On 3/7/2013 5:10 AM, Dave Angel wrote:
On 03/07/2013 01:33 AM, John Nagle wrote:
infdraw is a stream from the zip module, create like this:
with inzip.open(zipelt.filename,r) as infd :
You probably need a 'rb' rather than 'r', since the file is not ASCII.
self.dofilecsv
On 3/7/2013 10:42 AM, John Nagle wrote:
On 3/7/2013 5:10 AM, Dave Angel wrote:
On 03/07/2013 01:33 AM, John Nagle wrote:
Here's a traceback that's not helping:
A bit more context would be helpful. Starting with Python version.
Sorry, Python 2.7.
The trouble comes from here
a conversion to ASCII. Not even a print.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
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
On 9/8/2012 5:20 PM, John Gleeson wrote:
On 2012-09-06, at 2:34 PM, John Nagle wrote:
Yes, it should. There's no shortage of implementations.
PyPi has four. Each has some defect.
PyPi offers:
iso8601 0.1.4 Simple module to parse ISO 8601 dates
iso8601.py 0.1dev
.
It looks like this was taken out of xml at some point,
but not moved into datetime.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 9/6/2012 12:51 PM, Paul Rubin wrote:
John Nagle na...@animats.com writes:
There's an iso8601 module on PyPi, but it's abandoned; it hasn't been
updated since 2007 and has many outstanding issues.
Hmm, I have some code that uses ISO date/time strings and just checked
to see how I did
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
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
/trunk/googleclient/geo/earth_enterprise/src/third_party/python/python2.6-disable-old-modules.patch
so if you apply that patch to the setup.py file for Python 2.6, that
ought to help.
You might be better off building Python 2.7, but you asked about 2.6.
John Nagle
control out of
the trouble spot so that the JIT compiler can then recompile the
code. (I think; I've read the paper but haven't looked at the
internals.)
This is hard to implement and hard to get right.
John Nagle
--
http://mail.python.org/mailman/listinfo/python
reason - boolean types were an afterthought there, too.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
connections, abort, and are restarted. This allows multiple
servers to coordinate through one database.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Voice isn't a very good SMS gateway. I used to use it,
but switched to Twilio (which costs, but works) two years ago.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
to a datetime.timedelta isn't that
useful. It would have to return a value error if the result
crossed a day boundary.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
-Pythonic.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
ready for prime time yet.
That's why I'm still on Python 2.7.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
port?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
escapes? Punycode?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On 6/12/2012 11:42 PM, Andrew Berg wrote:
On 6/13/2012 1:17 AM, John Nagle wrote:
What does urllib2 want? Percent escapes? Punycode?
Looks like Punycode is the correct answer:
https://en.wikipedia.org/wiki/Internationalized_domain_name#ToASCII_and_ToUnicode
I haven't tried it, though
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
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
.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
.
It matches anything that looks like a mail user name followed by
an @ followed by anything that looks more or less like a domain name.
The domain name must contain at least one ., and cannot end with
a ., which is not strictly correct but usually works.
John Nagle
--
http
.
For a quoted alternative to regular expression syntax, see
SNOBOL or Icon. SNOBOL allows naming patterns, and those patterns
can then be used as components of other patterns. SNOBOL
is obsolete, but that approach produced much more readable
code.
John Nagle
about it.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
been much simpler if the USB
Consortium had defined a USB class for these devices, as they did
for keyboards, mice, etc.
However, this is not the original poster's problem.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
. Using the file system for a
million item db is ridiculous even for prototyping.
Right. Steve Bellovin wrote that back when UNIX didn't have any
database programs, let alone free ones.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 1305 matches
Mail list logo