Hi There,
I have the error below when trying to download the html content of a webpage. I
can open this webpage in a browser without any problem. I am using Ubuntu
14.04. Could you give me come clues about what is happening and how to solve
the issue? Thanks.
$python
Python 2.7.6 (default
On 05/04/2015 04:28 PM, Cecil Westerhof wrote:
Op Monday 4 May 2015 21:39 CEST schreef Ian Kelly:
On Mon, May 4, 2015 at 11:59 AM, Mark Lawrence wrote:
On 04/05/2015 16:20, Cecil Westerhof wrote:
Potential dangerous bug introduced by programming in Python as if
it was C/Java. :-( I used: ++
On 2015-05-04 21:57, Andrew Cooper wrote:
> On 04/05/2015 18:43, Ian Kelly wrote:
> >
> > Some other gotchas that aren't necessarily related to C/Java but
> > can be surprising nonetheless:
> >
> > *() is a zero-element tuple, and (a, b) is a two-element
> > tuple, but (a) is not a one-elemen
On 04/05/2015 16:20, Cecil Westerhof wrote:
Potential dangerous bug introduced by programming in Python as if it
was C/Java. :-(
I used:
++tries
that has to be:
tries += 1
I think I've come across that. It doesn't mind ++ so people are likely
to be assume that increment works as in o
On 4-5-2015 21:52, Cecil Westerhof wrote:
> But I keep getting the error. Only 2 lines earlier:
> >>> import urllib3.contrib.pyopenssl
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python3.4/site-packages/urllib3/contrib/pyopenssl.py",
> line 56,
On Mon, May 4, 2015, at 16:57, Andrew Cooper wrote:
> * {} is an empty set(), not dict().
You've got it backwards.
> Particularly subtle when combined with **kwargs
The function in your example below _always_ returns a set, and kwargs is
always a dict. There's no subtlety outside of the repr out
On 04/05/2015 18:43, Ian Kelly wrote:
>
> Some other gotchas that aren't necessarily related to C/Java but can
> be surprising nonetheless:
>
> *() is a zero-element tuple, and (a, b) is a two-element tuple,
> but (a) is not a one-element tuple. Tuples are created by commas, not
> parentheses
Op Monday 4 May 2015 21:48 CEST schreef Ian Kelly:
> On Mon, May 4, 2015 at 12:59 PM, Cecil Westerhof wrote:
>> I want to change an old Bash script to Python. When I look at:
>> https://docs.python.org/2/library/email-examples.html
>>
>> Then from and to have to be used two times? Why is that?
>
Using Python to update Twitter is reasonable straight forward.
I do:
from libturpial.api.coreimport Core
from libturpial.exceptions import StatusDuplicated
I fill an account_id and a message and I do:
Core().update_status(account_id, message)
And my message is posted.
It looks l
On 04/05/2015 09:58, Cecil Westerhof wrote:
But when I do:
import urllib3.contrib.pyopenssl
I get:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.4/site-packages/urllib3/contrib/pyopenssl.py", line 55,
in
import OpenSSL.SSL
Op Monday 4 May 2015 21:39 CEST schreef Ian Kelly:
> On Mon, May 4, 2015 at 11:59 AM, Mark Lawrence
> wrote:
>> On 04/05/2015 16:20, Cecil Westerhof wrote:
>>>
>>> Potential dangerous bug introduced by programming in Python as if
>>> it was C/Java. :-( I used: ++tries that has to be: tries += 1
Op Monday 4 May 2015 21:02 CEST schreef Irmen de Jong:
> On 4-5-2015 19:19, Cecil Westerhof wrote:
>
>> It looks like I am encircled by Gremlins:
> import urllib3.contrib.pyopenssl
>> Traceback (most recent call last): File "", line 1, in
>> File
>> "/usr/lib/python3.4/site-packages/urllib3/c
Op Monday 4 May 2015 20:04 CEST schreef Mark Lawrence:
> An alternative is to switch to Windows and do away with this archaic
> concept of users having to build code :)
Well, maybe I get rid of some problems. But the ones I get back …
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http:/
On 5/4/2015 1:43 PM, Ian Kelly wrote:
*() is a zero-element tuple, and (a, b) is a two-element tuple,
but (a) is not a one-element tuple. Tuples are created by commas, not
parentheses, so use (a,) instead.
Which means that a, and a,b (or a,b,) are 1 and 2 element tuples
respectively. Exce
On Mon, May 4, 2015 at 12:59 PM, Cecil Westerhof wrote:
> I want to change an old Bash script to Python. When I look at:
> https://docs.python.org/2/library/email-examples.html
>
> Then from and to have to be used two times? Why is that?
Once to construct the message headers, and once to inst
On Mon, May 4, 2015 at 11:59 AM, Mark Lawrence wrote:
> On 04/05/2015 16:20, Cecil Westerhof wrote:
>>
>> Potential dangerous bug introduced by programming in Python as if it
>> was C/Java. :-(
>> I used:
>> ++tries
>> that has to be:
>> tries += 1
>>
>> Are there other things I have to
I want to change an old Bash script to Python. When I look at:
https://docs.python.org/2/library/email-examples.html
Then from and to have to be used two times? Why is that?
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
--
https://mail.pytho
On 4-5-2015 19:19, Cecil Westerhof wrote:
> It looks like I am encircled by Gremlins:
> >>> import urllib3.contrib.pyopenssl
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python3.4/site-packages/urllib3/contrib/pyopenssl.py",
> line 58, in
>
Hi,
Wingware has released version 5.1.4 of Wing IDE, our cross-platform
integrated development environment for the Python programming language.
Wing IDE features a professional code editor with vi, emacs, visual
studio, and other key bindings, auto-completion, call tips,
context-sensitive au
On 04/05/2015 16:11, Cecil Westerhof wrote:
Op Monday 4 May 2015 16:18 CEST schreef Chris Angelico:
On Mon, May 4, 2015 at 11:13 PM, Cecil Westerhof wrote:
That gets installed. And then I get:
ImportError: No module named 'cryptography'
So I try to install that. This gives: Command /usr/bin/
On 04/05/2015 16:20, Cecil Westerhof wrote:
Potential dangerous bug introduced by programming in Python as if it
was C/Java. :-(
I used:
++tries
that has to be:
tries += 1
Are there other things I have to be careful on? That does not work as
in C/Java, but is correct syntax.
Not dan
On Tue, May 5, 2015 at 3:19 AM, Cecil Westerhof wrote:
> It looks like I am encircled by Gremlins:
> >>> import urllib3.contrib.pyopenssl
> Traceback (most recent call last):
> File "", line 1, in
> File "/usr/lib/python3.4/site-packages/urllib3/contrib/pyopenssl.py",
> line
Op Monday 4 May 2015 18:03 CEST schreef Chris Angelico:
> On Tue, May 5, 2015 at 1:11 AM, Cecil Westerhof wrote:
>> Now I get: c/../_cffi1/ffi_obj.c:489:5: error: ISO C90 forbids
>> mixed declarations and code [-Werror=declaration-after-statement]
>> PyObject *u = PyUnicode_DecodeLatin1(PyBytes_A
On Mon, May 4, 2015 at 9:20 AM, Cecil Westerhof wrote:
> Potential dangerous bug introduced by programming in Python as if it
> was C/Java. :-(
> I used:
> ++tries
> that has to be:
> tries += 1
>
> Are there other things I have to be careful on? That does not work as
> in C/Java, but is c
On Tue, May 5, 2015 at 3:32 AM, Irmen de Jong wrote:
> That is a broad question, but one thing that comes to mind is the current
> (python 3)
> behavior of integer division. It gives the exact result and doesn't truncate
> to integers:
>
>
5/4
> 1.25
Using the word "exact" around non-integ
On 5/4/2015 9:35 AM, Davide Mancusi wrote:
I believe this is a bug.
I'm not sure it is, actually; imagine the text is coming in one
character at a time (eg from a pipe), and it's seen "alpha\r". It
knows that this is a line, so it emits it; but until the next
character is read, it can't know wh
On 4-5-2015 17:20, Cecil Westerhof wrote:
> Potential dangerous bug introduced by programming in Python as if it
> was C/Java. :-(
> I used:
> ++tries
> that has to be:
> tries += 1
>
> Are there other things I have to be careful on? That does not work as
> in C/Java, but is correct syntax
On 05/04/2015 08:20 AM, Cecil Westerhof wrote:
Potential dangerous bug introduced by programming in Python as if it
was C/Java. :-(
I used:
++tries
that has to be:
tries += 1
Are there other things I have to be careful on? That does not work as
in C/Java, but is correct syntax.
One
On Tue, May 5, 2015 at 1:11 AM, Cecil Westerhof wrote:
> Now I get:
> c/../_cffi1/ffi_obj.c:489:5: error: ISO C90 forbids mixed declarations
> and code [-Werror=declaration-after-statement]
> PyObject *u = PyUnicode_DecodeLatin1(PyBytes_AS_STRING(res),
> ^
> cc1: some wa
Op Monday 4 May 2015 16:18 CEST schreef Chris Angelico:
> On Mon, May 4, 2015 at 11:13 PM, Cecil Westerhof wrote:
>> That gets installed. And then I get:
>> ImportError: No module named 'cryptography'
>>
>> So I try to install that. This gives: Command /usr/bin/python3 -c
>> "import setuptools,
>
Potential dangerous bug introduced by programming in Python as if it
was C/Java. :-(
I used:
++tries
that has to be:
tries += 1
Are there other things I have to be careful on? That does not work as
in C/Java, but is correct syntax.
--
Cecil Westerhof
Senior Software Engineer
LinkedIn: ht
On Mon, May 4, 2015 at 9:17 AM, Peter Otten <__pete...@web.de> wrote:
> OK, you convinced me. Then I tried:
>
with open("tmp.txt", "wb") as f: f.write("0\r\n3\r5\n7")
> ...
assert len(open("tmp.txt", "rb").read()) == 8
f = open("tmp.txt", "rU")
f.readline()
> '0\n'
f.newlin
On Tue, May 5, 2015 at 1:17 AM, Peter Otten <__pete...@web.de> wrote:
> OK, you convinced me. Then I tried:
>
with open("tmp.txt", "wb") as f: f.write("0\r\n3\r5\n7")
> ...
assert len(open("tmp.txt", "rb").read()) == 8
f = open("tmp.txt", "rU")
f.readline()
> '0\n'
f.newlin
Chris Angelico wrote:
> On Mon, May 4, 2015 at 10:01 PM, Peter Otten <__pete...@web.de> wrote:
>> I tried:
>>
> with open("tmp.txt", "wb") as f: f.write("alpha\r\nbeta\rgamma\n")
>> ...
> f = open("tmp.txt", "rU")
> f.newlines
> f.readline()
>> 'alpha\n'
> f.newlines
>> # expec
I had the same problem just now
Sent from my iPhone
> On May 3, 2015, at 11:00 AM, Terry Reedy wrote:
>
>> On 5/3/2015 12:01 PM, Ankur Gupta wrote:
>> Hey Guys,
>>
>> Just like to draw attention to ImportPython a weekly Python
>> newsletter. This is the 30th issue of the newsletter
>> http://i
On Mon, May 4, 2015 at 11:13 PM, Cecil Westerhof wrote:
> That gets installed. And then I get:
> ImportError: No module named 'cryptography'
>
> So I try to install that. This gives:
> Command /usr/bin/python3 -c "import setuptools,
> tokenize;__file__='/tmp/pip_build_root/cryptography/se
Op Monday 4 May 2015 14:07 CEST schreef Chris Angelico:
> On Mon, May 4, 2015 at 9:31 PM, Cecil Westerhof wrote:
>> While copying pasting code to test, the following works: [chomp]
>> But first I used: with NamedTemporaryFile(mode = 'w', prefix = file
>> + '_', dir = filepath, delete = False) as
Op Monday 4 May 2015 14:14 CEST schreef Chris Angelico:
> On Mon, May 4, 2015 at 9:32 PM, Cecil Westerhof wrote:
>>> Does 'pip3 install -U pyOpenSSL' work?
>> Not really, because that gives: Requirement already up-to-date:
>> pyOpenSSL in /usr/lib64/python3.4/site-packages Cleaning up...
>
> I do
>> I believe this is a bug.
>
> I'm not sure it is, actually; imagine the text is coming in one
> character at a time (eg from a pipe), and it's seen "alpha\r". It
> knows that this is a line, so it emits it; but until the next
> character is read, it can't know whether it's going to be \r or \r\n.
New Slim 5 Garcinia Cambogia You can find plenty of Weight Loss tips one sees
around in company, infomercials, TV and publications. The stark reality is
that many of these tips actually work and a few really do not. To be honest
with you, the fat diets, weight products and pills recommendations or
On Mon, May 4, 2015 at 9:32 PM, Cecil Westerhof wrote:
>> Does 'pip3 install -U pyOpenSSL' work?
> Not really, because that gives:
> Requirement already up-to-date: pyOpenSSL in
> /usr/lib64/python3.4/site-packages
> Cleaning up...
I don't know why it wasn't automatically installed, but
On Mon, May 4, 2015 at 10:01 PM, Peter Otten <__pete...@web.de> wrote:
> I tried:
>
with open("tmp.txt", "wb") as f: f.write("alpha\r\nbeta\rgamma\n")
> ...
f = open("tmp.txt", "rU")
f.newlines
f.readline()
> 'alpha\n'
f.newlines
> # expected: '\r\n'
f.readline()
> 'be
On Mon, May 4, 2015 at 9:31 PM, Cecil Westerhof wrote:
> While copying pasting code to test, the following works:
> [chomp]
> But first I used:
> with NamedTemporaryFile(mode = 'w', prefix = file + '_', dir = filepath,
> delete = False) as tf:
> tempfile = tf.name
> with open(
Op Monday 4 May 2015 12:10 CEST schreef Chris Angelico:
> On Mon, May 4, 2015 at 6:58 PM, Cecil Westerhof wrote:
>> When I then give: pip3 install -U OpenSSL It goes wrong: Could not
>> fetch URL https://pypi.python.org/simple/OpenSSL/: 404 Client
>> Error: Not Found
>>
>> I checked and even
>> h
are...@gmail.com wrote:
> Hi all,
>
> I have a text file with Windows-style line terminators (\r\n) which I open
> in universal newlines mode (Python 2.7). I would expect the newlines
> attribute to be set after the first call to the readline() method, but
> apparently this is not the case:
>
>>
While copying pasting code to test, the following works:
from itertools import islice
from os import rename
from os.pathimport expanduser, split
from tempfile import NamedTemporaryFile
real_file = (expanduser('~/Twitter/testing.txt'))
(filepath,
file)
On Mon, May 4, 2015 at 6:58 PM, Cecil Westerhof wrote:
> When I then give:
> pip3 install -U OpenSSL
> It goes wrong:
> Could not fetch URL https://pypi.python.org/simple/OpenSSL/: 404 Client
> Error: Not Found
>
> I checked and even
> https://pypi.python.org/simple/
> does not exist.
Hi all,
I have a text file with Windows-style line terminators (\r\n) which I open in
universal newlines mode (Python 2.7). I would expect the newlines attribute to
be set after the first call to the readline() method, but apparently this is
not the case:
>>> f=open('test_crlf', 'rU')
>>> f.ne
But when I do:
import urllib3.contrib.pyopenssl
I get:
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python3.4/site-packages/urllib3/contrib/pyopenssl.py",
line 55, in
import OpenSSL.SSL
File "/usr/lib64/python3.4/site-packages/OpenSSL/__
Having received over 300 great proposals for talks, trainings,
helpdesks and posters, we now call out to all attendees to vote for
what you want to see on the conference schedule.
You can search for topics and communicate your personal priorities by
casting your vote for each submission on our tal
50 matches
Mail list logo