[issue43724] cannot compute sizeof (long double)

2021-04-03 Thread Allen


Change by Allen :


--
files: config.log
nosy: allenlili
priority: normal
severity: normal
status: open
title: cannot compute sizeof (long double)
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file49933/config.log

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



[issue43724] macOS cannot compute sizeof (long double)

2021-04-03 Thread Allen


Change by Allen :


--
title: cannot compute sizeof (long double) -> macOS cannot compute sizeof (long 
double)

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



[issue32700] The replys additional (Re.) is ok.

2018-01-28 Thread Allen

New submission from Allen :

..

--
messages: 310995
nosy: BIGAL
priority: normal
severity: normal
status: open
title: The replys additional (Re.) is ok.

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



[issue32704] Tracking

2018-01-28 Thread Allen

New submission from Allen :

Could someone help me use python to track the tArget phones location and i
would like to intercepts all text and emaIl.

..

--
messages: 311059
nosy: BIGAL
priority: normal
severity: normal
status: open
title: Tracking

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



[issue7978] SocketServer doesn't handle syscall interruption

2010-04-28 Thread Bryce Allen

Bryce Allen  added the comment:

I encountered this issue when trying to exit cleanly on SIGTERM, which I use to 
terminate background daemons running serve_forever.

In BaseServer, a threading.Event is used in shutdown, so it can block until 
server_forever is finished (after checking __serving). Since the SIGTERM 
interrupts the select system call, the event set is never reached, and shutdown 
hangs waiting on the event.

I've attached an example of the pattern I was trying to use in my server. There 
are several ways around the issue, but looking at the API it seems like this 
_should_ work, and in my experience all servers have clean-up code so it's a 
very common case.

--
nosy: +bda
Added file: http://bugs.python.org/file17120/sockServe.py

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



[issue2424] Logging module hides user code errors (bare except)

2008-03-19 Thread Brad Allen

New submission from Brad Allen <[EMAIL PROTECTED]>:

The logging module contains several bare except statements. It's
understandable that the logging module should be completely silent, but
in the case of logging.config, the bare except can make it very
difficult to identify when there is a problem with a customer handler or
even with configuration.

These are the offending lines (lines 133-134): 

except: #if an error occurs when instantiating a handler, too bad
pass#this could happen e.g. because of lack of privileges

Maybe this should only catch OSError, so that other problems will
generate a failure at this point and show the correct traceback. My
experience is that there is usually a failure anyway when there is a
configuration problem, but the error is usually misleading.

By the way, exceptions generated here seem to mainly occur when a Python
script is first starting up, as it involves the initial configuration. I
am not convinced that the logging module should be silent at that stage.

--
components: Library (Lib)
messages: 64069
nosy: bradallen
severity: normal
status: open
title: Logging module hides user code errors (bare except)
type: behavior
versions: Python 2.4

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2424>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2424] Logging module hides user code errors (bare except)

2008-03-19 Thread Brad Allen

Brad Allen <[EMAIL PROTECTED]> added the comment:

in the previous post, please replace the word 'customer' with the word
'user'

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2424>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28708] Low FD_SETSIZE limit on Windows

2021-05-11 Thread Nicole Allen


Nicole Allen  added the comment:

Thanks for putting that all together. Besides for amazing digital marketing 
plans visit us now https://www.seobrisk.com/locations/seo-detroit/

--
nosy: +nicoleallen

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



