Juancarlo Añez apal...@gmail.com added the comment:
My local timezone is (VET,VET) == time.tzname, and test_logging fails because
time.timezone is off by 30 minutes. I couldn't find the cause for the problem
with time.timezone, but logging is not to blame. I'm running the tests on
Ubuntu
Juancarlo Añez apal...@gmail.com added the comment:
@Vinay The test *is* broken in theory, because it uses today's time.timezone to
make calculations over a datetime in the past (1993), even when official time
zones have changes in recent years for Caracas, Moscow, and others:
http
Juancarlo Añez apal...@gmail.com added the comment:
And datetime.datetime.now().tzinfo is always None.
I can reproduce that.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14902
Juancarlo Añez apal...@gmail.com added the comment:
I did extensive testing on time.timezone, and it is correct as far as the
current date is concerned. The problem, as mentioned before, is that
test_logging is using time.timezone for dates in the past for which the time
zone may have been
Juancarlo Añez apal...@gmail.com added the comment:
@Vinay No reason. datetime.astimezone(None) is documented in 3.3. You may even
use:
r.created = time.mktime(dt.astimezone().timetuple())
--
___
Python tracker rep...@bugs.python.org
http
Changes by Juancarlo Añez apal...@gmail.com:
--
type: compile error - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14902
___
___
Python
New submission from Juancarlo Añez apal...@gmail.com:
import io
d = io.open('.')
Traceback (most recent call last):
File stdin, line 1, in module
IsADirectoryError: [Errno 21] Is a directory: '.'
import os
d = io.open(os.open('.',0))
d
_io.TextIOWrapper name=3 mode='r' encoding='UTF-8
Juancarlo Añez apal...@gmail.com added the comment:
io.open() clearly doesn't care about opening directories as long as they are
passed as os.open() file descriptors. Quite unexpected!
--
___
Python tracker rep...@bugs.python.org
http
Juancarlo Añez apal...@gmail.com added the comment:
Note that attempting subsequent operations on the returned object do raise
IsADirectoryError.
import io
import os
d = io.open(os.open('.',0))
d.read()
Traceback (most recent call last):
File stdin, line 1, in module
IsADirectoryError
New submission from Juancarlo Añez:
Under Ubuntu Linux 11.10 and 12.04, webbroser.open() will output the following
message to the console:
Created new window in existing browser session.
The behavior is both unexpected and troublesome.
--
components: Library (Lib)
messages: 167443
New submission from Juancarlo Añez:
t.pencolor(u'red')
Traceback (most recent call last):
File stdin, line 1, in module
File string, line 1, in pencolor
File /usr/lib/python2.7/lib-tk/turtle.py, line 2166, in pencolor
color = self._colorstr(args)
File /usr/lib/python2.7/lib-tk
Juancarlo Añez added the comment:
This patch solves the problem by making turtle check for string against
basestring insted of str.
--
keywords: +patch
Added file: http://bugs.python.org/file26758/turtle_unicode.patch
___
Python tracker rep
Juancarlo Añez added the comment:
The bug showed up in a script that used:
from __future__ import unicode_literals
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15618
New submission from Juancarlo Añez:
$ lsb_release -a
LSB Version:
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: Ubuntu
Description:Ubuntu 12.04.1 LTS
Release
Juancarlo Añez added the comment:
$ dpkg -l | grep readline
ii libreadline-dev 6.2-8
GNU readline and history libraries, development files
ii libreadline55.2-11
Juancarlo Añez added the comment:
Check if clear_history() is available before calling it.
--
keywords: +patch
Added file:
http://bugs.python.org/file26761/readline_clear_history_available.patch
___
Python tracker rep...@bugs.python.org
http
Changes by Juancarlo Añez apal...@gmail.com:
Removed file:
http://bugs.python.org/file26761/readline_clear_history_available.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15620
Juancarlo Añez added the comment:
Check if clear_history() is available before calling it.
--
Added file:
http://bugs.python.org/file26762/readline_clear_history_available.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Juancarlo Añez added the comment:
The bottom problem, as I see it, is that, historically, `re.search()` returns
`None` when there is no match, instead of returning a `Match` object that is
consistent with "no match" (evaluates to `False`, etc.)
The above seems too difficult to re
Juancarlo Añez added the comment:
The analysis done by Terry bypasses the fact that `search(...)` returns `None`
when there is no match, so indexing or calling methods in its result is not
safe code.
`findall()` returns an empty list when there is no match.
`findalliter()` returns an empty
Juancarlo Añez added the comment:
There's no way to assert that `findall(...)[0]` is efficient enough in most
cases. It is easy to see that that it is risky in every case, as runtime may be
exponential, and memory O(len(input)). A mistake in the regular expression may
easily result in an out
Juancarlo Añez added the comment:
The discussion on python-ideas favored the inclusion of `findfirst()`. At any
rate, not having a generator version of `findall()` is an important omission.
Another user's search of Github public repositories found that
`findall(...)[0]` is prevalent. python
New submission from Juancarlo Añez :
The problematic `findall(...)[0]` is a common anti-pattern in Python programs.
The reason is lack of symmetry and completeness in the `re` module.
The original proposal in `python-ideas` was to add `re.findfirst(pattern,
string, flags=0, default=_mark
Juancarlo Añez added the comment:
def isplit(text, sep=None, maxsplit=-1):
"""
A lowmemory-footprint version of:
iter(text.split(sep, maxsplit))
Adapted from https://stackoverflow.com/a/9770397
"""
if maxsplit == 0:
yie
24 matches
Mail list logo