New submission from Julien Palard:
This is accepted by browsers but raises an exception in HTMLParser :
from HTMLParser import HTMLParser
HTMLParser().feed(a onclick=foo({bar:42}); class=baz)
--
components: Library (Lib)
messages: 168352
nosy: JulienPalard
priority: normal
severity
New submission from Julien Palard:
I have a script that close its socket to /dev/log immediatly before using it,
causing it to fail, here is the code :
{{{
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import logging.handlers
import daemon
from daemon.pidlockfile import
Julien Palard added the comment:
I understand the files_preserve parameter, the bug I'm filling is the
innability of SysLogHandler to reopen the socket, although it tries :
// DaemonContext closing all FDs:
close(3)= 0
close(2)= 0
New submission from Julien Palard:
I just found that python consider linux implementation of getaddrinfo thread
safe :
./python2.6-2.6.8/Modules/socketmodule.c:180
/* On systems on which getaddrinfo() is believed to not be thread-safe
Julien Palard added the comment:
I think for some builtins it may be usefull to have keyword arguments, in the
case they take more than one parameter.
Typically, it's impossible to write:
self.drop_elements(partial(isinstance, type(lxml.etree.Comment)))
Because isinstance take its
Julien Palard added the comment:
Works for me in 2.7.8:
$ python --version
Python 2.7.8
# cat /tmp/test.py
#!/usr/bin/env python
from __future__ import print_function
def toto():
print (42, 43)
42 43
return 42
$ python -m doctest -v /tmp/test.py
Trying:
print (42
Changes by Julien Palard mandark@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24486
___
___
Python-bugs
Julien Palard added the comment:
OK, so, requests have a `timeout` and take it into account, and it solves my
problem.
Yet I don't understand one little thing:
With both requests `timeout` parameter set or unset, the exact same
http.client.py:_read_status call the same socket.readinto
New submission from Julien Palard:
Requesting HTTP using `requests`, which uses `http.client` which use `socket`,
sometimes, my program get stuck like this:
```
File /usr/lib/python3.2/socket.py, line 287 in readinto
File /usr/lib/python3.2/http/client.py, line 308 in _read_status
File /usr
Julien Palard added the comment:
I only have a `socket.setdefaulttimeout(10)` just after my imports...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24486
Julien Palard added the comment:
Hi,
Tried again, this time getting some stats with MCACHE_STATS 1, to check if my
patch is defeating the cache:
Without my patch:
$ time ./python performance/benchmarks/bm_chaos.py --worker -l1 -w0 -n1
--filename chaos.ppm --width=512 --height=512
Julien Palard added the comment:
John: You should probably package this as a pip module alongisde with a git
repository, at least to measure qty of interested persones, and get some
feedback / contributions.
--
___
Python tracker <
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
pull_requests: +143
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28754>
___
Julien Palard added the comment:
Your implementation looks right, but I don't see the point of defining
combinations AB, AC, ABD in the Foo enum. Foo may only define A, B, C, D and
outside of Foo anyone can build any needed combinations.
This way it looks clear in the Foo declaration (4 lines
Julien Palard added the comment:
Hi Elliot, nice spot!
Why are you redefining Py_ABS, which looks already defined in `pymacro.h`
included itself by `Python.h`? I'm not fan of undefining it later, it may
surprise someone later expecting it to be there.
I tried to compile without your
Julien Palard added the comment:
@Serhiy @haypo: Popular enough or not, it may start as a lib on pypi, we'll see
its usage from here.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Quoting @martin
> * bisect_right(a, x[, lo[, hi]]) -> index
> This signature is removed. I think removing it is reasonable, because pydoc
> can extract the proper signature from the Arg Clinic metadata.
In fact, http://docs.python.org/howto/clinic.
Julien Palard added the comment:
Should we also update howto/clinic, bullet "11.", to be explicit about not
adding per-parameter in the same patch? Like a:
> If you're porting existing function to Argument clinic, skip this step to
> simp
Julien Palard added the comment:
Here is the new patch, I ran a diff between "./python -m pydoc _bisect" before
and after my patch, here it is:
13,15c13
< bisect_left(...)
< bisect_left(a, x[, lo[, hi]]) -> index
<
---
> bisect_left(a,
Julien Palard added the comment:
Proposing a patch.
--
keywords: +patch
Added file: http://bugs.python.org/file45653/issue26483.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Hi Xavier, thanks for reporting,
Your first point is right, the implementation being:
if (PyDict_GetItemString(globals, "__builtins__") == NULL) {
if (PyDict_SetItemString(globals, "__builtins__",
PyEval
Julien Palard added the comment:
Hi Raymond,
> Curiously, this patch gives about a 10% to 15% speedup. Any sense of how
> that improvement arises?
That's because Argument Clinic is generating methoddef with METH_FASTCALL:
$ grep FASTCALL Modules/clinic/_bisectmodule.c.h
{"b
Julien Palard added the comment:
Hi Serhiy,
hi: Py_ssize_t(py_default="len(a)") = -1
Won't works, as pydoc will use the inspect module (_signature_fromstr) to get
the signature. _signature_fromstr expects a valid python signature, but `def
foo(a, x, lo=0, high=len(a)): pass` is
Julien Palard added the comment:
According to https://webstore.iec.ch/preview/info_isoiec6937%7Bed3.0%7Den.pdf:
> NOTE: The shaded positions 00/00 to 01/15 and 07/15 to 09/15 are outside the
> scope of this International Standard.
So it's clear to me that they are not undefined, they ar
Julien Palard added the comment:
Hi Serhiy,
> Julien, you can declare the hi parameter as
>hi: Py_ssize_t(py_default="len(a)") = -1
Looks like a good idea, I was aware of its existance but did not took the time
to read the doc about it, kind of learning step by stpe. But
Julien Palard added the comment:
Reopening to remind @Victor we have a question about METH_FASTCALL.
--
status: closed -> open
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.or
Julien Palard added the comment:
I can't reproduce the issue:
$ ./python
Python 3.6.0b4+ (default, Nov 23 2016, 00:23:59)
[GCC 5.4.1 20160904] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> o
Julien Palard added the comment:
New simplier patch thanks to https://bugs.python.org/issue28792. Also corrected
docstrings.
Also ran a micro-benchmark of `bisect.bisect(foo, "c")` with `foo =
list("abcdef")`:
Median +- std dev: [before] 434 ns +- 17 ns -> [after]
Julien Palard added the comment:
LGTM
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28792>
___
___
Python-bugs-list mailing list
Julien Palard added the comment:
Proposed a simple patch.
Error was introduced by "Issue #28720: Add collections.abc.AsyncGenerator.",
git commit c75c1f44, hg changeset 105163. I reread it and did not find other
occurrences of the error.
--
keywords: +patch
nosy: +mdk
Julien Palard added the comment:
Maybe something like:
> Python installs a small number of signal handlers by default: SIGPIPE is
> ignored (so write errors on pipes and sockets can be reported as ordinary
> Python exceptions) and SIGINT (if parent process has not changed it) is
>
New submission from Julien Palard:
Just a little patch to fix 4 doc build warning.
--
messages: 281673
nosy: mdk
priority: normal
severity: normal
status: open
title: FIX warnings in documentation build
___
Python tracker <rep...@bugs.python.
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
keywords: +patch
Added file: http://bugs.python.org/file45631/issue28796.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
After a discussion with Victor, I propose a patch to update the documentation
allowing users strictly following the doc to let Clinic use FASTCALLs, it's a
nice performance gain, and it's safe to let clinic use it.
--
Added file: http://bugs.python.org
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
versions: +Python 3.7
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Julien Palard added the comment:
Hi Rares thanks for reporting.
While building a patch for this issue I found another occurrence of the error.
--
keywords: +patch
nosy: +mdk
Added file: http://bugs.python.org/file45672/issue28820.diff
___
Python
Julien Palard added the comment:
Hi Raymond,
About Argument Clinic
#
Just to clarify the situation, Argument Clinic allows for clear method
signature, typically: `hi: Py_ssize_t(py_default="len(a)") = -1` gives the
expected "hi=len(a)" signature succes
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45626/issue28754-4.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
By moving:
```
/* else set the right exception and return NULL */
PyErr_SetString(pysqlite_ProgrammingError, "can't adapt");
```
from `pysqlite_microprotocols_adapt` to `pysqlite_adapt` (to avoid changing the
semantics from the out
Julien Palard added the comment:
Hi, thanks for your contribution!
Documentation give examples implementation of your methods:
- https://docs.python.org/3/library/socket.html#socket.socket.sendmsg
- https://docs.python.org/3/library/socket.html#socket.socket.recvmsg
and from here, some
Julien Palard added the comment:
I missed an occurrence of this "if/else" block, and by changing it, a lot of
tests are failing, typically:
```==
ERROR: CheckBlob (sqlite3.test.types.Sqlit
Julien Palard added the comment:
Problems looks from `Modules/_sqlite/statement.c`:
```
if (!_need_adapt(current_param)) {
adapted = current_param;
} else {
adapted = pysqlite_microprotocols_adapt(current_param,
(PyObject*)_PrepareProtocolType, NULL);
if (adapted
New submission from Julien Palard:
It looks like the "Converting Your First Function" has been written with
clinic-generated C code interspersed with user C code. But it looks like
nowadays a `clinic/{}.c.h` file is generated, so the "Converting Your First
Function" s
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
components: +Argument Clinic
nosy: +larry
versions: +Python 3.6
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
@Larry: As a french-speaking guy, I typically don't write non-internal doc in
english, fearing it sound weird for natives. I prefer translating it back in
french (I'm the current leader of https://github.com/afpy/python_doc_fr)
Here, here is a patch
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
type: -> enhancement
___
Python tracker <rep...@bugs.python.org>
<http://bugs.
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
versions: +Python 3.7
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
New submission from Julien Palard:
Today I read https://docs.python.org/3.6/howto/clinic.html so I tried one:
bisect.bisect_left.
I was unable to do `bisect_right`, as it's an "alias" for `bisect`, and there's
a unit-test checking `self.assertEqual(self.mod
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
keywords: +patch
Added file: http://bugs.python.org/file45562/issue28754.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45563/issue28754-2.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
Hi Stéphane,
Your patch is simple and elegant, but I'm asking myself a question about the
idea to pass a class instead of an instance to the TCPServer ctor (I know
that's not your choice).
If we were able to pass an instance of SimpleHTTPRequestHandler
Julien Palard added the comment:
Hi, did you forget to attach the patch?
--
nosy: +mdk
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Should we keep this open for the FASTCALL bit?
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
The whole diff is reviewable in `issue28754-3.diff`.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Thanks for proof-reading my english, your editions are really nice: LGTM.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45572/issue28754-3.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
keywords: +patch
Added file: http://bugs.python.org/file45573/issue28755.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
New submission from Julien Palard:
I was reading `howto/clinic.html` and though I'll fix syntax highlighting.
--
assignee: docs@python
components: Argument Clinic, Documentation
messages: 281304
nosy: docs@python, larry, mdk
priority: normal
severity: normal
status: open
title: Rework
Julien Palard added the comment:
I searched an occurrence of what I'm describing which is already using clinic
and there is, at least, one in Modules/binascii.c line 1090:
TL;DR: The idea is to use the `modulename.fnname [as c_basename] =
modulename.existing_fn_name` clinic syntax, drop
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45571/insort-left.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45568/bisect_left.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45570/insort.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
Here it is for the whole bisect module.
I separated my work in commits, but I'm not sure how rietveld will eat that as
they'll have unknown references, so I'll probably also upload a single patch
with a known reference
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45569/bisect.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
So, lgtm.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28750>
___
___
Python-bugs-list
Julien Palard added the comment:
The inconcistencies were introduced in hg changeset 41703:7993f23ad46c, git
commit:
commit 40ec96630b96f077c8b5746ab0ec038f95aede8b
Author: Walter Dörwald <wal...@livinglogic.de>
Date: Sat May 12 11:08:06 2007 +
Change PyUnicode_EncodeUnicode
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45575/issue28755-2.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45696/issue28795-2.7.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
Hi Martin,
Removed the removing of the double new line at end of file.
--
Added file: http://bugs.python.org/file45686/issue28820-2.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45793/issue26483.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
Tried to run the test_nanfunctions.py on tip and Python 3.6.0b4+, on numpy 1.11
and 1.12.0b1, can't make it fail.
Installed numpy 1.12.0b1 using: ./python -m pip install --user numpy==1.12.0b1
I suspect Charles tested using Python 3.6.0b3 (can you confirm
Julien Palard added the comment:
Just rebasing my patch on tip as it does no longer cleanly apply.
--
Added file: http://bugs.python.org/file45795/issue28755-3.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
I was able to simplify my patch a bit, I think I should also add a test to
ensure we keep the hi=-1 and hi=None compatibility in the future.
--
Added file: http://bugs.python.org/file45832/issue28754-8.diff
New submission from Julien Palard:
Today, writing an AC declaration like:
something: Py_ssize_t(c_default="-1") = None
Leads to the almost obvious "Py_ssize_t_converter: default value None for field
something is not of type int".
But it actually make sense:
- Acce
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
title: AC: Accept None as a default value for any type -> AC: Accept None as a
Py_ssize_t default value
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Changes by Julien Palard <julien+pyt...@palard.fr>:
Added file: http://bugs.python.org/file45836/issue28754-9.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Julien Palard added the comment:
Hi Larry,
In any cases it looks like supporting hi=-1 and hi=None is mandatory:
hi=None is the current implementation in the bisect (Python) module.
hi=-1 is the current implementation in the _bisect (C) module.
Both are currently living together, the C
Julien Palard added the comment:
Added a test to ensure compatibility of both hi=None (introduced in original
Python version) and hi=-1 (Introduced by the C version).
Modified Python version to be compatible with the C-introduced hi=-1, so that
the new test pass
Julien Palard added the comment:
Proposed a patch, but I'm not a huge fan of modifying getargs.c. If it's
accepted, I'll obviously need to write tests before this is merged.
--
keywords: +patch
Added file: http://bugs.python.org/file45838/issue28933.diff
Julien Palard added the comment:
Maybe wait for issue28933.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28754>
___
___
Pyth
Julien Palard added the comment:
> You propose an automatic conversion of "None" into "-1"? That's awful.
> Please don't commit that patch to CPython.
Not really, I propose a way to do it with AC when needed. And the AC semantics
introduced are not "Autom
Julien Palard added the comment:
Hi Raymond,
I don't like having the converters in the C implementation too, that's why I'm
working on issue28933 to clean this.
> letting the C function handle both -1 and None in the implementation rather
> than in AC?
It works, yes. But I prefer to c
Julien Palard added the comment:
> It looks like you did it with a converter for 28754. That's okay. But not
> in the default implementation.
It's not by default, we have to declare "… = None" in the AC declaration, which
was an error before my patch (incompatible
Julien Palard added the comment:
Hi Larry,
Do you mean a new converter in clinic.py like Nullable_Py_ssizze_t, or a
converter that I copy/paste every time I need it like
http://bugs.python.org/review/28754/patch/19417/76440 ?
--
___
Python tracker
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Julien Palard added the comment:
As the pattern of this converter is not widely used, I'll let it in the code of
_bisect for the moment, see: http://bugs.python.org/issue28933.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.p
Julien Palard added the comment:
For the record, I opened a WIP pull request here:
https://github.com/python/docsbuild-scripts/pull/8
Feedback is welcome.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
> for just one use case
I don't think that using None in a default argument is "one use case", nor a
"special case" it's more like a "widly used pattern" that I'd like to make
simple to implement (also see http://bugs.pytho
Julien Palard added the comment:
> issue28866.diff always invalidates the cache, so it works. But it is
> suboptimal, IMO it defeats the whole purpose of a cache.
Not sure about defeating the purpose of the cache as I only invalidate in
setattr, getattr are still cache hitting. I
Julien Palard added the comment:
Hi Larry,
Did you take more time to review this patch and my last comments? I don't think
it that awful as it does _not_ apply until explicitly asked for, but I'm open
to discuss it.
--
___
Python tracker <
Julien Palard added the comment:
LGTM but no AIX to test it.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28845>
___
___
Pyth
Changes by Julien Palard <julien+pyt...@palard.fr>:
--
status: open -> closed
___
Python tracker <rep...@bugs.python.org>
<http://bugs.pyt
Julien Palard added the comment:
I renamed your function groupby2 to compare it with itertools.groupby and
tested but:
>>> print(list(groupby2(['A', 'B'])))
does not returns, looks like your implementation have a bug, so I tried:
>>> for k in groupby2(['A', 'B']):
...
Julien Palard added the comment:
Should this issue be closed so?
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28853>
___
___
Julien Palard added the comment:
If nobody has nothing to add on this issue, I think it just should be closed.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Bump, 10 days later, hope this diff is still straightforward to merge.
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Hi Xavier,
> It is not the dictionary of builtin module, which is inserted in , but the
> current __builtin__ global
It looks wrong, I'll even say the exact contrary: It _is_ the dictionary of
builtin module which is inserted in, not the current __bui
Julien Palard added the comment:
So, is there still an inconsistency in the documentation?
--
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Julien Palard added the comment:
Proposed as patches but english is not my native language so please review
carefully.
--
keywords: +patch
Added file: http://bugs.python.org/file45695/issue28795-tip.diff
___
Python tracker <rep...@bugs.python.
Julien Palard added the comment:
Unless somebody don't think so, I think this should go as a pypi module before
going to the socket module, so this issue should probably be closed.
--
___
Python tracker <rep...@bugs.python.org>
1 - 100 of 685 matches
Mail list logo