Denis S. Otkidach added the comment:
Re: msg393586
> See my comment in the PR for a suggestion about an alternative structure for
> wait_for, which may avoid this gap and hence prevent the leak (but I have not
> tested it!)
Unfortunately this didn't close the gap, so the leak pers
Denis S. Otkidach added the comment:
The original problem can be fixed by wrapping await into try-except block:
```
async def create_connection(ssl_obj):
loop = asyncio.get_event_loop()
connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000,
ssl=ssl_obj
Change by Denis S. Otkidach :
--
keywords: +patch
pull_requests: +24737
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26097
___
Python tracker
<https://bugs.python.org/issu
Change by Denis S. Otkidach :
--
pull_requests: +24738
pull_request: https://github.com/python/cpython/pull/26097
___
Python tracker
<https://bugs.python.org/issue37
Denis S. Otkidach added the comment:
The current solutions doesn't look correct. It swallows cancelling causing task
to hang: https://bugs.python.org/issue42130 .
Proposed test case calls cancel for inner future and set_result for outer task
in the same loop step. The old (prior
Change by Denis S. Otkidach :
--
nosy: +ods
___
Python tracker
<https://bugs.python.org/issue42130>
___
___
Python-bugs-list mailing list
Unsubscribe:
Denis S. Otkidach added the comment:
The current error message is way too cryptic anyway. And restricting it to the
set type only, as in docs, will certainly break a lot of code (passing a list
is quite common).
--
___
Python tracker
<ht
Change by Denis S. Otkidach :
--
nosy: +ods
___
Python tracker
<https://bugs.python.org/issue42140>
___
___
Python-bugs-list mailing list
Unsubscribe:
Denis S. Otkidach added the comment:
It's fixed in 3.8 final, but the problem persists in 3.7.5
--
versions: -Python 3.8
___
Python tracker
<https://bugs.python.org/issue36
Change by Denis S. Otkidach :
--
nosy: +ods
___
Python tracker
<https://bugs.python.org/issue34364>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Denis S. Otkidach :
Minimal example to reproduce:
-->8--
>>> with open('f_bug.py', 'w') as fp:
... fp.write('f"{a b}"')
...
8
>>> import f_bug
Traceback (most recent call last):
File "", line 1, in
File "", li
New submission from Denis S. Otkidach :
Test script:
-->8--
import asyncio
@asyncio.coroutine
def test():
with (yield from asyncio.Lock()):
pass
asyncio.run(test())
-->8--
Correct behavior without flag (warning is reported and points to correct line
of code):
---
$
Denis S. Otkidach denis.otkid...@gmail.com added the comment:
Phillip, your argument about interfacing with code written in C doesn't work
for built-in immutable types like str. Any subclass of str must call
str.__new__ thus keeping proper internal state
Denis S. Otkidach denis.otkid...@gmail.com added the comment:
Current behavior is unpythonic: documentation explicitly mentions isinstance as
preferred way to check type (see http://docs.python.org/library/types.html ).
Also 2.7 is the last minor version with str as main string type. So I
Denis S. Otkidach denis.otkid...@gmail.com added the comment:
Here is a regexp I use to clean up text (note, that I don't touch
compatibility characters that are also not recommended in XML; some
other developers remove them too):
# http://www.w3.org/TR/REC-xml/#NT-Char
# Char ::= #x9 | #xA
Denis S. Otkidach denis.otkid...@gmail.com added the comment:
Every blog engine I've even seen so far pass through comments from
untrusted users to RSS/Atom feeds without proper validation causing
broken XML in feeds. Sure, this is a bug in web applications, but DOM
manipulation packages should
Denis S. Otkidach denis.otkid...@gmail.com added the comment:
Yes, it's a problem in Python library. I believe the patch proposed by
Oleg in the issue821862 is the best solution to it.
--
___
Python tracker rep...@bugs.python.org
http
New submission from Denis S. Otkidach denis.otkid...@gmail.com:
ElementTree and minidom allow creation of not well-formed XML, that
can't be parsed:
from xml.etree import ElementTree
element = ElementTree.Element('element')
element.text = u'\0'
xml = ElementTree.tostring(element, encoding
We are looking for Python experts with strong knowledge of web
technologies, RDBMS, UNIX, object-oriented development. Experience in
django,
sqlalchemy, CORBA, memcached, jquery and development of scalable
high-prefomance applications is a plus. Compensation is above the
market.
If you are
of it.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
that the PyObject returned by PyInstance_New has refcount = 2,
does this have any significance?
The code below prints 1:
PyObject *obj = PyInstance_New(PyExc_Exception, 0, 0);
std::cerr obj-ob_refcnt \n;
Does it create circular references in constructor?
--
Denis S. Otkidach
http://www.python.ru
used
%End
%PostInitialisationCode
PyDateTime_IMPORT;
%End
But I wonder why PyDateTimeAPI is declared static, and is the a better
solution?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
203.33.20.0
for ip in ('203.199.200.0', '203.33.20.0'):
... print '%15s' % ip
...
203.199.200.0
203.33.20.0
for ip in ('203.199.200.0', '203.33.20.0'):
... print ip.rjust(15)
...
203.199.200.0
203.33.20.0
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http
(YourModule.YourException, 0, 0);
2. Add it to module dictionary.
3. In wrapper for my_cpp_function use something like the following
code:
try {
my_cpp_function_impl();
} catch (YouException exc) {
PyErr_SetString(YouExceptionClass, exc.what());
return 0;
}
--
Denis S. Otkidach
http://www.python.ru
:
assert item in d
That's the reason why I always prefer to use has_key() and iteritems()
to in and iter(). Readability counts.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
and generally faster.
For me dictionary is a collection of key-value pairs, but not a
collection of keys (that's what set is).
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
;
}
PyObject_GC_Track(obj);
return (PyObject *)obj;
}
PyTypeObject Your_Type = {
PyObject_HEAD_INIT(PyType_Type)
# ...skipped...
offsetof(YourObject, dict), /* tp_dictoffset */
# ...skipped...
}
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http
problems and solved them using some tricks with
image.info['transparency'] and image.palette. Unfortunately I can't
find this example, so if you succeed please post solution here.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
directory as the executable
DH so its not a path error or that kind of stuff.
I believe you have to call Py_SetProgramName before Py_Initialize, or
otherwise let Python know that it should look for modules in this
directory. See http://python.org/doc/current/api/embedding.html#l2h-40
--
Denis S
],
stdin=PIPE)
mailfl.stdin.write(msg.as_string())
mailfl.stdin.close()
mailfl.wait()
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
as first argument?
globals()[name] = value
or
setattr(__import__(__name__), name, value) # note, circular import here
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
whether it's
good idea to overload get() method, just an idea.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
integers you can pack keys with struct.pack('I', value).
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
not
possibly be an IPv4 address). Can re.compile be configured to filter
results like this out?
Try this one:
re.compile(r'\b%s\b' % r'\.'.join(['(?:(?:2[0-4]|1\d|[1-9])?\d|25[0-5])']*4))
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
to
something like:
import dummy_thread as thread, dummy_threading as threading
I believe it's a bug and logging/config.py should use the same approach
as logging/__init__.py do:
try:
import thread
import threading
except ImportError:
thread = None
--
Denis S. Otkidach
http
. But isalpha behavior looks strange for me anyway: why
cyrillic character '\u0430' is recognized as alpha one for de_DE locale,
but is not for C?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
\xe4\u0430': print c.isalpha(),
...
False False False False
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
doesn't matter if I don't call setlocale.
Fortunately setting any non-C locale solves the problem for all (I
believe) unicode character:
re.compile(ur'\w+', re.U).findall(u'\xb5\xba\xe4\u0430')
[u'\xb5\xba\xe4\u0430']
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org
+', re.U).match(u'\xe4')
BTW, is correctly recognize this character as lowercase letter:
import unicodedata
unicodedata.category(u'\xe4')
'Ll'
I've looked through all SuSE patches applied, but found nothing related.
What is the reason for broken behavior? Incorrect configure options?
--
Denis S
On Thu, 10 Feb 2005 13:00:42 +0300
Denis S. Otkidach [EMAIL PROTECTED] wrote:
On all platfroms \w matches all unicode letters when used with flag
re.UNICODE, but this doesn't work on SuSE 9.2:
Python 2.3.4 (#1, Dec 17 2004, 19:56:48)
[GCC 3.3.4 (pre 3.3.5 20040809)] on linux2
Type help
in their patches and
the sources themselves are the same as on other platforms. I'd prefer
to find the source of problem.
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 10 Feb 2005 16:23:09 +0100
Daniel Dittmar [EMAIL PROTECTED] wrote:
Denis S. Otkidach wrote:
On all platfroms \w matches all unicode letters when used with flag
re.UNICODE, but this doesn't work on SuSE 9.2:
I think Python on SuSE 9.2 uses UCS4 for unicode strings (as does
BTW, where have they found something with Artistic License in Python?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
in xrange(2, len(l)):
... for j in xrange(0, len(l)-i+1):
... yield l[j:j+i]
...
list(consecutive_sets([1,2,3,4]))
[[1, 2], [2, 3], [3, 4], [1, 2, 3], [2, 3, 4]]
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
usage
with stdout redirected to file:
out_fp = open('wall0.TRANS.rad', 'wb')
subprocess.call(['c:\\Radiance\\bin\\xform.exe',
'-t', '0', '8', '0', 'wallo.rad'],
stdout=out_fp)
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman
find file
Don't understand how you got this error having syntax error and wrong
path to executable.
##for your info I'm on win/xp, python 2.3.4
BTW, you are trying to redirect stdout. Wrong subject?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman
.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278612
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
(fileobj=StringIO(data)).read()
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
locale -a | grep nb_NO?
--
Denis S. Otkidach
http://www.python.ru/ [ru]
--
http://mail.python.org/mailman/listinfo/python-list
49 matches
Mail list logo