[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Added file: http://bugs.python.org/file17085/timemodule-gmtime-r265.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Added file: http://bugs.python.org/file17086/timemodule-gmtime-r27b1.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Added file: http://bugs.python.org/file17087/timemodule-gmtime-r312.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Added file: http://bugs.python.org/file17088/timemodule-gmtime-3-trunk.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Removed file: http://bugs.python.org/file16351/timemodule-gmtime-2-trunk.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Removed file: http://bugs.python.org/file16352/timemodule-gmtime-2-r27a3.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Removed file: http://bugs.python.org/file16353/timemodule-gmtime-2-r311.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Changes by Francesco Del Degan f.delde...@ngi.it: Removed file: http://bugs.python.org/file16354/timemodule-gmtime-2-r264.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Francesco Del Degan f.delde...@ngi.it added the comment: Fixed typos, new patches added -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Francesco Del Degan f.delde...@ngi.it added the comment: I thinks that isn't a so easy decision to take. And there are some other issues, imho: 1. timegm function is not specified by any standard (POSIX). The portable way (setting TZ, calling mktime, restore TZ) is a pure hack (could not work in future multithreaded environments). 2. if we want to strictly follow the time.h definition from POSIX standards, the timegm function should be kept away from time module (as now). 3. timegm seems to have some issues on mingw32. 4. Solaris doesn't come with the timegm function out-of-the-box. We could give up at this point. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Francesco Del Degan f.delde...@ngi.it added the comment: Those are the new updated patches with ifdef wrapped timegm function, docs, and a conversion test. -- Added file: http://bugs.python.org/file16351/timemodule-gmtime-2-trunk.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Francesco Del Degan f.delde...@ngi.it added the comment: I attached a patch that implements timegm according to two constraints: 1. If HAVE_TIMEGM is defined, use it or 2. If HAVE_MKTIME and HAVE_WORKING_TZSET use a portable way, using mktime (taken from timegm(3) man) Attached patches are for: r264, r273a1, r311, trunk What i'm missing just now are the tests (test_time.py) and docs update, if you like the patch, i can continue on that. -- Added file: http://bugs.python.org/file16334/timemodule-gmtime-r264.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6280] calendar.timegm() belongs in time module, next to time.gmtime()
Francesco Del Degan f.delde...@ngi.it added the comment: Hi, i started to produce a patch for timemodule.c. Working into it, i found that we have almost 3 way to do that: 1. Use timegm(3) function where HAVE_TIMEGM is defined (i have a working patch for it) 2. Implement a more portable timegm function with tzset and mktime where HAVE_MKTIME and HAVE_WORKING_TZSET is defined (i have a working patch for it) 3. Doing some calculation taking calendar.timegm as example. What do you think about it? Thanks, Francesco pr0gg3d Del Degan -- nosy: +pr0gg3d ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6596] urllib2 bug on CentOS
Francesco Del Degan f.delde...@ngi.it added the comment: I don't think that this is a python issue, because of this: [r...@localhost ~]# curl -O http://wm.exchanger.ru/asp/XMLWMList.asp?exchtype=1 % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 0 00 00 0 0 0 --:--:-- --:--:-- --:--:-- 0 [r...@localhost ~]# curl -O http://wm.exchanger.ru/asp/XMLWMList.asp?exchtype=1 % Total% Received % Xferd Average Speed TimeTime Time Current Dload Upload Total SpentLeft Speed 100 9299 100 92990 0 15471 0 --:--:-- --:--:-- --:--:-- 22134 I done two request in rapid succession and into first i got a redirect to 0x: 4500 008f 3abb 3206 1d98 d49e ad94 E...:...2... 0x0010: ac10 01d3 0050 b220 47ee 6cdb 8b3d 6233 .P..G.l..=b3 0x0020: 5011 0001 edc2 4854 5450 2f31 2e31 P...HTTP/1.1 0x0030: 2033 3032 204d 6f76 6564 2054 656d 706f .302.Moved.Tempo 0x0040: 7261 7269 6c79 0d0a 436f 6e74 656e 742d rarily..Content- 0x0050: 4c65 6e67 7468 3a20 300d 0a4c 6f63 6174 Length:.0..Locat 0x0060: 696f 6e3a 202f 6173 702f 584d 4c57 4d4c ion:./asp/XMLWML 0x0070: 6973 742e 6173 703f 6578 6368 7479 7065 ist.asp?exchtype 0x0080: 3d31 3f34 6430 3266 3136 380d 0a0d 0a=1?4d02f168 as you can see, the ?4d02f168 part comes from the site, hence the 500 error from second request. In the second try, i got correct response. The weird thing is that into other systems, no curl request triggers a redirect from the site, and in centOS only we have this weird behaviour. -- nosy: +pr0gg3d ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6596 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6596] urllib2 bug on CentOS
Francesco Del Degan f.delde...@ngi.it added the comment: Update: Now into the same system (CentOS) without any mod: import urllib2 url = 'http://wm.exchanger.ru/asp/XMLWMList.asp?exchtype=1' t = urllib2.urlopen(url).read() t '?xml version=1.0?. i thinks that you should try to look for some bugs into CentOS distribution. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6596 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6557] urllib.urlopen creates bad requests when location header of 301 redirects contain spaces
Francesco Del Degan f.delde...@ngi.it added the comment: urllib2 does escape spaces (and other characters too): In [20]: u=urllib2.urlopen(http://sourceforge.net/project/showfiles.php? group_id=16847package_id=13374) In [21]: u.url Out[21]: 'http://sourceforge.net/projects/xmlrpc-c/files/Xmlrpc- c%20Super%20Stable/' In [22]: u.read()[0:100] Out[22]: '\n\n!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xh' -- nosy: +pr0gg3d ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6557 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6635] Profiler doesn't print usage (indexError instead)
New submission from Francesco Del Degan f.delde...@ngi.it: $ python -m profile Usage: profile.py [-o output_file_path] [-s sort] scriptfile [arg] ... $ python -m profile -s calls Traceback (most recent call last): File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/runpy.py, line 122, in _run_module_as_main __main__, fname, loader, pkg_name) File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/runpy.py, line 34, in _run_code exec code in run_globals File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/profile.py, line 619, in module main() File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/profile.py, line 614, in main parser.print_usage() File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/optparse.py, line 1584, in print_usage print file, self.get_usage() File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/optparse.py, line 1570, in get_usage self.expand_prog_name(self.usage)) File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/optparse.py, line 1547, in expand_prog_name return s.replace(%prog, self.get_prog_name()) File /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/optparse.py, line 1542, in get_prog_name return os.path.basename(sys.argv[0]) IndexError: list index out of range This is triggered by an early override of sys.argv when usage() is called (Lib/profile.py:603): if not sys.argv[1:]: parser.print_usage() sys.exit(2) (options, args) = parser.parse_args() sys.argv[:] = args if (len(sys.argv) 0): sys.path.insert(0, os.path.dirname(sys.argv[0])) run('execfile(%r)' % (sys.argv[0],), options.outfile, options.sort) else: parser.print_usage() return parser In the else branch it tries to print usage but sys.argv[] were already overwritten. Attached is the proposed patch (tested with 2.5, 2.6, 3.1). -- components: Library (Lib) files: python-profile-sysargv.patch keywords: patch messages: 91240 nosy: pr0gg3d severity: normal status: open title: Profiler doesn't print usage (indexError instead) type: behavior versions: Python 2.5, Python 2.6, Python 3.1 Added file: http://bugs.python.org/file14639/python-profile-sysargv.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6635 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com