New submission from Victor Porton :
In https://docs.python.org/3/library/io.html it is forgotten to say whether
'\n' is appened to the return value of readline().
It is also unclear what happens if the last line not terminated by '\n' is read.
It is also unclear what is returned if a text
New submission from Victor Porton :
The following script:
#/usr/bin/env python3
import logging
logger = logging.getLogger(name='main')
logger.setLevel(logging.INFO)
logger.error('XXX')
logging.error('ZZZ')
logger.error('XXX')
outputs
XXX
ERROR:root:ZZZ
ERROR:main:XXX
That is counter
Victor Porton added the comment:
Oh, I noticed I can do
my_subparser = subparsers.add_parser('checkout', aliases=['co'])
So resolution invalid.
--
resolution: -> not a bug
___
Python tracker
<https://bugs.python.org/issu
Victor Porton added the comment:
One of possible solutions:
https://bugs.python.org/issue35480
--
___
Python tracker
<https://bugs.python.org/issue35
New submission from Victor Porton :
Subparsers are added like:
subparsers.add_parser('checkout', aliases=['co'])
But I want to use a parser BOTH as a subparser and as a full-fledged parser.
It is because my program should understand both of the following command line
options:
boiler chain
Victor Porton added the comment:
Subparsers are added like:
subparsers.add_parser('checkout', aliases=['co'])
But I want to use a parser BOTH as a subparser and as a full-fledged parser.
It is because my program should understand both of the following command line
options:
boiler chain -t
New submission from Victor Porton :
We should consider some way to implement argparse functionality asked here:
https://stackoverflow.com/q/53686523/856090
It is unclear how exactly to do this. This message is a call to discuss what
should be the information format and API.
The awful thing
What is the recommended format for --log-level (or --loglevel?) command line
option?
Is it a number or NOTSET|DEBUG|INFO|WARNING|ERROR|CRITICAL?
Or should I accept both numbers and these string constants?
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo
Victor Porton added the comment:
My bug report was wrong:
https://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html
In the DOM, all namespace declaration attributes are by definition bound to the
namespace URI: "http://www.w3.org/2000/xmlns/;. These are the attributes
New submission from Victor Porton :
I have:
parser.add_argument('-p', '--preload', help='preload asset', action='append',
metavar='NAMESPACE')
I want also add:
parser.add_argument('-f', '--file', help='preload file', action='append',
metavar='FILE', dest='preload')
This way I could
New submission from Victor Porton :
The following is a fragment of a real code:
~~~
def test_run_xinlude(self):
# stub_stdin(self,
Global.get_resource_bytes("tests/core/data/xml/xinclude.xml"))
for next_script_mode in ['doc1', 'doc2']:
for order in
New submission from Victor Porton :
The below script prints
http://www.w3.org/2000/xmlns/
aa:aa
It should print
None
aa:aa
because xmlns:z is NOT an attribute of xmlns namespace.
~~~
import xml.dom.minidom
x = xml.dom.minidom.parseString("")
for i in x.documentElement.attribu
Victor Porton added the comment:
@Raymond:
"Downstream processing or transformation of inputs is beyond the scope of
argparse which should stick to its core responsibilities of argument
extraction."
You somehow contradict the official documentation:
"One particularl
New submission from Victor Porton :
argparse produces a long unreadable, non-understandable for non-programmers
error message when a subparser is not specified in the command line.
Note that the below message contains Ubuntu specifics, but it seems it would be
nearly as unclear on other OSes
New submission from Victor Porton :
The below code produces "rock", but it should produce "a". This (to use dict
value instead of the key by argparse result) is both to be a new useful feature
(for example to map strings in a command line to certain functions or class
Change by Victor Porton :
--
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue34188>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Victor Porton :
It seems that bool(Q) always return True for a priority queue Q.
It should behave the same way as for bool(L) where L is a list, that is return
False on an empty queue.
Please check also other objects in https://docs.python.org/3/library/queue.html
After
New submission from Victor Porton <por...@narod.ru>:
https://docs.python.org/3/library/argparse.html does not allow abbreviations
for subparsers ("subcommands").
It seems inconsistent that long options can be abbreviated but subcommands
cannot.
Either implement subcomma
New submission from Victor Porton <por...@narod.ru>:
Please add `__exit__()` method to event loops, to use them with `with`.
--
components: asyncio
messages: 312360
nosy: asvetlov, porton, yselivanov
priority: normal
severity: normal
status: open
title: Add __exit__() method to
New submission from Victor Porton <por...@narod.ru>:
At https://docs.python.org/3/library/subprocess.html there is said nothing
about what happens if our Python program terminates (by SIGTERM or SIGINT)
while waiting for .communicate().
I assume to do something in this situation i
e objects of this class.
What is more pythonic?
1. Create its subclass PredicateParserWithError and add the additional field
on_error to this class.
2. Add on_error field to the base class, setting it to None by default, if
the class's user does not need this field.
--
Victor Porton - htt
First, I've already solved my problem using setuptools and
pkg_resources.resource_stream() and an environment variable to specify the
path to data files.
Ben Finney wrote:
> Victor Porton <por...@narod.ru> writes:
>
>> In GNU software written in C $srcdir and $datadir a
In GNU software written in C $srcdir and $datadir are accessible to C code
through generated config.h file.
What is the right way to config directories for a Python program?
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
dieter wrote:
> Victor Porton <por...@narod.ru> writes:
>
>> I am writing a library, a command line utility which uses the library,
>> and a I am going to use dependency_injector package.
>>
>> Consider loggers:
>>
>> For the
Victor Porton wrote:
> I want to write a multiuser application which uses multiple languages (one
> language for logging and a language per user).
>
> https://docs.python.org/3/library/gettext.html describes a procedural
> gettext interface. The language needs to be switched befo
ecution_context_build, or maybe in something
like xmlboiler.core.providers.execution_context?
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
above
example).
What is the best way to do this?
Should I write an object-oriented wrapper around gettext package?
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
of the library.
For the server, the log should go to a file (not to stderr).
Question: How to profoundly make my software to use the appropriate logger,
dependently on whether it is a command line utility or the daemon?
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman
Lawrence D’Oliveiro wrote:
> On Thursday, February 1, 2018 at 5:57:58 PM UTC+13, Victor Porton wrote:
>> I meant to call poll() from C code, not Python code.
>
> Do you need to use C code at all? Python is quite capable of handling this
> <https://docs.python.org/3/lib
Lawrence D’Oliveiro wrote:
> On Thursday, February 1, 2018 at 8:10:24 AM UTC+13, Victor Porton wrote:
>> Lawrence D’Oliveiro wrote:
>>
>>> The usual behaviour for POSIX is that the call is aborted with EINTR
>>> after you get the signal.
>>
>&
Dennis Lee Bieber wrote:
> On Wed, 31 Jan 2018 20:58:56 +0200, Victor Porton <por...@narod.ru>
> declaimed the following:
>
>>LibComCom is a C library which passes a string as stdin of an OS command
>>and stores its stdout in another string.
>>
>>
wxjmfa...@gmail.com wrote:
> Le mercredi 31 janvier 2018 20:13:06 UTC+1, Chris Angelico a écrit :
>> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton <por...@narod.ru> wrote:
>> > LibComCom is a C library which passes a string as stdin of an OS
>> > command and st
Chris Angelico wrote:
> On Thu, Feb 1, 2018 at 5:58 AM, Victor Porton <por...@narod.ru> wrote:
>> LibComCom is a C library which passes a string as stdin of an OS command
>> and stores its stdout in another string.
>
> Something like the built-in subprocess module
Lawrence D’Oliveiro wrote:
> On Wednesday, January 31, 2018 at 9:55:45 PM UTC+13, Victor Porton wrote:
>> Lawrence D’Oliveiro wrote:
>>
>>> On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton
>>> wrote:
>>>> For this reason I
>>&g
Traceback (most recent call last):
Segmentation fault
(here libcomcom.so is installed in /usr/local/lib)
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
Lawrence D’Oliveiro wrote:
> On Wednesday, January 31, 2018 at 8:58:18 PM UTC+13, Victor Porton wrote:
>> For this reason I
>> cannot use Python signals because "A Python signal handler does not get
>> executed inside the low-level (C) signal handler. Instead, the low-le
Victor Porton wrote:
> I need to assign a real C signal handler to SIGINT.
>
> This handler may be called during poll() waiting for data. For this reason
> I cannot use Python signals because "A Python signal handler does not get
> executed inside the low-level (C) sig
al handler).
Is this possible? How?
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
Lawrence D’Oliveiro wrote:
> On Wednesday, January 31, 2018 at 6:13:00 PM UTC+13, Victor Porton wrote:
>> I am going to create a Python wrapper around a generally useful C
>> library. So the wrapper needs to contain some C code to glue them
>> together.
>
> Not neces
I am going to create a Python wrapper around a generally useful C library.
So the wrapper needs to contain some C code to glue them together.
Can I upload a package containing C sources to PyPi?
If not, what is the proper way to distribute it?
--
Victor Porton - http://portonvictor.org
Gregory Ewing wrote:
> Victor Porton wrote:
>> You carp with words, finding a problem where there is no real problem,
>> just words (I mean the word "hack") which sound like a problem.
>
> Words are important. The very fact that it sounds like a
> probl
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote:
> On 3 May 2017 at 16:45, Victor Porton <por...@narod.ru> wrote:
> > Steve D'Aprano wrote:
> >
> > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote:
> > >
> > > > I have
Chris Warrick wrote:
> On 3 May 2017 at 17:19, Victor Porton <por...@narod.ru> wrote:
>> What do you mean by "banned"? Does this mean that Google does not use
>> software of this license?
>
> https://opensource.google.com/docs/using/agpl-policy/
>
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote:
> On 3 May 2017 at 16:45, Victor Porton <por...@narod.ru> wrote:
> > Steve D'Aprano wrote:
> >
> > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote:
> > >
> > > > I have
Steve D'Aprano wrote:
> On Wed, 3 May 2017 02:19 am, Victor Porton wrote:
>
>> I have created a full featured package to accept payments in Internet
>> (currently supports PayPal).
> [...]
>> Buy the commercial version and support scientific research and a new
&
gateway
for many different payment processors.
Buy the commercial version and support scientific research and a new
principle of the Web I am working on.
I hope you don't take this message as spam. Is it OK to post updates of our
software to this mailing list in the future?
--
Victor Porton - http
ount.
Consider PyPi. I never used it, but they say, it is faster than usual CPython
interpreter.
> I waiting with higher interest your feedback.
>
> Thanks to all members of community for support and advice.
> Keep in touch.
> Kind regards.
--
Victor Porton - http://portonvictor.org
--
ount.
Consider PyPi. I never used it, but they say, it is faster than usual
CPython interpreter.
> I waiting with higher interest your feedback.
>
> Thanks to all members of community for support and advice.
> Keep in touch.
> Kind regards.
--
Victor Porton - http://portonvictor.org
--
Victor Porton added the comment:
Weird, after I minimized the PHP example, it also has the same bug as the
Python one. (The real long code in PHP was working without this bug.)
I attach the PHP code for your reference.
Maybe it is a FreeBSD bug?
Please write to por...@narod.ru with advice
New submission from Victor Porton:
When I connect
telnet XXX 9000
to the server in attached file, the connection breaks after 5 min (and a few
seconds), as if SO_KEEPALIVE were not specified.
I run my server on
FreeBSD 9.2-RELEASE-p15 (GENERIC)
So SO_KEEPALIVE does not work in Python 2.7
Ned Batchelder wrote:
> On Monday, November 21, 2016 at 12:48:25 PM UTC-5, Victor Porton wrote:
>> Which of two variants of code to construct an "issue comment" object
>> (about BitBucket issue comments) is better?
>>
>> 1.
>>
>> obj = IssueCo
_subobject(repository, list)
(`construct_subobject` is to be defined in such as way that "1" and "2" do
the same.)
Would you advise me to make such function construct_subobject function or
just to use the direct coding as in "1"?
--
Victor Porton - http://portonvictor
...
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
Peter Otten wrote:
> Victor Porton wrote:
>
>> I am developing software which shows hierarchical information (tree),
>> including issues and comments from BitBucket (comments are sub-nodes of
>> issues, thus it forms a tree).
>>
>> There are t
Do I understand correctly, than C3 applies to particular methods, and thus
it does not fail, if it works for every defined method, even if it can fail
after addition of a new method?
Also, at which point it fails: at definition of a class or at calling a
particular "wrong" method?
# diamonds:
class A(BitBucketHierarchyLevel, HierarchyLevelWithPagination):
...
class B(BitBucketHierarchyLevel, HierarchyLevelWithShortList):
...
--
Victor Porton - http://portonvictor.org
--
https://mail.python.org/mailman/listinfo/python-list
56 matches
Mail list logo