[issue43424] Document the `controller.name` field in `webbrowser` module

2021-12-21 Thread Alex Willmer


Change by Alex Willmer :


--
nosy:  -Alex.Willmer

___
Python tracker 
<https://bugs.python.org/issue43424>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44724] multiprocessing: the Resource Tracker process is never reaped

2021-11-24 Thread Alex Willmer


Change by Alex Willmer :


--
nosy: +Alex.Willmer

___
Python tracker 
<https://bugs.python.org/issue44724>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31904] Python should support VxWorks RTOS

2021-05-08 Thread Alex Willmer


Change by Alex Willmer :


--
nosy:  -Alex.Willmer

___
Python tracker 
<https://bugs.python.org/issue31904>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23740] http.client request and send method have some datatype issues

2021-03-05 Thread Alex Willmer


Alex Willmer  added the comment:

http_dump.py now covers CPython 3.6-3.10 (via Tox), and HTTPSConnection 
https://github.com/moreati/bpo-23740

--

___
Python tracker 
<https://bugs.python.org/issue23740>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer


Change by Alex Willmer :


--
keywords: +patch
pull_requests: +23528
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24757

___
Python tracker 
<https://bugs.python.org/issue43407>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer


Alex Willmer  added the comment:

Discussion from #python IRC

[21:51]  Given `a=time.monotonic(); b=time.monotonic(); 
c=time.monotonic()` is `c-a < delta` a valid comparison? Until this evening I 
thought so, but I've just read 
https://docs.python.org/3/library/time.html#time.monotonic and the wording it 
uses is "only the difference between the results of consecutive calls is valid" 
implying `b-a < delta` is valid, or `c-b < delta`; but not `c-a < delta`. Am I 
understanding the wording correctly?
[21:52]  IOW is it literally only call n, and n+1. or n, and n+m?
[21:53]  moreati, I think "consecutive" is incorrect there, based on 
the rest of that sentence.
[21:57]  moreati SnoopJ yes, I agree, the consecutive wording has 
tripped me up when I first started using monotonic. I think there's an 
understated transitive property that allows a to c comparisons just fine.
[21:58]  jarthur, yea, it would be deeply weird if `b-a` and `c-b` were 
meaningful deltas, but `c-a` was not
[21:59]  re time.monotonic() the only reason I could of for the 
literal interpretation of the wording is an overflow, or integer wraparound 
corner case
[22:00]  weirdly, the CPython doc uses the same language
[22:02]  I actually ended up looking at the monotonic code a while 
back, and at least back then the wraparound case is really hard to reach, maybe 
possible on Windows if you haven't called it in a while. Either way, there was 
nothing in the Linux/glibc or Windows calls used that would have made the 
wraparound/overflow case apply to skipped evaluation of a middle observation 
more than it would consecutive observations.
...
[22:06]  moreati, looks like this language was added when the function 
was, and I guess maybe nobody's ever raised this complaint about the wording: 
https://hg.python.org/cpython/rev/376ce937823c
[22:07]  nice catch :)
...
[22:22]  FTR https://bugs.python.org/issue43407
[22:28]  moreati, I would recommend just submitting the PR, since it's 
docs.
[22:28]  ok
[22:28]  but I think the best wording would be something like "only the 
difference between two calls of this function is meaningful"
[22:30]  agreed, subsequent is a $5 word in a 50c requirement. May I 
quote our conversation in the ticket? Ditto jarthur
[22:30]  absolutely
[22:30]  yep
[22:30]  ty
[22:30]  but yea, just open a PR, that way you need a single pass from 
someone with authority here rather than two ;)
[22:31]  >Never use a long word where a short one will do.

--

___
Python tracker 
<https://bugs.python.org/issue43407>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43407] time.monotonic(): Docs imply comparing call N and call N+M is invalid for M>1

2021-03-04 Thread Alex Willmer


New submission from Alex Willmer :

I believe the documentation for time.monotonic() and time.perf_counter() could 
be misleading. Taken literally they could imply that given

delta = 0.1
a = time.monotonic()
b = time.monotonic()
c = time.monotonic()