[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Jeff Allen


Jeff Allen  added the comment:

I'm interested in Thomas' reasons, but here are some of mine (as far as I 
understand things):

1. It is specific to one interpreter implemented in C, equipped with a GIL, and 
on certain assumptions about the byte code interpreter and the implementation 
of built-ins, that may not hold long-term. 

2. In x = L[i], the index and assignment are distinct actions (in today's byte 
code), allowing L or i to change before x is assigned. This applies to multiple 
other of the examples.

3. A compiler (even a CPU) is free to re-order operations and cache values in 
unguessable ways, on the assumption of a single thread.

4. Code written on these principals is fragile. It only takes the replacement 
of a built-in with sub-class redefining __getitem__ (to support some worthy aim 
elsewhere in the code) to invalidate it.

5. sort() is not atomic if an element is of a type that overrides comparison in 
Python. (Nor is modifying a dictionary if __hash__ or __eq__ are redefined.)
 

If you want retain the question, with a better answer, the last sentence is 
good: "When in doubt, use a mutex!", accompanied by "Always be in doubt."

--
nosy: +jeff.allen

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



[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Jeff Allen


Jeff Allen  added the comment:

Thomas wrote:
> it's as part of this discussion in 
> https://mail.python.org/archives/list/python-...@python.org/thread/ABR2L6BENNA6UPSPKV474HCS4LWT26GY/#IAOCDDCJ653NBED3G2J2YBWD7HHPFHT6
>  and others in #python-dev 

That's where I noticed it, but it seemed the wrong place to explore this way.

Steven is right, I'm over-stating the case. And although valid that this is 
CPython specific, it's well sign-posted and I'm just being thin-skinned.

Serhiy writes:
> sort() is atomic, even if GIL is released during executing custom __lt__. It 
> is guaranteed that no operations on the list in other threads can affect the 
> result of sort().

The strategy noted here: 
https://github.com/python/cpython/blob/2d21612f0dd84bf6d0ce35bcfcc9f0e1a41c202d/Objects/listobject.c#L2261-L2265
does guarantee that, which I hadn't noticed. What if during the release of the 
GIL, another thread appends to L? In my simple experiment I get a ValueError 
and the modifications are lost. I think that is not thread-safe.

Serhiy also writes:

> I do not understand what non-atomic you see in x = L[i]. The value of x is 
> determined by values of L and i at the start of the operation. GIL is not 
> released during indexing L, and if it is released between indexing and 
> assignment, it does not affect the result.

and Steven:

> Does that matter though? I think that's a distinction that makes no 
difference.

> We know that another thread could change the L or the i before the 
assignment, if they are global. But once the L[i] lookup has occurred, 
it doesn't matter if they change. It's not going to affect what value 
gets bound to the x.

Fair enough. Atomicity is a bit slippery, I find. It depends where the critical 
region starts. Thinking again, it's not the assignment that's the issue ...

L is pushed
i is pushed
__getitem__ is called
x is popped

It is possible, if i and L are accessible to another thread and change after L 
is pushed, that x is given a value composed from an i and an L that never 
existed concurrently in the view of the other thread. Straining at gnats here, 
but atomicity is a strong claim.

And on the point about re-ordering and CPUs, I can't imagine re-ordering that 
effectively changes the order of byte codes. But do CPython threads run in 
separate CPUs, or is that only when we have multiple interpreters? If so, and L 
were in a hot memory location (either the variable or its content), this could 
be inconsistent between threads. Sorry, I don't know the memory coherence 
CPython has: I know I couldn't rely on it in Java.

I'm just arguing that the section gives advice that is *nearly* always right, 
which is a horrible thing to debug. I'll stop stirring.

--

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



[issue39639] Remove Suite node from AST

2020-02-22 Thread Jeff Allen


Jeff Allen  added the comment:

Jython uses the reference grammar and ASDL as a way to ensure it is Python we 
approximate, not some subtly different language. The presence of Suite here 
gives rise to a class 
(https://github.com/jythontools/jython/blob/v2.7.2b3/src/org/python/antlr/ast/Suite.java)
 and we actually use instances of it in the compiler 
(https://github.com/jythontools/jython/blob/v2.7.2b3/src/org/python/compiler/CodeCompiler.java#L2389).

It is a bit of a wart, to have a Jython-specific type here: somewhat defeating 
the object of using the same source. I expect there was a good reason: perhaps 
there was no better way to express the commonality between Interactive and 
Module. It was all before my involvement.

I would try to avoid needing it in Jython 3, and if we can't, it doesn't look 
hard to manage the variation our copy. It's not like we copy these files 
mechanically from from CPython during a build.

+1 on removing it.

--
nosy: +jeff.allen

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



[issue34079] Multiprocessing module fails to build on Solaris 11.3

2020-11-30 Thread Clint Allen


Clint Allen  added the comment:

I don't see anything further needed with this issue.  Closing it is fine with 
me.

--
status: pending -> open

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



[issue25478] Consider adding a normalize() method to collections.Counter()

2020-12-20 Thread Allen Downey


Allen Downey  added the comment:

This API would work well for my use cases.

And looking back at previous comments in this thread, I think this proposal 
avoids the most objectionable pitfalls.

--
nosy: +AllenDowney

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



[issue34079] Multiprocessing module fails to build on Solaris 11.3

2018-12-09 Thread Clint Allen


Clint Allen  added the comment:

Agreed, that is a better approach.
I have tested your patch successfully with gcc on Solaris 11.3.

--

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



[issue33061] NoReturn missing from __all__ in typing.py

2018-03-12 Thread Allen Tracht

Change by Allen Tracht :


--
components: Library (Lib)
nosy: Allen Tracht
priority: normal
severity: normal
status: open
title: NoReturn missing from __all__ in typing.py
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

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



[issue31689] random.choices does not work with negative weights

2017-10-04 Thread Allen Riddell

New submission from Allen Riddell :

Code to reproduce problem:

population = list(range(10))
weights = list(-1 * w for w in range(10))
[random.choices(population, weights) for _ in range(1000)]

will raise IndexError:

358 bisect = _bisect.bisect
359 total = cum_weights[-1]
--> 360 return [population[bisect(cum_weights, random() * total)] for i 
in range(k)]
361 
362 ##  real-valued distributions  ---

IndexError: list index out of range

--
components: Library (Lib)
messages: 303683
nosy: ariddell
priority: normal
severity: normal
status: open
title: random.choices does not work with negative weights
versions: Python 3.6

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



[issue31689] random.choices does not work with negative weights

2017-10-04 Thread Allen Riddell

Allen Riddell  added the comment:

Upon some reflection, I think raising a ValueError is the right thing to do. 
Negative weights don't have an obvious interpretation.

--

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



[issue31749] Request: Human readable byte amounts in the standard library

2017-10-10 Thread Timothy Allen

Timothy Allen  added the comment:

This would be a benefit to my team, for sure. I can't even tell you how many 
different solutions we currently use to make file sizes human readable - at 
least three.

--
nosy: +FlipperPA

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



[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD

2017-10-17 Thread Jeff Allen

Change by Jeff Allen :


--
nosy: +jeff.allen

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



[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2017-10-19 Thread Allen Li

New submission from Allen Li :

It would be useful to document that urllib.parse.{Defrag,Split,Parse}Result are 
namedtuples, and make that API officially public if it was not otherwise.

These classes are implemented as namedtuples in Python 2 and 3, and I am not 
aware of a reason that that would need to change in the future.

In particular, the namedtuple _replace() method is very useful for modifying 
parts of a URL, a common use case.

 u = urllib.parse.urlsplit(some_url)
 u = u._replace(netloc=other_netloc)
 urllib.parse.urlunsplit(u)

 # Alternatives not depending on namedtuple API
 parts = list(u)
 parts[1] = other_netloc  # Using a magic index
 urllib.parse.urlunsplit(u)

 u = urllib.parse.SplitResult(  # Very ugly
 scheme=u.scheme,
 netloc=other_netloc,
 path=u.path,
 query=u.query,
 fragment=u.fragment)

--
assignee: docs@python
components: Documentation
messages: 304637
nosy: Allen Li, docs@python
priority: normal
severity: normal
status: open
title: Document that urllib.parse.{Defrag,Split,Parse}Result are namedtuples
type: enhancement
versions: Python 2.7, Python 3.6

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



[issue31843] sqlite3.connect() should accept PathLike objects

2017-10-22 Thread Allen Li

Change by Allen Li :


--
type:  -> enhancement

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



[issue31843] sqlite3.connect() should accept PathLike objects

2017-10-22 Thread Allen Li

New submission from Allen Li :

sqlite3.connect() should accept PathLike objects (objects that implement 
__fspath__)

--
messages: 304773
nosy: Allen Li
priority: normal
severity: normal
status: open
title: sqlite3.connect() should accept PathLike objects
versions: Python 3.6

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



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2017-12-02 Thread Allen Li

Change by Allen Li :


--
nosy: +Allen Li

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



[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2017-12-12 Thread Allen Li

New submission from Allen Li :

mock.patch.dict.__enter__ should return the patched dict/mapping object.

Currently it returns nothing (None).

This would make setting up fixtures more convenient:

 with mock.patch.dict(some.thing):
   some.thing['foo'] = 'bar'

 with mock.patch.dict(some.thing) as x:
   x['foo'] = 'bar'

--
components: Library (Lib)
messages: 308188
nosy: Allen Li
priority: normal
severity: normal
status: open
title: unittest.mock.patch.dict.__enter__ should return the dict
versions: Python 3.6, Python 3.7, Python 3.8

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



[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2017-12-12 Thread Allen Li

Change by Allen Li :


--
type:  -> enhancement

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



[issue25478] Consider adding a normalize() method to collections.Counter()

2018-05-17 Thread Allen Downey

Allen Downey  added the comment:

I'd like to second Raymond's suggestion.  With just a few additional methods, 
you could support a useful set of operations.  One possible API:

def scaled(self, factor)
"""Returns a new Counter with all values multiplied by factor."""

def normalized(self, total=1)
"""Returns a new Counter with values normalized so their sum is total."""

def total(self)
"""Returns the sum of the values in the Counter."""

These operations would make it easier to use a Counter as a PMF without 
subclassing.

I understand two arguments against this proposal

1) If you modify the Counter after normalizing, the result is probably nonsense.

That's true, but it is already the case that some Counter methods don't make 
sense for some use cases, depending on how you are using the Counter (as a bag, 
multiset, etc)

So the new features would come with caveats, but I don't think that's fatal.

2) PMF operations are not general enough for core Python; they should be in a 
stats module.

I think PMFs are used (or would be used) for lots of quick computations that 
don't require full-fledged stats.

Also, stats libraries tend to focus on analytic distributions; they don't 
really provide this kind of light-weight empirical PMF.

I think the proposed features have a high ratio of usefulness to implementation 
effort, without expanding the API unacceptably.


Two thoughts for alternatives/extensions:

1) It might be good to make scaled() available as __mul__, as Peter Norvig 
suggests.

2) If the argument of scaled() is a mapping type, it might be good to support 
elementwise scaling.  That would provide an elegant implementation of Raymond's 
chi-squared example and my inspection paradox example 
(http://greenteapress.com/thinkstats2/html/thinkstats2004.html#sec33)

Thank you!
Allen

--
nosy: +Allen Downey

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



[issue34079] Multiprocessing module fails to build on Solaris 11.3

2018-07-10 Thread Clint Allen


New submission from Clint Allen :

The build of this module fails with this error:


In file included from /usr/include/limits.h:12:0,
 from 
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/limits.h:168,
 from 
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/syslimits.h:7,
 from 
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/limits.h:34,
 from Include/Python.h:19,
 from 
/opt/apps/salt-build/Python-2.7.15/Modules/_multiprocessing/multiprocessing.h:12,
 from 
/opt/apps/salt-build/Python-2.7.15/Modules/_multiprocessing/multiprocessing.c:9:
/usr/gcc/5/lib/gcc/sparcv9-sun-solaris2.11/5.4.0/include-fixed/sys/feature_tests.h:363:2:
 error: #error "Compiler or options invalid for pre-UNIX 03 X/Open applications 
   and pre-2001 POSIX applications"


Changing the value of _XOPEN_SOURCE from 500 to 600 in 
Modules/_multiprocessing/multiprocessing.h fixes it.

--
components: Extension Modules
messages: 321364
nosy: clallen
priority: normal
severity: normal
status: open
title: Multiprocessing module fails to build on Solaris 11.3
type: compile error
versions: Python 2.7

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



[issue34079] Multiprocessing module fails to build on Solaris 11.3

2018-07-10 Thread Clint Allen


Change by Clint Allen :


--
keywords: +patch
Added file: 
https://bugs.python.org/file47680/Python-2.7.15-Modules_multiprocessing_h.patch

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



[issue21700] Missing mention of DatagramProtocol having connection_made and connection_lost methods

2014-06-09 Thread Allen Riddell

New submission from Allen Riddell:

The following important information from PEP 3156 does not appear in the 
asyncio library documentation:

"""Datagram protocols have connection_made() and connection_lost() methods with 
the same signatures as stream protocols."""

Indeed, reading the docs it looks like only ``Protocol`` and 
``SubprocessProtocol`` have these methods. (See 
https://docs.python.org/3.4/library/asyncio-protocol.html#connection-callbacks)

The quick fix is to change the lines 275-276 in 
``Doc/library/asyncio-protocol.rst`` from:

These callbacks may be called on Protocol and SubprocessProtocol instances:

to

These callbacks may be called on Protocol, DatagramProtocol, and 
SubprocessProtocol instances:

--
assignee: docs@python
components: Documentation, asyncio
messages: 220130
nosy: ariddell, docs@python, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: Missing mention of DatagramProtocol having connection_made and 
connection_lost methods
type: enhancement
versions: Python 3.4, Python 3.5

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



[issue21701] create_datagram_endpoint does not receive when both local_addr and remote_addr provided

2014-06-09 Thread Allen Riddell

New submission from Allen Riddell:

Creating a UDP connection through ``create_datagram_endpoint`` when specifying 
both remote_addr and local_addr does not work; messages are not received. If 
remote_addr is removed, messages are received.

Easy to reproduce:

works: python3 client_good.py & python3 sender.py 127.0.0.1 
blocks?: python3 client_bad.py & python3 sender.py 127.0.0.1 

>From the PEP I gather this really is a bug, since create_datagram_endpoint is 
>supposed to be bidirectional::

create_datagram_endpoint(protocol_factory, local_addr=None, 
remote_addr=None, ). Creates an endpoint for sending and receiving 
datagrams (typically UDP packets). Because of the nature of datagram traffic, 
there are no separate calls to set up client and server side, since usually a 
single endpoint acts as both client and server.

--
components: asyncio
messages: 220134
nosy: ariddell, gvanrossum, haypo, yselivanov
priority: normal
severity: normal
status: open
title: create_datagram_endpoint does not receive when both local_addr and 
remote_addr provided
type: behavior
versions: Python 3.4, Python 3.5

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



[issue21701] create_datagram_endpoint does not receive when both local_addr and remote_addr provided

2014-06-09 Thread Allen Riddell

Allen Riddell added the comment:

(couldn't figure out how to attach multiple files)
-- client_good.py --

"""Send and receive a messages using DatagramProtocol"""
import asyncio
import time

class Helloer(asyncio.DatagramProtocol):

def connection_made(self, transport):
print('(helloer) connection made')
self.transport = transport

def connection_lost(self, transport):
print('(helloer listener) connection lost!')

def datagram_received(self, data, addr):
print('(helloer listener) received data from {}: {}'.format(addr, data))

def error_received(self, exc):
print('(helloer listener) error received: {}'.format(exc))

loop = asyncio.get_event_loop()
# WORKS:
coro = loop.create_datagram_endpoint(Helloer, local_addr=('127.0.0.1', ))
# FAILS (blocks?):
# coro = loop.create_datagram_endpoint(Helloer, local_addr=('127.0.0.1', ), 
remote_addr=('127.0.0.1', ))
transport, protocol = loop.run_until_complete(coro)
loop.run_forever()


-- client_bad.py --

"""Send and receive a messages using DatagramProtocol"""
import asyncio
import time

class Helloer(asyncio.DatagramProtocol):

def connection_made(self, transport):
print('(helloer) connection made')
self.transport = transport

def connection_lost(self, transport):
print('(helloer listener) connection lost!')

def datagram_received(self, data, addr):
print('(helloer listener) received data from {}: {}'.format(addr, data))

def error_received(self, exc):
print('(helloer listener) error received: {}'.format(exc))

loop = asyncio.get_event_loop()
# WORKS:
# coro = loop.create_datagram_endpoint(Helloer, local_addr=('127.0.0.1', ))
# FAILS (blocks?):
coro = loop.create_datagram_endpoint(Helloer, local_addr=('127.0.0.1', ), 
remote_addr=('127.0.0.1', ))
transport, protocol = loop.run_until_complete(coro)
loop.run_forever()


-- sender.py --
"""Send a UDP packet to a specified port and quit"""
import argparse
import socket
import time

if __name__ == "__main__":
parser = argparse.ArgumentParser(description='send a udp packet')
parser.add_argument('host', type=str)
parser.add_argument('port', type=int)
args = parser.parse_args()
host, port = args.host, args.port

time.sleep(0.1)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
data = 'message from sender sent to {}:{}'.format(host, port)
sent = sock.sendto(data.encode('ascii'), (host, port))
print("(sender) sent udp packet to {}:{}".format(host, port))
sock.close()

--
Added file: http://bugs.python.org/file35547/client_bad.py

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



[issue21701] create_datagram_endpoint does not receive when both local_addr and remote_addr provided

2014-06-09 Thread Allen Riddell

Allen Riddell added the comment:

I gather this is the desired behavior.

If one specifies remote_addr then one only accepts packets from that address 
and port. Whereas if no remote_addr is given then one accepts packets from any 
address and any port.

Sorry for the noise.

--
resolution:  -> not a bug
status: open -> closed

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



[issue20155] Regression test test_httpservers fails, hangs on Windows

2014-06-29 Thread Jeff Allen

Jeff Allen added the comment:

Disabling the AV/firewall did not stop the symptoms when I was investigating 
originally. In order to get the unmodified test to pass, I had to stop the BFE 
(base filtering engine), which I think may have been given new rules or 
behaviours as a result of installing the AV solution ... or maybe it was a 
Windows upgrade that did it.

I did wonder if this might be a moving target, as the test deliberately 
includes server abuse, while the products want to stop that.

If I try test_httpservers.py as amended 
(http://hg.python.org/cpython/file/ffdd2d0b0049/Lib/test/test_httpservers.py) 
on my machine with CPython 3.4.1, I do not get the error Terry reports. 
(test_urlquote_decoding_in_cgi_check fails but it should.)

--

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



[issue20155] Regression test test_httpservers fails, hangs on Windows

2014-01-06 Thread Jeff Allen

New submission from Jeff Allen:

When I run:
start python -m test.test_httpservers

test_request_line_trimming reports ERROR, and the test hangs at 
test_version_none. If I run a copy of the test in which the latter test is 
skipped with @unittest.skipIf(sys.platform == "win32", "..."), the error report 
is:

==
ERROR: test_request_line_trimming (__main__.BaseHTTPServerTestCase)
--
Traceback (most recent call last):
  File "test_httpservers.py", line 122, in test_request_line_trimming
res = self.con.getresponse()
  File "C:\Python33\lib\http\client.py", line 1131, in getresponse
response.begin()
  File "C:\Python33\lib\http\client.py", line 354, in begin
version, status, reason = self._read_status()
  File "C:\Python33\lib\http\client.py", line 316, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python33\lib\socket.py", line 297, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [WinError 10054] An existing connection was forcibly 
closed by the remote host

This is essentially the same for Python 2.7.6 and for the current development 
tip of Jython 2.7b1+, which is actually where the problem first manifested.

My machine is running 64-bit Windows 7 SP1, recently re-installed to a new, 
empty disk.

Careful testing, elaborating the failing tests, shows that what is sent in PUT 
and GET operations is not quite what is received. Something tampers with the 
connection between the client and the server. (Identical traffic where the 
verbs are not PUT and GET arrives as sent.) Something fiddles with the forward 
message, for example "correcting" the spurious \n in test_request_line_trimming 
to a full \r\n, and holding back the payload of a PUT even when it was in the 
first packet. On the reverse path, it appears to act on the error response 
itself by closing the connection, without passing it to the client.

Disabling the firewall (Windows Firewall and a commercial one), with the 
network cable unplugged, makes no difference. Nor does stopping anti-virus, 
anti-phishing, parental controls, etc.. However, stopping the Windows Basic 
Filtering Engine (BFE), makes the regression test run without error. Stopping 
the BFE takes out several dependent services, including Windows Firewall, but 
it seems likely the BFE itself is the culprit.

Although the cause lies in the platform, not in Python, it seems to me still an 
"issue" for Python that the tests fail on a common platform practically out of 
the box. I'll work on this in the context of the Jython test and report back 
here.

--
components: Library (Lib), Windows
messages: 207497
nosy: jeff.allen
priority: normal
severity: normal
status: open
title: Regression test test_httpservers fails, hangs on Windows
versions: Python 2.7, Python 3.3

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



[issue20155] Regression test test_httpservers fails, hangs on Windows

2014-02-23 Thread Jeff Allen

Jeff Allen added the comment:

Thanks for adding to the evidence here. As discussed above, disabling the 
security product (which is Bitdefender) on my PC didn't stop the problem for 
me, and I'm reluctant to uninstall. I narrowed it to the Windows Base Filtering 
Engine, but perhaps the behaviour of the BFE is extended by installing BD.

If so, you could say this is not a Python problem, it is caused by BD 
"normalising" the HTTP. Or BD could say it is caused by expecting a defined 
result from abnormal HTTP.

I took the view it were best fixed at our end. I found I could test the same 
thing (AFAICT), but modify the tests so they don't get interfered with.
http://bugs.jython.org/issue2109
http://hg.python.org/jython/rev/6441fcfd940b

Would a patch made from this be applicable to CPython?

--

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



[issue20155] Regression test test_httpservers fails, hangs on Windows

2014-02-23 Thread Jeff Allen

Jeff Allen added the comment:

Actual patch for your convenience. I'm not set up to build CPython from source, 
so I've tested this with my installed CPython 2.7.6, and it's clean.

[As for keeping the tests in sync, yes that's our aim. Jython's Lib contains 
only the customised versions, and everything else comes from a copy of 
CPython's in lib-python/2.7. I'm always looking for a chance to delete one 
(i.e. use the common file).]

--
keywords: +patch
nosy: +fwierzbicki
Added file: http://bugs.python.org/file34202/issue20155_py.patch

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



[issue20155] Regression test test_httpservers fails, hangs on Windows

2014-03-04 Thread Jeff Allen

Jeff Allen added the comment:

I worked out that the essence of the test is to insert an extra \n at the end 
of a GET request line. The request is syntactically invalid for HTTP. The 
\n\r\n appears like two blank lines, implying no headers, but the headers then 
follow where no data should be. The server is supposed to respond with status 
501, because it does not, in fact, define a GET operation.

To find the replacement test plausible you have to accept that, with a server 
that doesn't define GET, the verb may as well be XYZBOGUS. Since the security 
filter doesn't understand that verb either (unlike GET), it doesn't interfere 
in the test.

--

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



[issue5511] zipfile - add __exit__ attribute to make ZipFile object compatible with with_statement

2009-03-18 Thread J.R. Allen

New submission from J.R. Allen :

Currently the zipfile.ZipFile class has no __exit__ atribute, so it 
does not work with a with statement as other file objects do.  Can this 
be implemented?

--
components: Library (Lib)
messages: 83768
nosy: petruchio
severity: normal
status: open
title: zipfile - add __exit__ attribute to make ZipFile object compatible with 
with_statement
type: feature request
versions: Python 2.6

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



[issue29463] Add `docstring` attribute to AST nodes

2017-02-11 Thread Jeff Allen

Jeff Allen added the comment:

Just terminology ... strictly speaking what you've done here is "add a *field* 
to the nodes Module, FunctionDef and ClassDef", rather than add an *attribute* 
-- that is, when one is consistent with the terms used in the ast module 
(https://docs.python.org/3/library/ast.html#node-classes) or Wang 
(https://docs.python.org/devguide/compiler.html#wang97).

--
nosy: +jeff.allen

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



[issue27427] Add new math module tests

2016-07-10 Thread Jeff Allen

Jeff Allen added the comment:

It would be nice to see this considered alongside #26040.

--
nosy: +jeff.allen

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



[issue26040] Improve coverage and rigour of test.test_math

2016-08-27 Thread Jeff Allen

Jeff Allen added the comment:

Mark: Thanks for validating the additional cases so carefully.

If you still want to apply it in stages then I suppose the change to the 
comparison logic could go first (untested idea), although that's also where I 
could most easily have made a mistake.

--

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



[issue26040] Improve coverage and rigour of test.test_math

2016-08-29 Thread Jeff Allen

Jeff Allen added the comment:

Mark: Thanks for doing my homework. Points 1 and 3 I can readily agree with. I 
must take another look at to_ulps() with your patch on locally. I used the 
approach I did because I thought it was incorrect in exactly those corners 
where you prefer it. I'll take a closer look.

--

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



[issue26040] Improve coverage and rigour of test.test_math

2016-08-29 Thread Jeff Allen

Jeff Allen added the comment:

Ah, cunning: I can make sense of it in hex.

>>> hex(to_ulps(expected))
'0x3ff0'
>>> hex(to_ulps(got))
'0x3fec'
>>> hex( to_ulps(got) - to_ulps(expected) )
'-0x4'

... and what you've done with ulp then follows.

In my version a format like "{:d} ulps" was a bad idea when the error was a 
gross one, but your to_ulps is only piece-wise linear -- large differences are 
compressed.

I'm pleased my work has mostly survived: here's hoping the house build-bots 
agree. erfc() is perhaps the last worry, but math & cmath  pass on my machine.

--

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



[issue17697] Incorrect stacktrace from pdb

2013-04-11 Thread Don Allen

New submission from Don Allen:

Give the attached file execute permission and run it. At the first breakpoint, 
the backtrace will be correct. Continue. At the second breakpoint, a backtrace 
will show the foo('first call') on the stack when, in fact, the call came from 
foo('second call'), as verified by the printed message.

I am running this on an up-to-date 64-bit Arch Linux system. Python 3.3.1.

--
components: Library (Lib)
files: python_bug.py
messages: 186561
nosy: donaldcallen
priority: normal
severity: normal
status: open
title: Incorrect stacktrace from pdb
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file29777/python_bug.py

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



[issue25872] multithreading traceback KeyError when modifying file

2015-12-15 Thread Michael Allen

New submission from Michael Allen:

Modifying a file while getting a stacktrace across multiple threads causes 
linecache's cache to bust and del to be called on the global cache variable. 
This is not thread safe and raises a KeyError.

Reproducible with,

import threading
import traceback

def main():
with open(__file__, 'a') as fp:
fp.write(' ')
traceback.format_stack()

threads = [
threading.Thread(target=main)
for i in range(100)
]
map(lambda t: t.start(), threads)
map(lambda t: t.join(), threads)

I see the following error,

Exception in thread Thread-56:
Traceback (most recent call last):
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 810, 
in __bootstrap_inner
self.run()
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/threading.py", line 763, 
in run
self.__target(*self.__args, **self.__kwargs)
  File "test.py", line 7, in main
traceback.format_stack()
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/traceback.py", line 279, 
in format_stack
return format_list(extract_stack(f, limit))
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/traceback.py", line 305, 
in extract_stack
linecache.checkcache(filename)
  File "/Users/me/.pyenv/versions/2.7.10/lib/python2.7/linecache.py", line 69, 
in checkcache
del cache[filename]
KeyError: 'test.py'

Possible solution is to ignore KeyError on del cache[filename].

--
components: Library (Lib)
messages: 256469
nosy: Michael Allen
priority: normal
severity: normal
status: open
title: multithreading traceback KeyError when modifying file
type: crash
versions: Python 2.7

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




[issue22121] IDLE should start with HOME as the initial working directory

2016-01-31 Thread Jeff Allen

Jeff Allen added the comment:

I'm also interested in a smooth experience for beginners.

I have a factual observation with respect to Terry's comment:
'''Windows icons have a Shortcut tab with a Start-in field.  We should like to 
put %USERPROFILE% there, but this does not work -- msg253393.'''
... I note that several menu shortcuts have "Start in" set to 
%HOMEDRIVE%%HOMEPATH%. Examples are notepad, Internet Explorer and the command 
prompt. (This is on Win7x64.) What we want seems to be a normal thing to do, 
and achieved by some, but perhaps by a post installation script.

Alternatively, once a .py file exists where you want to work, right-click "Edit 
with IDLE" provides the CWD we'd like best. Idea: add a New >> Python File 
context menu item. Encourage users to create a new file that way, then open it, 
and everything from there is smooth. (New issue if liked.)

--
nosy: +jeff.allen

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-14 Thread Jeff Allen

Jeff Allen added the comment:

Here is a patch that improves coverage and addresses the uneven accuracy. 
Required accuracy is now specified in ulps. Mostly, I have choses 1 ulp, since 
this passed for me on an x86 architecture (and also ARM), but this may be too 
ambitious.

I have also responded to the comment relating to erfc:
# XXX Would be better to weaken this test only
# for large x, instead of for all x."

I found I could not contribute the code I used to generate the additional test 
cases in Tools/scripts without failing test_tools. (It complained of a missing 
dependency. The generator uses mpmath.)

--
keywords: +patch
Added file: http://bugs.python.org/file42166/iss26040.patch

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-18 Thread Jeff Allen

Changes by Jeff Allen :


Added file: http://bugs.python.org/file42190/stat_math.py

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Jeff Allen added the comment:

Thanks for the prompt acknowledgement and for accepting this to review.

I have updated the coverage & tolerance demo program. Usage in the comments (in 
v3).

I have also added the program I used to generate the extra test cases (needs 
mpmath -- easier to get working than mpf in the original Windows/Jython 
environment).

--

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Removed file: http://bugs.python.org/file41526/stat_math.py

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Added file: http://bugs.python.org/file42192/stat_math.py

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Removed file: http://bugs.python.org/file42190/stat_math.py

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



[issue26040] Improve coverage and rigour of test.test_math

2016-03-19 Thread Jeff Allen

Changes by Jeff Allen :


Added file: http://bugs.python.org/file42191/extra_cmath_testcases.py

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



[issue13273] HTMLParser improperly handling open tags when strict is False

2011-10-27 Thread Christopher Allen-Poole

New submission from Christopher Allen-Poole :

This is is encountered when extending html.parser.HTMLParser and running with 
strict mode False.

Expected behavior:
When '''The rain  in 
Spain''' is passed to the feed method, div, b, a, br, 
and span should all be passed to the handle_starttag method.

Actual behavior
The handle_data method receives the values  in addition to the regular text.

This can be fixed by changing this (inside the parse_starttag method):

m = hparse.attrfind_tolerant.search(rawdata, k)

to

m = hparse.attrfind_tolerant.match(rawdata, k)

--
components: Library (Lib)
messages: 146479
nosy: Christopher.Allen-Poole
priority: normal
severity: normal
status: open
title: HTMLParser improperly handling open tags when strict is False
type: behavior
versions: Python 3.2

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



[issue7901] Add Vista/7 symlink support

2010-02-10 Thread Robert Paul Allen

New submission from Robert Paul Allen :

I would like to see support for NTFS symbolic links to be added to the os 
module. As simple Popen('mklink') implementation could be used. Any other ideas?

--
components: Library (Lib), Windows
messages: 99170
nosy: ipatrol
severity: normal
status: open
title: Add Vista/7  symlink support
type: feature request

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



[issue28826] Programming with Python 3.6

2016-11-28 Thread Allen David Frankel

New submission from Allen David Frankel:

On the Python Tutorial for beginners, the Python 3.6 gives me a syntax error 
with strings and does not respond to print and/or nothing comes up.

--
components: Demos and Tools
messages: 281921
nosy: ADFGUR
priority: normal
severity: normal
status: open
title: Programming with Python 3.6
type: performance
versions: Python 3.6

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