Package: python2.7 Version: 2.7.3~rc2-2.1 Severity: normal Dear Maintainer,
* What led up to the situation?
I'm using Debian testing. I use urllib2 to connect to
https://secure.nicovideo.jp/
However, it fails to connect. The scripts halts there and
the socket timeout.
Please see the attachment script for the test.
I've tried this script on Debian stable. Which has no problem.
I've also tried this script on Ubuntu Precise, which also has no
problem.
* What exactly did you do (or not do) that was effective (or
ineffective)?
./test3
* What was the outcome of this action?
Traceback (most recent call last):
File "./test3", line 29, in <module>
response = perform_request('https://secure.nicovideo.jp/')
File "./test3", line 18, in perform_request
response = urllib2.urlopen(request)
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 400, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 418, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1215, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1177, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 104] Connection reset by peer>
-- System Information:
Debian Release: wheezy/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=ja_JP.utf8, LC_CTYPE=ja_JP.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages python2.7 depends on:
ii libbz2-1.0 1.0.6-3
ii libc6 2.13-33
ii libdb5.1 5.1.29-1
ii libexpat1 2.1.0-1
ii libgcc1 1:4.7.0-8
ii libncursesw5 5.9-8
ii libreadline6 6.2-8
ii libsqlite3-0 3.7.12.1-1
ii libtinfo5 5.9-8
ii mime-support 3.52-1
ii python2.7-minimal 2.7.3~rc2-2.1
python2.7 recommends no packages.
Versions of packages python2.7 suggests:
ii binutils 2.22-6.1
pn python2.7-doc <none>
-- no debconf information
--
PaulLiu (劉穎駿)
E-mail: Ying-Chun Liu (PaulLiu) <[email protected]>
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import string
import sys
import urllib2
def request_create(url):
retval = urllib2.Request(url)
retval.add_header('User-Agent', 'Mozilla/5.0 (X11; Linux i686;
rv:10.0.4) Gecko/20100101 Firefox/10.0.4 Iceweasel/10.0.4')
retval.add_header('Accept',
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
retval.add_header('Accept-Language',
'zh-tw,ja;q=0.8,en-us;q=0.7,en;q=0.5,zh;q=0.3,zh-cn;q=0.2')
return retval
def perform_request(url, data=None):
request = request_create(url)
response = urllib2.urlopen(request)
return response
# Install cookie and proxy handlers
urllib2.install_opener(urllib2.build_opener(urllib2.HTTPRedirectHandler()))
urllib2.install_opener(urllib2.build_opener(urllib2.HTTPCookieProcessor()))
response = perform_request('https://www.cis.nctu.edu.tw/~is86007/debian/')
data = response.read()
print (data)
response = perform_request('https://secure.nicovideo.jp/')
data = response.read()
print (data)
signature.asc
Description: OpenPGP digital signature