the comparisons `b - a < delta`, and `c - b < delta` are valid; but `c - a < 
delta` is not valid.

I believe that `c - a < delta` is a valid comparison, and that what the 
documentation means to say is "only the difference between the results of 
*subsequent* calls is valid."

The exact wording (present since the functions were added in 
https://hg.python.org/cpython/rev/376ce937823c)

> The reference point of the returned value is undefined, so that only
> the difference between the results of consecutive calls is valid.

If there is agreement I'll submit a PR.

--
assignee: docs@python
components: Documentation
messages: 388133
nosy: Alex.Willmer, docs@python
priority: normal
severity: normal
status: open
title: time.monotonic(): Docs imply comparing call N and call N+M is invalid 
for M>1
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue43407>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23740] http.client request and send method have some datatype issues

2021-03-02 Thread Alex Willmer


Alex Willmer  added the comment:

First stab at characterising http.client.HTTPConnnection.send().

https://github.com/moreati/bpo-23740

This uses a webserver that returns request details, in the body of the 
response. Raw (TCP level) content is included. It shares a similar purpose to 
HTTP TRACE command. In principal the bytes that HTTPConection.send() writes 
will match to the bytes returned (after they're decapsulated from the JSON). 
I've not tested that aspect yet.

TODO
- further testing (verify round trip, bytes in = bytes out) 
- cover multiple Python versions
- cover cases such client manually setting Content-Length

--

___
Python tracker 
<https://bugs.python.org/issue23740>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23740] http.client request and send method have some datatype issues

2021-03-02 Thread Alex Willmer


Alex Willmer  added the comment:

A data point found while I researched this

MyPy typeshed [1] currently declares

_DataType = Union[bytes, IO[Any], Iterable[bytes], str]
class HTTPConnection:
def send(self, data: _DataType) -> None: ...


[1] 
https://github.com/python/typeshed/blob/e2967a8beee9e079963ea91a67087ba8fded1d0b/stdlib/http/client.pyi#L26

--
nosy: +Alex.Willmer

___
Python tracker 
<https://bugs.python.org/issue23740>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13559] Use sendfile where possible in httplib

2021-02-26 Thread Alex Willmer


Alex Willmer  added the comment:

To check my understanding

Is the motivation for the closer to

1. using sendfile() will break $X, and we know X
2. there's high probability sendfile() will break something
3. there's unknown probability sendfile() will break something
4. there's low probability sendfile() will break something, but it is still too 
high
5. any non-trivial change here is too risky, regardless of sendfile()
6. something else?

My guess is 5.

--

___
Python tracker 
<https://bugs.python.org/issue13559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13559] Use sendfile where possible in httplib

2021-02-25 Thread Alex Willmer


Alex Willmer  added the comment:

I would like to take a stab at this. Giampaolo, would it be okay if I made a 
pull request updated from your patch? With the appropriate "Co-authored-by: 
Author Name " line.

--
nosy: +Alex.Willmer

___
Python tracker 
<https://bugs.python.org/issue13559>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-11 Thread Alex Willmer


Alex Willmer  added the comment:

> it is probably not possible to write a pure Python PickleBuffer

Fair enough

> a usable pure Python Pickler, but without support for the PickleBuffer class.

That makes sense. However, for third party packages (e.g. zodbpickle, pikl) 
wanting a pure Python pickle module to use as a basis, I think it would make 
more sense to use the CPython 3.7 branch as a basis. Adding a pickle._Pickler 
variant to the 3.8 stdlib that can't do protocol 5, just for third-parties 
imposes a maintenance burden on the core devs for zero benefit to anyone.

I propose closing this ticket as WONTFIX.

--

___
Python tracker 
<https://bugs.python.org/issue37210>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-11 Thread Alex Willmer


Alex Willmer  added the comment:

I don't think I can do this. My WIP code is in 
https://github.com/moreati/cpython/pull/new/bpo-37210, and associated make test 
output is attached.

Principal blockers

-  `_pickle.PickleBuffer.raw()` can return a contiguous buffer from either a 
c_contiguous, or f_contiguous buffer. memoryview() (and hence 
pickle._PickleBuffer.raw()) requires a c_contiguous buffer.
- I'm unsure how to allow _PickleBuffer -> bytearray conversion

The most common cause of test failures is `TypeError: cannot pickle 
'memoryview' object`. I guess Python is seeing a lack of __reduce__(), and 
failing back to walking the object attributes. Implementing __reduce__() and or 
__reduce_ex__() might fix this, but seems moot given the other blockers.

--
Added file: https://bugs.python.org/file48410/bp0-37201_make_test_20190610.txt

___
Python tracker 
<https://bugs.python.org/issue37210>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-06-10 Thread Alex Willmer


Change by Alex Willmer :


--
keywords: +patch
pull_requests: +13814
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/13947

___
Python tracker 
<https://bugs.python.org/issue37218>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-06-10 Thread Alex Willmer


Alex Willmer  added the comment:

Scratch the part about documented signature, it's still `hmac.new(... 
digestmod=None)`, the check happens in the body of the function

--

___
Python tracker 
<https://bugs.python.org/issue37218>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37218] Default hmac.new() digestmod has not been removed from documentation

2019-06-10 Thread Alex Willmer


New submission from Alex Willmer :

Until Python 3.8 hmc.new() defaulted the digestmod argument to 'hmac-md5'. This 
was deperecated, to be removed in Python 3.8. In Python 3.8.0b1 it is gone, e.g.

Python 3.8.0b1 (default, Jun  6 2019, 03:44:52) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hmac
>>> hmac.new(b'qwertyuiop').name
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.8/hmac.py", line 146, in new
return HMAC(key, msg, digestmod)
  File "/usr/lib/python3.8/hmac.py", line 49, in __init__
raise ValueError('`digestmod` is required.')
ValueError: `digestmod` is required.

but the deprecation note, and the documented signature haven't been updated.

PR incoming

--
assignee: docs@python
components: Documentation
messages: 345144
nosy: Alex.Willmer, docs@python
priority: normal
severity: normal
status: open
title: Default hmac.new() digestmod has not been removed from documentation
versions: Python 3.8, Python 3.9

___
Python tracker 
<https://bugs.python.org/issue37218>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-09 Thread Alex Willmer


Alex Willmer  added the comment:

Attempting a PR

--

___
Python tracker 
<https://bugs.python.org/issue37210>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-09 Thread Alex Willmer


Alex Willmer  added the comment:

Arggh, typo. I mean maximizing *your* convenience is paramount.

--

___
Python tracker 
<https://bugs.python.org/issue37210>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37210] Pure Python pickle module should not depend on _pickle.PickleBuffer

2019-06-09 Thread Alex Willmer


Alex Willmer  added the comment:

I noticed this because I was experimenting with pickle.py from the 3.8 branch 
to support protocol 5 in https://github.com/moreati/pikl (and later to 
https://pypi.org/project/zodbpickle/).

However I want to make it clear, if CPython maintainers wish to keep the code 
as it is I will deal with it. Maximizing our convenience, and minimizing your 
maintenance workload is paramount.

--
nosy: +Alex.Willmer

___
Python tracker 
<https://bugs.python.org/issue37210>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27701] [posixmodule] [Refactoring patch] Simply call into *at() functions unconditionally when present

2016-08-08 Thread Alex Willmer

Changes by Alex Willmer <a...@moreati.org.uk>:


--
nosy: +Alex.Willmer

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27701>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27336] --without-threads build fails due to undeclared _PyGILState_check_enabled

2016-06-16 Thread Alex Willmer

New submission from Alex Willmer:

Building current tip (rev 102062:3d726dbfca31), on Ubuntu 16.04/x86_64, using 
--without-thread fails; with the following error
gcc -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes-Werror=declaration-after-statement   -I. -IInclude 
-I./Include-DPy_BUILD_CORE -o Python/pylifecycle.o Python/pylifecycle.c
Python/pylifecycle.c: In function ‘Py_NewInterpreter’:
Python/pylifecycle.c:751:5: error: ‘_PyGILState_check_enabled’ undeclared 
(first use in this function)
 _PyGILState_check_enabled = 0;
 ^
Python/pylifecycle.c:751:5: note: each undeclared identifier is reported only 
once for each function it appears in
Makefile:1575: recipe for target 'Python/pylifecycle.o' failed
make: *** [Python/pylifecycle.o] Error 1

I've attached the full build log.

--
components: Build
files: without-threads.build.log
messages: 268683
nosy: Alex.Willmer
priority: normal
severity: normal
status: open
title: --without-threads build fails due to undeclared _PyGILState_check_enabled
versions: Python 3.6
Added file: http://bugs.python.org/file43422/without-threads.build.log

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27336>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27229] In tree cross-build fails copying Include/graminit.h to itself

2016-06-05 Thread Alex Willmer

New submission from Alex Willmer:

While trying a cross compile of Python 3.6 I encountered the following

alex@martha:~/src/cpython default☿ hg summary
parent: 101753:31ad7885e2e5 
 Issue #27225: Fixed a reference leak in type_new when setting __new__ fails.
branch: default
commit: (clean)
update: (current)

alex@martha:~/src/cpython default☿ ./configure --build=x86_64-linux 
--host=arm-linux-gnueabihf --disable-ipv6 ac_cv_file__dev_ptc=no 
ac_cv_file__dev_ptmx=no
checking for hg... found
...
creating Makefile
alex@martha:~/src/cpython default☿ make
...
arm-linux-gnueabihf-gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes   
Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o 
Parser/parser.o Parser/bitset.o Parser/metagrammar.o Parser/firstsets.o 
Parser/grammar.o Parser/pgen.o Objects/obmalloc.o Python/dynamic_annotations.o 
Python/mysnprintf.o Python/pyctype.o Parser/tokenizer_pgen.o 
Parser/printgrammar.o Parser/parsetok_pgen.o Parser/pgenmain.o -lpthread -ldl  
-lpthread -lutil -o Parser/pgen
if test "yes" != "yes"; then \
Parser/pgen ./Grammar/Grammar Include/graminit.h Python/graminit.c; \
else \
cp ./Include/graminit.h Include/graminit.h; \
fi
cp: './Include/graminit.h' and 'Include/graminit.h' are the same file
Makefile:806: recipe for target 'Include/graminit.h' failed
make: *** [Include/graminit.h] Error 1


The attached patch allows me to get past this error. I'm unsure if it's an 
appropriate fix or just a workaround.

--
components: Cross-Build
files: graminit-same-file.patch
keywords: patch
messages: 267417
nosy: Alex.Willmer
priority: normal
severity: normal
status: open
title: In tree cross-build fails copying  Include/graminit.h to itself
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file43235/graminit-same-file.patch

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27229>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22625] When cross-compiling, don’t try to execute binaries

2016-03-14 Thread Alex Willmer

Alex Willmer added the comment:

On 14 March 2016 at 01:05, Robert Collins <rep...@bugs.python.org> wrote:
> There are three platforms in play: target, host, build.
>
> Host is the platform where what you build should run on.
> build is the platform we are building on.
> target is the platform where the *output* of the build thing itself should 
> run on. Baby steps though: lets assume target==host always.

To be 100% explicit: CPython doesn't need to worry about the third
one, the target platform. That only matters when the thing being
compiled, will itself cross-compile/process binaries at runtime e.g.
gcc, binutils. So if

 - I'm on Linux and
 - I want to compile a gcc that runs on BeOS
 - that in turn compiles binaries for TempleOS

only then would target matter.

--
nosy: +moreati

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22625>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26271] freeze.py makefile uses the wrong flags variables

2016-03-07 Thread Alex Willmer

Changes by Alex Willmer <a...@moreati.org.uk>:


--
nosy: +Alex.Willmer

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26271>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26505] [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c

2016-03-07 Thread Alex Willmer

New submission from Alex Willmer:

The license of Modules/getaddrinfo.c misspells ANY as GAI_ANY. I'm assuming a 
sed invocation was the cause. The same file later uses GAI_ANY as a wildcard 
for socket type, protocol and port.

It looks like this mistake was present when the code was first committed.

--
files: getaddrinfo-license-ANY.patch
keywords: patch
messages: 261301
nosy: Alex.Willmer
priority: normal
severity: normal
status: open
title: [PATCH] Spelling of ANY in the license of Modules/getaddrinfo.c
Added file: http://bugs.python.org/file42083/getaddrinfo-license-ANY.patch

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26505>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26443] cross building extensions picks up host headers

2016-03-01 Thread Alex Willmer

Alex Willmer added the comment:

This looks like a duplicate of #20211, and IMO the patch there is more correct.

--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22654] issue with PYTHON_FOR_BUILD

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer <a...@moreati.org.uk>:


--
nosy: +Alex.Willmer

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22654>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22699] cross-compilation of Python3.4

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer <a...@moreati.org.uk>:


--
nosy: +Alex.Willmer

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22699>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22625] When cross-compiling, don’t try to execute binaries

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer <a...@moreati.org.uk>:


--
nosy: +Alex.Willmer

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22625>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26443] cross building extensions picks up host headers

2016-03-01 Thread Alex Willmer

Changes by Alex Willmer <a...@moreati.org.uk>:


--
nosy: +Alex.Willmer

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26443>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23670] Modifications to support iOS as a cross-compilation target

2016-03-01 Thread Alex Willmer

Alex Willmer added the comment:

I've done my best to rebase Freakboy's patch onto 3.6-dev. The attached applies 
cleanly, but the testsuite goes into an infinite loop. It's a start at least. 
At a guess the problem is in Lib/test/libregrtest/ or Lib/test/regrtest.py 
where the patch changes sys.exit() calls to return statements.

I took the liberty of filtering out whitespace & other cosmetic changes that 
were in 20151221.diff.

--
nosy: +Alex.Willmer
Added file: http://bugs.python.org/file42059/20160301-brokentests.diff

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23670>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25009] queue.Queue() does not validate the maxsize argument

2015-09-05 Thread Alex Willmer

New submission from Alex Willmer:

The maxsize argument when initializing a Queue is expected to be an int 
(technically anything that can be compared to an int). However the class takes 
any value. In Python 3 this throws "TypeError: unorderable types" once e.g. 
.put() is called.

On the basis that errors should not pass silent, should maxsize be checked for 
compatibility at initialization time? e.g.

Desired:

>>> import queue
>>> q = queue.Queue(range(10))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/queue.py", line nnn, in __init__()
...
TypeError: 'range' object cannot be interpreted as an integer


Actual:

Python 3.5.0rc2 (default, Aug 25 2015, 20:29:07) 
[GCC 5.2.1 20150825] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import queue
>>> q = queue.Queue(range(10)) # Silently accepts an invalid maxsize
>>> q.put('foo')
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/queue.py", line 127, in put
if self.maxsize > 0:
TypeError: unorderable types: range() > int()

--
components: Library (Lib)
messages: 249914
nosy: Alex.Willmer
priority: normal
severity: normal
status: open
title: queue.Queue() does not validate the maxsize argument
type: behavior
versions: Python 3.4

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25009>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12006] strptime should implement %V or %u directive from libc

2014-09-22 Thread Alex Willmer

Alex Willmer added the comment:

Alexander, 

http://bugs.python.org/file36417/12006_3.5_complete.patch updates the previous 
patches and is ready for review. Unit tests pass as of today. 

Regards, Alex W.

--
nosy: +Alex.Willmer

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12006] strptime should implement %V or %u directive from libc

2014-08-19 Thread Alex Willmer

Changes by Alex Willmer a...@moreati.org.uk:


Added file: http://bugs.python.org/file36417/12006_3.5_complete.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12006
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19796] urllib2.HTTPError.reason is not documented as Added in 2.7

2013-11-26 Thread Alex Willmer

New submission from Alex Willmer:

issue13211 added a .reason attribute to urllib2.HTTPError in Python 2.7, 
issue16634 documented it (http://hg.python.org/cpython/rev/deb60efd32eb).

The documentation for Python 2.7 doesn't mention that this attribute was added 
in that release. This (at least weakly) implies it's available to use in 
previous 2.x releases.

--
assignee: docs@python
components: Documentation
files: HTTPError.reason-versionadded.diff
keywords: patch
messages: 204465
nosy: docs@python, moreati
priority: normal
severity: normal
status: open
title: urllib2.HTTPError.reason is not documented as Added in 2.7
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file32855/HTTPError.reason-versionadded.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19796
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-11 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

The re module throws an exception for re.compile(r'[\A\w]'). latest
regex doesn't, but I don't think the pattern is matching correctly.
Shouldn't findall(r'[\A]\w', 'a b c') return ['a'] and
findall(r'[\A\s]\w', 'a b c') return ['a', ' b', ' c'] ?

Python 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 import re
 for s in [r'\A\w', r'[\A]\w', r'[\A\s]\w']: print re.findall(s, 'a b c')
...
['a']
[]
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python2.6/re.py, line 177, in findall
return _compile(pattern, flags).findall(string)
  File /usr/lib/python2.6/re.py, line 245, in _compile
raise error, v # invalid expression
sre_constants.error: internal: unsupported set operator
 import regex
 for s in [r'\A\w', r'[\A]\w', r'[\A\s]\w']: print regex.findall(s, 'a b c')
...
['a']
[]
[' b', ' c']

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-11-11 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On Thu, Nov 11, 2010 at 10:20 PM, Vlastimil Brom rep...@bugs.python.org wrote:
 Maybe I am missing something, but the result in regex seem ok to me:
 \A is treated like A in a character set;

I think it's me who missed something. I'd assumed that all backslash
patterns (including \A for beginning of string) maintain their meaning
in a character class. AFAICT that assumption was wrong.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-08-14 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 14 August 2010 21:24, Matthew Barnett rep...@bugs.python.org wrote:
 Over to you, Alex. :-)

Et voilà, an exciting Saturday evening
http://pypi.python.org/pypi/regex/0.1.20100814

Matthew, I'm currently keeping regex in a private bzr repository. Do
you have yours in source control? If so/not could we make yours/mine
public, and keep everything in one repository?
-- 
Alex Willmer a...@moreati.org.uk

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-25 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 25 July 2010 03:46, Matthew Barnett rep...@bugs.python.org wrote:
 issue2636-20100725.zip is a new version of the regex module.

This is now packaged and uploaded to PyPI
http://pypi.python.org/pypi/regex/0.1.20100725

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-13 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 13 July 2010 22:34, Jonathan Halcrow rep...@bugs.python.org wrote:
 The most recent version on pypi (20100709) seems to be missing _regex_core 
 from py_modules in setup.py.

Sorry, my fault. I've uploaded a corrected version
http://pypi.python.org/pypi/regex/0.1.20100709.1

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-06 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

I've packaged Matthew's latest revision and uploaded it to PyPI. This
version will build for Python 2 and Python 3, parallel installs will
coexist on the same machine.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-07-06 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 6 July 2010 18:03, Matthew Barnett rep...@bugs.python.org wrote:
 The file at http://pypi.python.org/pypi/regex/ was downloaded 75 times, if 
 that's any help. (Now reset to 0 because of the bug fix.)


Each release was downloaded between 50 and 100 times. Matthew let me
know if you'd like control of the package, or maintainer access. Other
than the odd tweet I haven't publicized the releases.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-04-13 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 13 April 2010 03:21, Matthew Barnett rep...@bugs.python.org wrote:
 issue2636-20100413.zip is a new version of the regex module.

Matthew, When I run test_regex.py 6 tests are failing, with Python
2.6.5 on Ubuntu Lucid and my setup.py. Attached is the output, do all
the tests pass in your build?

Alex

--
Added file: http://bugs.python.org/file16910/test_regex_20100413

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___

test_regex_20100413
Description: Binary data
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-04-13 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 13 April 2010 18:10, Matthew Barnett rep...@bugs.python.org wrote:
 Anyway, do:

    regex.match(ur\p{Ll}, ua)
    regex.match(ur'(?u)\w', u'\xe0')

 really return None? Your results suggest that they won't.

Python 2.6.5 (r265:79063, Apr  3 2010, 01:56:30)
[GCC 4.4.3] on linux2
Type help, copyright, credits or license for more information.
 import regex
 regex.__version__
'2.3.0'
 print regex.match(ur\p{Ll}, ua)
None
 print regex.match(ur'(?u)\w', u'\xe0')
None

I thought I might be a 64 bit issue, but I see the same result in a 32
bit VM. That leaves my build process. Attached is the setup.py and
build output, unicodedata_db.h was taken from the Ubuntu source deb
for Python 2.6.5.

--
Added file: http://bugs.python.org/file16913/setup.py
Added file: http://bugs.python.org/file16914/build.log

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___#!/usr/bin/env python

import os
import shutil
import sys

from distutils.core import setup, Extension

MAJOR, MINOR = sys.version_info[:2]
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

if MAJOR == 2:
SRC_DIR = BASE_DIR
elif MAJOR == 3:
SRC_DIR = os.path.join(BASE_DIR, 'Python3')

if (MAJOR, MINOR) in ((2,5), (2,6), (2,7)):
unicodedata_db_h = os.path.join(SRC_DIR, 'Python%i%i' % (MAJOR, MINOR), 
'unicodedata_db.h')
shutil.copy(unicodedata_db_h, SRC_DIR)
else:
sys.exit(No unicodedata_db.h could be prepared.)

setup(
name='regex',
version='0.1.2010413',
description='Alternate regular expression module, to replace re.',
long_description=open(os.path.join(SRC_DIR, 'Features.rst')).read(),

# PyPI does spam protection on email addresses, no need to do it here
author='Matthew Barnett',
author_email='re...@mrabarnett.plus.com',

# PyPI appears to overwrite author field with maintainer field
# avoid apparent plagarism for now.
#maintainer='Alex Willmer',
#maintainer_email='a...@moreati.org.uk',

url='http://bugs.python.org/issue2636',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: Python Software Foundation License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing',
'Topic :: Text Processing :: General',
],
license='Python Software Foundation License',

py_modules = ['regex'],
ext_modules=[Extension('_regex', ['_regex.c'])],
)
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
copying regex.py - build/lib.linux-x86_64-2.6
running build_ext
building '_regex' extension
creating build/temp.linux-x86_64-2.6
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c _regex.c -o build/temp.linux-x86_64-2.6/_regex.o
In file included from _regex.c:3948:
_regex.c: In function ‘build_lookaround’:
_regex.c:7578: warning: suggest parentheses around ‘’ within ‘||’
_regex.c: At top level:
unicodedata_db.h:241: warning: ‘nfc_first’ defined but not used
unicodedata_db.h:448: warning: ‘nfc_last’ defined but not used
unicodedata_db.h:550: warning: ‘decomp_prefix’ defined but not used
unicodedata_db.h:2136: warning: ‘decomp_data’ defined but not used
unicodedata_db.h:3148: warning: ‘decomp_index1’ defined but not used
unicodedata_db.h:: warning: ‘decomp_index2’ defined but not used
unicodedata_db.h:4122: warning: ‘comp_index’ defined but not used
unicodedata_db.h:4241: warning: ‘comp_data’ defined but not used
unicodedata_db.h:5489: warning: ‘get_change_3_2_0’ defined but not used
unicodedata_db.h:5500: warning: ‘normalization_3_2_0’ defined but not used
In file included from _regex.c:3948:
_regex.c: In function ‘splitter_split’:
_regex.c:5265: warning: ‘result’ may be used uninitialized in this function
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.6/_regex.o -o build/lib.linux-x86_64-2.6/_regex.so
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-04-13 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 14 April 2010 00:33, Matthew Barnett rep...@bugs.python.org wrote:
 I think I might have identified the cause of the problem, although I still 
 haven't been able to reproduce it, so I can't be certain.

Performed 76

Passed

Looks like you got it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-03-16 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

I've adapted the Python 2.6.5 test_re.py as follows, 

 from test.test_support import verbose, run_unittest
-import re
-from re import Scanner
+import regex as re
+from regex import Scanner

and run it against regex-2010305. Three tests failed, and the report is 
attached.

--
Added file: http://bugs.python.org/file16563/regex_test-20100316

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-26 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 26 February 2010 03:20, Matthew Barnett rep...@bugs.python.org wrote:
 Added file: http://bugs.python.org/file16375/issue2636-20100226.zip

This is now uploaded to PyPI http://pypi.python.org/pypi/regex/0.1.20100226
-- 
Alex Willmer a...@moreati.org.uk
http://moreati.org.uk/blog

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-22 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 22 Feb 2010, at 21:24, Matthew Barnett rep...@bugs.python.org  
wrote:

 issue2636-20100222.zip is a new version of the regex module.

 This new version adds reverse searching.

 The 'features' now come in ReStructuredText (.rst) and HTML

Thank you matthew. My laptop is out of action, so it will be a few  
days before I can upload a new version to PyPI.

If you would prefer to have control of the pypi package, or to share  
control please let mr know.

Alex

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-21 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

On 17 February 2010 19:35, Matthew Barnett rep...@bugs.python.org wrote:
 The main text at http://pypi.python.org/pypi/regex appears to have lost its 
 backslashes, for example:

    The Unicode escapes u and U are supported.

 instead of:

    The Unicode escapes \u and \U are supported.

Matthew, As you no doubt realised that text is read straight from the
Features.txt file. PyPI interprets it as RestructuredText, which uses
\ as an escape character in various cases. Do you intentionally write
Features.txt as RestructuredText? If so here is a patch that escapes
the \ characters as appropriate, otherwise I'll work out how to make
PyPI read it as plain text.

Regards, Alex
-- 
Alex Willmer a...@moreati.org.uk
http://moreati.org.uk/blog

--
Added file: http://bugs.python.org/file16278/Features-backslashes.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___=== modified file 'Features.txt'
--- Features.txt2010-02-17 12:22:14 +
+++ Features.txt2010-02-21 14:44:13 +
@@ -61,7 +61,7 @@
 regex.findall and regex.finditer support an 'overlapped' flag which 
permits overlapped matches
 
 Unicode escapes (#3665)
-The Unicode escapes \u and \U are supported.
+The Unicode escapes \\u and \\U are supported.
 
 Large patterns (#1160)
 Patterns can be much larger.
@@ -94,23 +94,23 @@
 Named groups can be named with (?name...) as well as the current 
(?Pname...).
 
 Group references
-Groups can be referenced within a pattern with \gname. This also allows 
there to be more than 99 groups.
+Groups can be referenced within a pattern with \\gname. This also allows 
there to be more than 99 groups.
 
 Named characters
-\N{name}
+\\N{name}
 Named characters are supported.
 
 Unicode properties
-\p{name}
-\P{name}
-Unicode properties are supported. \p{name} matches a character which has 
property 'name' and \P{name} matches a character which doesn't have property 
'name'.
+\\p{name}
+\\P{name}
+Unicode properties are supported. \\p{name} matches a character which has 
property 'name' and \\P{name} matches a character which doesn't have property 
'name'.
 
 Posix character classes
 [[:alpha:]]
 Posix character classes are supported.
 
 Search anchor
-\G
+\\G
 A search anchor has been added. It matches at the position where each 
search started/continued and can be used for contiguous matches or in negative 
variable-length lookbehinds to limit how far back the lookbehind goes:
 
  regex.findall(r\w{2}, abcd ef)

___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-02-17 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

I've packaged this latest revision and uploaded to PyPI 
http://pypi.python.org/pypi/regex

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-17 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

Matthew's 20080915.zip attachment is now on PyPI. This one, having a
more complete MANIFEST, will build for people other than me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2009-08-13 Thread Alex Willmer

Alex Willmer a...@moreati.org.uk added the comment:

I've made an installable package of Matthew Barnett's patch. It may get
this to a wider audience. 

http://pypi.python.org/pypi/regex

Next I'll look at incorporating Andrew Kuchling's suggestion of the re
tests from CPython.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-10-18 Thread Alex Willmer

Changes by Alex Willmer [EMAIL PROTECTED]:


--
nosy: +moreati

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2636
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com