[issue22628] Idle: Tree lines are spaced too close together.

2022-03-18 Thread Jean-Paul Calderone


Jean-Paul Calderone  added the comment:

This is still/again broken, probably because the "fixed" version still 
hard-codes all of the geometry values and these will certainly not be correct 
for all combinations of display dpi, font configuration, etc.

Instead, `TreeNode.draw` and `TreeNode.drawtext` (at least) need to consider 
the size of the children and space them accordingly.

--
nosy: +exarkun
resolution: fixed -> 
status: closed -> open

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



[issue34602] python3 resource.setrlimit strange behaviour under macOS

2022-01-05 Thread Jean-Paul Calderone


Jean-Paul Calderone  added the comment:

My understanding of the resolution of this ticket is that it is still not 
possible to use setrlimit with RLIMIT_STACK to raise the soft stack limit.  Is 
that correct?

In that case, the original bug report still seems valid and unresolved (and 
indeed, I am porting a project from Python 2.7 to Python 3.9 and on macOS it 
fails because it cannot raise the stack limit).

--
nosy: +exarkun

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



Tahoe-LAFS on Python 3 - Call for Porters

2019-09-24 Thread Jean-Paul Calderone
Hello Pythonistas,


Earlier this year a number of Tahoe-LAFS
 community members began an effort
to port Tahoe-LAFS from Python 2 to Python 3.  Around five people are
currently involved in a part-time capacity.  We wish to accelerate the
effort to ensure a Python 3-compatible release of Tahoe-LAFS can be made
before the end of upstream support for CPython 2.x.


Tahoe-LAFS is a Free and Open system for private, secure, decentralized
storage.  It encrypts and distributes your data across multiple servers.
If some of the servers fail or are taken over by an attacker, the entire
file store continues to function correctly, preserving your privacy and
security.


Foolscap , a dependency of Tahoe-LAFS,
is also being ported.  Foolscap is an object-capability-based RPC protocol
with flexible serialization.


Some details of the porting effort are available in a milestone on the
Tahoe-LAFS trac instance
.


For this help, we are hoping to find a person/people with significant prior
Python 3 porting experience and, preferably, some familiarity with Twisted,
though in general the Tahoe-LAFS project welcomes contributors of all
backgrounds and skill levels.


We would prefer someone to start with us as soon as possible and no later
than October 15th. If you are interested in this opportunity, please send
us any questions you have, as well as details of your availability and any
related work you have done previously (GitHub, LinkedIn links, etc). If you
would like to find out more about this opportunity, please contact us at
jessielisbetfrance at gmail (dot) com or on IRC in #tahoe-lafs on Freenode.

Jean-Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] txkube 0.3.0

2018-08-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce a new release of txkube, a Twisted-based library
for interacting with Kubernetes using the HTTP API.  The big news for this
release is support for Python 3.6.  Also included is support for multiple
configuration files in the KUBECONFIG environment variable which allows for
better configuration management practices.

Here is an example of txkube usage, taken from the README:

   from __future__ import print_function
   from twisted.internet.task import react

   from txkube import network_kubernetes_from_context

   @react
   def main(reactor):
   k8s = network_kubernetes_from_context(reactor, u"minikube")
   d = k8s.versioned_client()
   d.addCallback(
   lambda client: client.list(client.model.v1.Namespace)
   )
   d.addCallback(print)
   return d

You can download txkube from PyPI <https://pypi.python.org/pypi>
You can contribute to its development on GitHub
<https://github.com/LeastAuthority/txkube>.

Thanks to Least Authority TFA GmbH <https://leastauthority.com/> for
sponsoring this development and to Craig Rodrigues for his efforts on
Python 3 porting work.

Jean-Paul Calderone
<https://as.ynchrono.us/>
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[ANN] txkube 0.3.0

2018-08-08 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce a new release of txkube, a Twisted-based library
for interacting with Kubernetes using the HTTP API.  The big news for this
release is support for Python 3.6.  Also included is support for multiple
configuration files in the KUBECONFIG environment variable which allows for
better configuration management practices.

Here is an example of txkube usage, taken from the README:

   from __future__ import print_function
   from twisted.internet.task import react

   from txkube import network_kubernetes_from_context

   @react
   def main(reactor):
   k8s = network_kubernetes_from_context(reactor, u"minikube")
   d = k8s.versioned_client()
   d.addCallback(
   lambda client: client.list(client.model.v1.Namespace)
   )
   d.addCallback(print)
   return d

You can download txkube from PyPI <https://pypi.python.org/pypi>
You can contribute to its development on GitHub
<https://github.com/LeastAuthority/txkube>.

Thanks to Least Authority TFA GmbH <https://leastauthority.com/> for
sponsoring this development and to Craig Rodrigues for his efforts on
Python 3 porting work.

Jean-Paul Calderone
<https://as.ynchrono.us/>
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] txaws 0.5.0

2017-12-27 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the release of txAWS 0.5.0.  txAWS is a library for
interacting with Amazon Web Services (AWS) using Twisted.

You can download the release from PyPI .

Since the last release, the following enhancements have been made:

Features
> 
> - txaws.s3.client.S3Client.get_bucket now accepts a ``prefix`` parameter
> for
>   selecting a subset of S3 objects. (#78)
> - txaws.ec2.client.EC2Client now has a ``get_console_output`` method
> binding
>   the ``GetConsoleOutput`` API. (#82)


Thanks to everyone who contributed and to Least Authority TFA GmbH
 for sponsoring my work on this release.

Jean-Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] kubetop 17.4.17.1

2017-04-18 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the initial release of kubetop, a command-line tool
in the style of top(1) for displaying current usage and activity of a
Kubernetes cluster.

kubetop 17.4.17.1 will format information about your Kubernetes cluster
like this:

kubetop - 13:02:57
Node 0 CPU%   9.80 MEM% 57.97 (   2 GiB/   4 GiB)  POD%  7.27 (  8/110) Ready
Node 1 CPU%  21.20 MEM% 59.36 (   2 GiB/   4 GiB)  POD%  3.64 (  4/110) Ready
Node 2 CPU%  99.90 MEM% 58.11 (   2 GiB/   4 GiB)  POD%  7.27 (  8/110) Ready
Pods:   20 total0 running0 terminating0 pending
 POD   (CONTAINER)%CPU MEM   %MEM
s4-infrastructure-3073578190-2k2vw75.5  782.05 MiB  20.76
  (subscription-converger)72.7  459.11 MiB
 (grid-router) 2.7   98.07 MiB
 (web) 0.1   67.61 MiB
(subscription-manager) 0.0   91.62 MiB
   (foolscap-log-gatherer) 0.0   21.98 MiB
   (flapp) 0.0   21.46 MiB
  (wormhole-relay) 0.0   22.19 MiB


kubetop is meant as a handy tool to use at the spur of the moment.  It is
not intended to replace a real monitoring system.

kubetop's presentation is preliminary and a work in progress.
Contributions welcome.

You can find kubetop on PyPI <https://pypi.python.org/pypi/kubetop> and
GitHub <https://github.com/LeastAuthority/kubetop>.  Install it in the
usual way:

pip install kubetop


Thanks to Least Authority Enterprises <https://leastauthority.com/> for
sponsoring this development.

Jean-Paul Calderone
http://as.ynchrono.us/
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[ANN] kubetop 17.4.17.1

2017-04-17 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the initial release of kubetop, a command-line tool
in the style of top(1) for displaying current usage and activity of a
Kubernetes cluster.

kubetop 17.4.17.1 will format information about your Kubernetes cluster
like this:

kubetop - 13:02:57
Node 0 CPU%   9.80 MEM% 57.97 (   2 GiB/   4 GiB)  POD%  7.27 (  8/110) Ready
Node 1 CPU%  21.20 MEM% 59.36 (   2 GiB/   4 GiB)  POD%  3.64 (  4/110) Ready
Node 2 CPU%  99.90 MEM% 58.11 (   2 GiB/   4 GiB)  POD%  7.27 (  8/110) Ready
Pods:   20 total0 running0 terminating0 pending
 POD   (CONTAINER)%CPU MEM   %MEM
s4-infrastructure-3073578190-2k2vw75.5  782.05 MiB  20.76
  (subscription-converger)72.7  459.11 MiB
 (grid-router) 2.7   98.07 MiB
 (web) 0.1   67.61 MiB
(subscription-manager) 0.0   91.62 MiB
   (foolscap-log-gatherer) 0.0   21.98 MiB
   (flapp) 0.0   21.46 MiB
  (wormhole-relay) 0.0   22.19 MiB


kubetop is meant as a handy tool to use at the spur of the moment.  It is
not intended to replace a real monitoring system.

kubetop's presentation is preliminary and a work in progress.
Contributions welcome.

You can find kubetop on PyPI <https://pypi.python.org/pypi/kubetop> and
GitHub <https://github.com/LeastAuthority/kubetop>.  Install it in the
usual way:

pip install kubetop


Thanks to Least Authority Enterprises <https://leastauthority.com/> for
sponsoring this development.

Jean-Paul Calderone
http://as.ynchrono.us/
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] txkube 0.1.0

2017-04-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the first release of txkube, a Twisted-based
library for interacting with Kubernetes using the HTTP API.

This release supports several of the most commonly used basic Kubernetes
objects, including Services, ConfigMaps, Deployments, ReplicaSets, and
Pods.  While Kubernetes has many, many more object kinds, this collection
of kinds already supports a very useful set of interactions.

Here is an example of txkube usage, taken from the README:

   from __future__ import print_function
   from twisted.internet.task import react

   from txkube import v1, network_kubernetes_from_context

   @react
   def main(reactor):
   k8s = network_kubernetes_from_context(reactor, u"minikube")
   client = k8s.client()
   d = client.list(v1.Namespace)
   d.addCallback(print)
   return d

You can download txkube from PyPI <https://pypi.python.org/pypi>.
You can contribute to its development on GitHub
<https://github.com/LeastAuthority/txkube>.

Thanks to Least Authority Enterprises <https://leastauthority.com/> for
sponsoring this development.

Jean-Paul Calderone
http://as.ynchrono.us/
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[ANN] txkube 0.1.0

2017-04-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the first release of txkube, a Twisted-based
library for interacting with Kubernetes using the HTTP API.

This release supports several of the most commonly used basic Kubernetes
objects, including Services, ConfigMaps, Deployments, ReplicaSets, and
Pods.  While Kubernetes has many, many more object kinds, this collection
of kinds already supports a very useful set of interactions.

Here is an example of txkube usage, taken from the README:

   from __future__ import print_function
   from twisted.internet.task import react

   from txkube import v1, network_kubernetes_from_context

   @react
   def main(reactor):
   k8s = network_kubernetes_from_context(reactor, u"minikube")
   client = k8s.client()
   d = client.list(v1.Namespace)
   d.addCallback(print)
   return d

You can download txkube from PyPI <https://pypi.python.org/pypi>.
You can contribute to its development on GitHub
<https://github.com/LeastAuthority/txkube>.

Thanks to Least Authority Enterprises <https://leastauthority.com/> for
sponsoring this development.

Jean-Paul Calderone
http://as.ynchrono.us/
-- 
https://mail.python.org/mailman/listinfo/python-list


[ANN] txAWS 0.3.0

2017-04-10 Thread Jean-Paul Calderone
Hello all,

I'm pleased to announce the release of txAWS 0.3.0.  txAWS is a library for
interacting with
Amazon Web Services (AWS) using Twisted.

You can download the release from PyPI <https://pypi.python.org/pypi/txAWS>
 (https://pypi.python.org/pypi/txAWS).

txAWS development uses GitHub for issues and source control
<https://github.com/twisted/txaws> (https://github.com/twisted/txaws).

Since the last release, the following enhancements have been made:

   - Jean-Paul Calderone added basic Route53 support.
   - Mark Williams add Auth v4, now used by the S3 and Route53 support.
   - Francisco Souza added support for VPCs to some EC2 APIs.
   - Drew Smathers added multi-part S3 upload support.
   - Several people added other S3 client features such as pagination and
   streaming uploads.
   - *txaws.testing* now provides S3 and Route53 support.

Additionally, the following APIs have been deprecated:

   - The *client* attribute of *txaws.client.base.BaseQuery*
   - The *date* attribute of *txaws.s3.client.Query*

Thanks to everyone who contributed and to Least Authority Enterprises
<https://leastauthority.com/> (<https://leastauthority.com/>) for
sponsoring my work on this release.

Jean-Paul Calderone
-- 
https://mail.python.org/mailman/listinfo/python-list


Announcing txAWS 0.2.3.1

2017-01-10 Thread Jean-Paul Calderone
I've just release txAWS 0.2.3.1.  txAWS is a library for interacting with
Amazon Web Services (AWS) using Twisted.

AWSServiceEndpoint's ssl_hostname_verification's parameter now defaults to
True instead of False.  This affects all txAWS APIs which issue requests to
AWS endpoints.  For any application which uses the default
AWSServiceEndpoints, the server's TLS certificate will now be verified.

This resolves a security issue in which txAWS applications were vulnerable
to man-in-the-middle attacks which could either steal sensitive information
or, possibly, alter the AWS operation requested.

The new release is available on PyPI in source and wheel forms.  You can
also find txAWS at its new home on github, .

Special thanks to Least Authority Enterprises
() for
sponsoring the work to find and fix this issue and to publish this new
release.

Jean-Paul
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Announcing txAWS 0.2.3.1

2017-01-09 Thread Jean-Paul Calderone
I've just release txAWS 0.2.3.1.  txAWS is a library for interacting with
Amazon Web Services (AWS) using Twisted.

AWSServiceEndpoint's ssl_hostname_verification's parameter now defaults to
True instead of False.  This affects all txAWS APIs which issue requests to
AWS endpoints.  For any application which uses the default
AWSServiceEndpoints, the server's TLS certificate will now be verified.

This resolves a security issue in which txAWS applications were vulnerable
to man-in-the-middle attacks which could either steal sensitive information
or, possibly, alter the AWS operation requested.

The new release is available on PyPI in source and wheel forms.  You can
also find txAWS at its new home on github, .

Special thanks to Least Authority Enterprises
() for
sponsoring the work to find and fix this issue and to publish this new
release.

Jean-Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2015-04-22 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

It's only been six years, no need to rush.

--
nosy: +Jean-Paul Calderone

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



[issue6731] Add option of non-zero exit status of setup.py when building of extensions has failed

2015-04-22 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -Jean-Paul Calderone, exarkun

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



[issue5305] imaplib should support international mailbox names

2015-04-21 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue21327] socket.type value changes after using settimeout()

2015-04-15 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue18629] future division breaks timedelta division by integer

2015-04-02 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue20718] OpenBSD/AIX: tests passing a file descriptor with sendmsg/recvmsg failures

2015-04-02 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue6555] distutils config file should have the same name on both platforms and all scopes

2015-04-02 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue6377] distutils compiler switch ignored

2015-04-02 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue20669] OpenBSD: socket.recvmsg tests fail with OSError: [Errno 40] Message too long

2015-04-02 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue15945] memoryview + bytes fails

2015-03-24 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@clusterhq.com:


--
nosy:  -exarkun

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



[issue1103213] Adding the missing socket.recvall() method

2015-01-19 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue5305] imaplib should support international mailbox names

2014-10-09 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 the twisted imap API is problematic for imaplib because twisted seems to 
 expect its arguments to already be Python unicode.

Could you elaborate on this?  As far as I can tell, it works fine:

 import twisted.mail.imap4
 print uHello, \N{SNOWMAN}.encode('imap4-utf-7')
Hello, JgM-
 print b'Hello, JgM-'.decode('imap4-utf-7')
Hello, ☃
 

What would you expect to work differently?

--

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



[issue21965] Add support for Memory BIO to _ssl

2014-08-06 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

Please do *not* add me to the nosy list of any issues.

--

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



[issue21965] Add support for Memory BIO to _ssl

2014-08-06 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue12600] Add example of using load_tests to parameterise Test Cases

2014-07-02 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue10721] Remove HTTP 0.9 server support

2014-06-27 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue4887] environment inspection and manipulation API is buggy, inconsistent with Python philosophy for wrapping native APIs

2014-06-17 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

What are the chances a future Python 2.x release will include any fix developed 
for this issue?

--

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



[issue21652] Python 2.7.7 regression in mimetypes module on Windows

2014-06-13 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 That commit was fixing an existing problem; perhaps not your problem, but 
 someone's. To revert it would simply move the pain around.

Doesn't the very same logic apply to the original commit?

 I hope to be able to work on this fairly soon.

Thanks.  Much appreciated.

--

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



[issue9291] mimetypes initialization fails on Windows because of non-Latin characters in registry

2014-06-10 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

Please see http://bugs.python.org/issue21652 for a regression introduced by 
this change.

--
nosy: +exarkun

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



[issue21652] Python 2.7.7 regression in mimetypes module on Windows

2014-06-03 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy: +exarkun

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



[issue2506] Add mechanism to disable optimizations

2014-05-16 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue4999] multiprocessing.Queue does not order objects

2014-05-14 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue4928] Problem with tempfile.NamedTemporaryFile

2014-05-14 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue1218234] inspect.getsource doesn't update when a module is reloaded

2014-05-05 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone jean-p...@hybridcluster.com:


--
nosy:  -exarkun

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



[issue21408] delegation of `!=` to the right-hand side argument is not always done

2014-05-01 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

$ ~/Projects/cpython/3.4/python -c '
class Foo(object):
def __ne__(self, other):
return yup
def __eq__(self, other):
return nope

class Bar(object):
pass

print(object() != Foo(), object() == Foo())
print(Bar() != Foo(), Bar() == Foo())
'
yup nope
False nope
$

The output I would expect from this is

yup nope
yup nope

That is, even when the type of the left-hand argument is not a base class of 
the type of the right-hand argument, delegation to the right-hand argument is 
sensible if the left-hand argument does not implement the comparison.

Note that the output also demonstrates that this is already the behavior for 
`==`.  Only `!=` seems to suffer from this issue.

--
components: Interpreter Core
messages: 217699
nosy: exarkun
priority: normal
severity: normal
status: open
title: delegation of `!=` to the right-hand side argument is not always done
type: behavior
versions: Python 3.3, Python 3.4

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



[issue11798] Test cases not garbage collected after run

2013-08-03 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone exar...@twistedmatrix.com:


--
nosy:  -exarkun

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



[issue18629] future division breaks timedelta division by integer

2013-08-03 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 I think that's a very obscure interpretation of floor division for
timedeltas :-)

Note - I don't care about this.  I just want `timedelta / int` to do the same 
thing in Python 2.7 with __future__.division as `timedelta / int` does in 
Python 3.

Please don't reject this because of some unrelated discussion about how floor 
division should be implemented for timedelta.

--

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



[issue18629] future division breaks timedelta division by integer

2013-08-02 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

datetime.timedelta instances are divisible by integers on Python 2.7, but not 
when __future__.division has been turned on:


exarkun@top:~$ ~/Projects/cpython/2.7/python -c '
from datetime import timedelta
print timedelta(seconds=3) / 2
'
0:00:01.50
exarkun@top:~$ ~/Projects/cpython/2.7/python -c '
from __future__ import division
from datetime import timedelta
print timedelta(seconds=3) / 2
'
Traceback (most recent call last):
  File string, line 4, in module
TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'int'
exarkun@top:~$ ~/Projects/cpython/2.7/python
Python 2.7.5+ (2.7:8205e72b5cfc, Aug  2 2013, 11:12:04) 

This presents a minor barrier to Python 3 transitions, since it prevents the 
use of __future__.division in a module trying to retain Python 2 compatibility 
where timedelta division is used.

--
components: Library (Lib)
messages: 194181
nosy: exarkun
priority: normal
severity: normal
status: open
title: future division breaks timedelta division by integer
type: behavior
versions: Python 2.7

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



[issue18629] future division breaks timedelta division by integer

2013-08-02 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

Hm.  Maybe I am.  Yet isn't true division implemented for this pair of types in 
Python 3?  I'm not sure why it shouldn't be implemented for them in Python 2.

Also that raises another question.  Does a result of one and one half seconds 
make sense as the result of a floor division operation?

--

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



[issue17134] Use Windows' certificate store for CA certs

2013-06-07 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 Sounds promising. Do you think this should be hooked into 
 SSLContext.set_default_verify_paths, or be exposed as a separate method?

If there were an API which exposed the certificate material, then this would be 
more useful to libraries trying to do other things (present debugging 
information, use an alternate SSL implementation *wink*, etc).  If this is 
*only* wrapped up inside set_default_verify_paths then many of these extra 
things are impossible with a seconding binding to the same API.

--
nosy: +exarkun

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



[issue16195] Difficult or impossible to figure out how garbage collector and weak references should interact for user-defined extension types

2012-10-11 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

There appears to be very little, if any, documentation about how to handle the 
list at tp_weaklistoffset for types supporting being weak referenced, 
particularly with respect to garbage collection.

Who owns the list?  Who owns the objects in the list?  Should the list be 
traversed by the extension type's tp_traverse?  Should it ever be INCREF'd or 
DECREF'd?  Does tp_dealloc have any responsibilities with respect to it?

From looking at CPython's own source, it appears that tp_traverse should not 
touch it (Yhg1s confirmed this on #python).  Cython, at least, appears to have 
come to an alternate conclusion though - it generates tp_traverse functions 
which visit the list (and provoke gc assertions to fail on Python 2.7 in debug 
mode).

Some documentation about what is correct to do would be excellent, and would 
make it easier to explain to Cython developers what they're doing wrong (or 
confirm that they're doing something right, in which case there are some more 
bugs to file against the CPython stdlib, since they do something different from 
Cython).

--
assignee: docs@python
components: Documentation
messages: 172639
nosy: docs@python, exarkun
priority: normal
severity: normal
status: open
title: Difficult or impossible to figure out how garbage collector and weak 
references should interact for user-defined extension types

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



[issue3982] support .format for bytes

2012-10-02 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

Since Benjamin originally requested this feature, and then decided that he 
could accomplish his desired goal (ftplib porting, as far as I can tell) 
without it, I think that the rejected status is actually incorrect.  I think 
that Benjamin just wanted to indicate that he no longer needed the feature.  
This doesn't mean that no one else will need the feature, and as it turns out 
the comments seem to reveal that other people do need the feature (also, I need 
the feature).

So, adjusting the ticket metadata to reflect that this is a valid feature 
request just waiting for someone to implement it, not a rejected idea that is 
not welcome in Python.

--
nosy: +exarkun
resolution: rejected - 
status: closed - open

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



[issue3982] support .format for bytes

2012-10-02 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 The price of maintaining exceeds the potential very limited benefits from the 
 use.

The very limited benefits of being able to write I/O code without roughly 3 
times code bloat?  Perhaps for people who don't write code that does 
non-trivial I/O, but for the rest of us the benefits are pretty significant.

 I suspect, but have not verified, that having a bytes version of this code 
 would now require an implementation that shared very little with the str 
 version.

The implementation may be difficult, therefore no one should attempt it?

--

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



[issue3982] support .format for bytes

2012-10-02 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 The development cost and maintenance cost is surely part of the evaluation 
 when deciding whether to implement a feature, no?

Sure, but in an open source project where almost all contributions are done by 
volunteers (ie, donated), what is the development cost?

--

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



[issue15945] memoryview + bytes fails

2012-09-16 Thread Jean-Paul Calderone

Jean-Paul Calderone added the comment:

 What is the expected outcome? memoryviews can't be resized, so
this scenario isn't possible:

The same as `view.tobytes() + bytes`, but without the extra copy implied by 
`view.tobytes()`.

 Just prepend the empty bytestring if you want to make sure the result is a 
 bytes object:

Or I could explicitly convert the memoryview to a bytes object.  That strikes 
me as rather preferable.  However, this defeats one use of memoryview, which is 
to avoid unnecessary copying.  So it might be suitable workaround for some 
cases, but not all.

--

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



[issue15945] memoryview + bytes fails

2012-09-15 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

Python 3.3.0rc2+ (default:9def2209a839, Sep 10 2012, 08:44:51) 
[GCC 4.6.3] on linux
Type help, copyright, credits or license for more information.
 memoryview(b'foo') + b'bar'
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unsupported operand type(s) for +: 'memoryview' and 'bytes'
 b'bar' + memoryview(b'foo')
b'barfoo'


--
messages: 170511
nosy: exarkun
priority: normal
severity: normal
status: open
title: memoryview + bytes fails
type: behavior
versions: Python 3.3

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



[issue15911] Debugging import problems is hard

2012-09-10 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

Debugging problems involving the frozen importlib._bootstrap is difficult, 
because the source for importlib._bootstrap is not available to pdb.  The 
bootstrap code can be stepped through, but with only function names and line 
numbers available, not source lines.

The value of having importlib written in Python would be greatly enhanced if it 
were more like a regular Python module that, eg, pdb could display source lines 
from.

--
components: Interpreter Core, Library (Lib)
messages: 170221
nosy: exarkun
priority: normal
severity: normal
status: open
title: Debugging import problems is hard
versions: Python 3.3

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



[issue15912] Intermittent import failure

2012-09-10 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone:

The attached unit test fails with an ImportError... sometimes.  Here's a little 
blob of shell that seems to make the failure come up more quickly:

while ~/Projects/cpython/3.3/python -m unittest -v test_broken_import; do
rm -rf test_broken_import;
rm -rf __pycache__/;
done

An example of the output when I run it:


exarkun@top:/tmp$ while ~/Projects/cpython/3.3/python -m unittest -v 
test_broken_import_minimal; do rm -rf test_broken_import; rm -rf __pycache__/; 
done
test_renamedSource (test_broken_import_minimal.BrokenTests) ... ok

--
Ran 1 test in 0.004s

OK
test_renamedSource (test_broken_import_minimal.BrokenTests) ... ok

--
Ran 1 test in 0.005s

OK
test_renamedSource (test_broken_import_minimal.BrokenTests) ...  
/tmp/test_broken_import_minimal.py(53)test_renamedSource()
- print(e)
(Pdb) c
No module named 'twisted_renamed_helper'
ERROR

==
ERROR: test_renamedSource (test_broken_import_minimal.BrokenTests)
--
Traceback (most recent call last):
  File ./test_broken_import_minimal.py, line 50, in test_renamedSource
from twisted_renamed_helper import module
ImportError: No module named 'twisted_renamed_helper'

--
Ran 1 test in 0.759s

FAILED (errors=1)

--
components: Interpreter Core
files: test_broken_import_minimal.py
messages: 170225
nosy: exarkun
priority: normal
severity: normal
status: open
title: Intermittent import failure
versions: Python 3.3
Added file: http://bugs.python.org/file27168/test_broken_import_minimal.py

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



Re: Async IO Server with Blocking DB

2012-04-04 Thread Jean-Paul Calderone
On Apr 3, 6:13 pm, looking for lookingforsmart...@gmail.com wrote:
 Hi

 We are thinking about building a webservice server and considering
 python event-driven servers i.e. Gevent/Tornado/ Twisted or some
 combination thereof etc.

 We are having doubts about the db io part. Even with connection
 pooling and cache, there is a strong chance that server will block on
 db. Blocking for even few ms is bad.

 can someone suggest some solutions or is async-io is not at the prime-
 time yet.

 Thanks

Twisted provides support for any DB-API module via
twisted.enteprise.adbapi,
which wraps the module in an asynchronous API (implemented using a
thread pool).

Since the calls all happen in separate threads, it doesn't matter that
they block.

If you're not talking about a SQL database or a DB-API module, maybe
be more
specific about the kind of database I/O you have in mind.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone invalid@example.invalid:


--
resolution:  - fixed
status: open - closed

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-16 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

If it's a bit faster, that'd be a nice win, but I didn't benchmark.  I'm 
primarily interested in correctness in the PyPy case (PyPy re-uses this code), 
and I think CPython benefits from the slightly simplified code as well.

If you do any benchmarks, I'd love to hear the results, though. :)

--

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-15 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone invalid@example.invalid:

Allocating a Python list and a bunch of Capsules for each PyArg_ParseTuple call 
is expensive and unnecessarily complicated.

The freelist never escapes getargs.c (if it ever did, it would be a bug).  The 
same job can be accomplished with a normal C array.

--
assignee: exarkun
messages: 155926
nosy: exarkun
priority: normal
severity: normal
status: open
title: Stop using the garbage collector to manage the lifetime of the getargs.c 
freelist
type: enhancement

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



[issue14325] Stop using the garbage collector to manage the lifetime of the getargs.c freelist

2012-03-15 Thread Jean-Paul Calderone

Changes by Jean-Paul Calderone invalid@example.invalid:


--
keywords: +patch
Added file: http://bugs.python.org/file24873/getargs.patch

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



[issue1531415] parsetok.c emits warnings by writing to stderr

2012-03-11 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

 May somebody check for this? Otherwise the bug could be considered invalid.

This is not the proper workflow for bug tracking.  No one is working on this 
right now is not the same as This bug is invalid.  No one worked on this 
ticket almost *seven years* after I filed it.

The invalid state in the issue tracker is for issues that have been filed 
that *do not describe a bug that exists at all* (or a feature is being rejected 
as a bad idea or something that will otherwise not be added to Python and will 
not be implemented).

Please do not close tickets as invalid just because no one is working on 
resolving them *right now*.  The purpose of closing issues is to keep track of 
useful development that is happening.  In and of itself, closing issues is a 
useless activity; it is only useful inasmuch as it reflects useful development.

--
nosy: +exarkun

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



[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2011-12-08 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone invalid@example.invalid:

When a timezone produces an out-of-bounds utc offset, the resulting exception 
always claims that the offset was 1440, rather than whatever it was.  Example:

from datetime import timedelta, datetime, tzinfo

class X(tzinfo):
def utcoffset(self, time):
return timedelta(days=2)

datetime.now(tz=X())

--
components: Library (Lib)
messages: 149046
nosy: exarkun
priority: normal
severity: normal
status: open
title: When tzinfo.utcoffset is out-of-bounds, the exception message is 
misleading
type: behavior
versions: Python 2.7

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



[issue12944] Accept arbitrary files for packaging's upload command

2011-09-23 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

 pysetup run upload -f dist/spam-0.2.tar.gz -f dist/spam-0.2.exe

I'm not sure why it's run upload instead of just upload, but maybe that's 
the convention in pysetup.  Apart from that, this looks like a vast improvement 
to me.  As far as not supporting globs goes, I guess I don't really care either 
way.  If globs aren't supported, then I'll probably end up globbing somewhere 
else (or constructing the full upload list in some other automated way).  The 
motivation for the complaint is that too many things require manual 
interaction; I'm not going to use a new, easily automated utility manually. :)

--
nosy: +exarkun

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



[issue11657] multiprocessing_{send,recv}fd fail with fds 256

2011-07-28 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

Thanks for the patch Petri.  Are you interested in writing a unit test for this 
as well?

--
nosy: +exarkun

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



Re: Howto Deferred

2011-07-14 Thread Jean-Paul Calderone
On Jul 14, 3:07 am, marco ma...@minasithil.org wrote:
 Hello gals and guys,

 I'm an experienced Python user and I'd like to begin playing with
 Twisted.
 I started RTFM the tutorial advised on the official site and I found it
 really useful and well done.

 Now I'd like to practice a bit by coding a little program that reads
 strings from a serial device and redirects them remotely via TCP. For
 that sake I'm trying to use deferred.


Deferreds probably aren't a good solution for this problem.  They're
useful
for one-time events, but you have an event that repeats over and over
again
with different data.

 In the tutorial, a deferred class is instantiated at factory level, then
 used and destroyed.

 And here things get harder for me.
 Now, in my test program I need to manage data which comes in a random
 manner, and I thought about doing it in a few possible ways:

 1. create a deferred at factory level and every time I read something
 from the serial port add some callbacks:

 class SerToTcpProtocol(Protocol):

   def dataReceived(self, data):
     # deferred is already instantiated and launched
     # self.factory.sendToTcp sends data to the TCP client
     self.factory.deferred.addCallback(self.factory.sendToTcp, data)


Or you could do self.factory.sendToTcp(data)

 2. or, either, create a deferred at protocol level every time I receive
 something, then let the deferred do what I need and destroy it:

 class SerToTcpProtocol(Protocol):

   def dataReceived(self, data):
     d = defer.Deferred()
     d.addCallback(self.factory.sendToTcp, data)
     d.callback(data)


Same here. :)

 3. or again, use a deferred list:

 class SerToTcpProtocol(Protocol):

   def dataReceived(self, data):
     d = defer.Deferred()
     d.addCallback(self.factory.sendToTcp, data)
     self.factory.listDeferred.addCallback(lambda d)
     d.callback(data)


I'm not sure what the listDeferred is there for.

Deferreds are a good abstraction for do one thing and then tell
me what the result was.  You have a different sort of thing here,
where there isn't much of a result (sending to tcp probably always
works until you lose your connection).  A method call works well
for that.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue2506] Line tracing of continue after always-taken if is incorrect

2011-07-13 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

Since the main argument for not fixing this bug seems to be that it doesn't 
affect many users, it seems like I should comment here that the issue is 
affecting me.  A recently proposed addition to Twisted gets bitten by this 
case, resulting in a report of less than full test coverage when in fact the 
tests do exercise every line and branch of the change.

Perhaps it is too hard to add and maintain a no-optimizations feature for 
Python (although I agree with Ned that this would be a useful feature for many 
reasons, not just to fix this bug).  There are other possible solutions to the 
issue of inaccurate coverage reports though.

For example, Python could provide an API for determining which lines have code 
that might be executed.  coverage.py (and the stdlib trace.py) currently use 
the code object's lnotab to decide which lines might be executable.  Maybe that 
should omit continue lines that get jumped over.  If the line will never 
execute, it seems there is no need to have it in the lnotab.

Using the lnotab is something of a hack though, so it might also make sense to 
leave it alone but introduce an API to get the same information, but corrected 
for whatever peephole optimizations the interpreter happens to have.

As far as the not a bug arguments go, I don't think it matters much whether 
you ultimately decide to call it a bug or a feature request.  It *is* clearly a 
useful feature to some people though, and rejecting the requested behavior as 
not a bug doesn't help anyone.  So call it a feature request if that makes it 
more palletable. :)

--
nosy: +exarkun
resolution: wont fix - 
status: closed - open

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



Re: Secure ssl connection with wrap_socket

2011-07-06 Thread Jean-Paul Calderone
On Jul 6, 4:44 am, AndDM anddima...@gmail.com wrote:
 On Jul 5, 4:08 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:



  On Jul 5, 4:52 am, Andrea Di Mario anddima...@gmail.com wrote:

   Hi, I'm a new python user and I'm writing a small web service with ssl.
   I want use a self-signed certificate like in 
   wiki:http://docs.python.org/dev/library/ssl.html#certificates
   I've used wrap_socket, but if i try to use
   cert_reqs=ssl.CERT_REQUIRED, it doesn't work with error:

   urllib2.URLError: urlopen error _ssl.c:326: No root certificates
   specified for verification of other-side certificates.

   It works only with CERT_NONE (the default) but with this option i
   could access to the service in insicure mode.

   Have you some suggestions for my service?

  Also specify some root certificates to use in verifying the peer's
  certificate.  Certificate verification works by proceeding from a
  collection of root certificates which are explicitly trusted.  These
  are used to sign other certificates (which may in turn be used to sign
  others, which in turn...).  The process of certificate verification is
  the process of following the signatures from the certificate in use by
  the server you connect to back up the chain until you reach a root
  which you have either decided to trust or not.  If the signatures are
  all valid and the root is one you trust, then you have established a
  connection to a trusted entity.  If any signature is invalid, or the
  root is not one you trust, then you have not.

  The root certificates are also called the ca certificates or
  certificate authority certificates.  `wrap_socket` accepts a
  `ca_certs` argument.  
  Seehttp://docs.python.org/library/ssl.html#ssl-certificates
  for details about that argument.

  Jean-Paul

 Hi Jean-Paul, i thought that with self-signed certificate i shouldn't
 use ca_certs option. Now, i've created a ca-authority and i use this
 command:

  self.sock = ssl.wrap_socket(sock, certfile = ca/certs/
 myfriend.cert.pem, keyfile = ca/private/myfriend.key.pem,
 ca_certs=/home/andrea/ca/certs/cacert.pem,
 cert_reqs=ssl.CERT_REQUIRED)

 When i use the some machine as client-server it works, but, when i use
 another machine as client, i've this:

 Traceback (most recent call last):
   File loginsender.py, line 48, in module
     handle = url_opener.open('https://debian.andrea.it:10700/%s+%s'%
 (DATA,IPIN))
   File /usr/lib/python2.6/urllib2.py, line 391, in open
     response = self._open(req, data)
   File /usr/lib/python2.6/urllib2.py, line 409, in _open
     '_open', req)
   File /usr/lib/python2.6/urllib2.py, line 369, in _call_chain
     result = func(*args)
   File loginsender.py, line 33, in https_open
     return self.do_open(self.specialized_conn_class, req)
   File /usr/lib/python2.6/urllib2.py, line 1145, in do_open
     raise URLError(err)
 urllib2.URLError: urlopen error [Errno 185090050] _ssl.c:328: error:
 0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

 I see that i should create a certificate with server, client and ca
 autority, but i haven't clear the ca_certs option and which path i
 should use.
 Have you any suggestion?

You need to have the CA certificate on any machine that is going to
verify the certificate used on the SSL connection.  The path just
needs to be the path to that CA certificate on the client machine.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Secure ssl connection with wrap_socket

2011-07-05 Thread Jean-Paul Calderone
On Jul 5, 4:52 am, Andrea Di Mario anddima...@gmail.com wrote:
 Hi, I'm a new python user and I'm writing a small web service with ssl.
 I want use a self-signed certificate like in 
 wiki:http://docs.python.org/dev/library/ssl.html#certificates
 I've used wrap_socket, but if i try to use
 cert_reqs=ssl.CERT_REQUIRED, it doesn't work with error:

 urllib2.URLError: urlopen error _ssl.c:326: No root certificates
 specified for verification of other-side certificates.

 It works only with CERT_NONE (the default) but with this option i
 could access to the service in insicure mode.

 Have you some suggestions for my service?


Also specify some root certificates to use in verifying the peer's
certificate.  Certificate verification works by proceeding from a
collection of root certificates which are explicitly trusted.  These
are used to sign other certificates (which may in turn be used to sign
others, which in turn...).  The process of certificate verification is
the process of following the signatures from the certificate in use by
the server you connect to back up the chain until you reach a root
which you have either decided to trust or not.  If the signatures are
all valid and the root is one you trust, then you have established a
connection to a trusted entity.  If any signature is invalid, or the
root is not one you trust, then you have not.

The root certificates are also called the ca certificates or
certificate authority certificates.  `wrap_socket` accepts a
`ca_certs` argument.  See 
http://docs.python.org/library/ssl.html#ssl-certificates
for details about that argument.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue12443] locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some locales

2011-06-29 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone invalid@example.invalid:

Consider this transcript from OS X 10.6:

 import locale
 locale.getlocale()
(None, None)
 locale.setlocale(locale.LC_ALL, _)
'C'
 locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
'en_US.UTF-8'
 locale.getlocale()
('en_US', 'UTF8')
 locale.setlocale(locale.LC_ALL, _)
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/locale.py,
 line 494, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
 

OS X does not recognize 'en_US.UTF8', only 'en_US.UTF-8'.  However, when passed 
a tuple, the locale module tries to normalize the values.  It ends up turning 
the result of getlocale from ('en_US', 'UTF-8') into 'en_US.UTF8'.

--
assignee: ronaldoussoren
components: Extension Modules, Library (Lib), Macintosh
messages: 139445
nosy: exarkun, ronaldoussoren
priority: normal
severity: normal
status: open
title: locale.setlocale(locale.LC_ALL, locale.getlocale()) fails for some 
locales
type: behavior
versions: Python 2.6, Python 2.7

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



Re: How good is security via hashing

2011-06-07 Thread Jean-Paul Calderone
On Jun 7, 6:18 am, Robin Becker ro...@reportlab.com wrote:
 A python web process is producing files that are given randomized names of 
 the form

 hh-MMDDhhmmss-.pdf

 where rrr.. is a 128bit random number (encoded as base62). The intent of the
 random part is to prevent recipients of one file from being able to guess the
 names of others.

 The process was originally a cgi script which meant each random number was
 produced thusly

 pid is process id, dur is 4 bytes from /dev/urandom.

 random.seed(long(time.time()*someprimeint)|(pid64)|(dur32))
 rrr = random.getrandbits(128)

 is this algorithm safe? Is it safe if the process is switched to fastcgi and 
 the
 initialization is only carried out once and then say 50 rrr values are 
 generated.

How much randomness do you actually have in this scheme?  The PID is
probably difficult
for an attacker to know, but it's allocated roughly monotonically with
a known
wrap-around value.  The time is probably roughly known, so it also
contributes less
than its full bits to the randomness.  Only dur is really
unpredictable.  So you have
something somewhat above 4 bytes of randomness in your seed - perhaps
8 or 10.  That's
much less than even the fairly small 16 bytes of randomness you
expose in the
filename.

The random module is entirely deterministic, so once the seed is known
the value you
produce is known too.

Is 10 bytes enough to thwart your attackers?  Hard to say, what does
an attack look like?

If you want the full 16 bytes of unpredictability, why don't you just
read 16 bytes from
/dev/urandom and forget about all the other stuff?

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How good is security via hashing

2011-06-07 Thread Jean-Paul Calderone
On Jun 7, 7:35 am, Robin Becker ro...@reportlab.com wrote:
 On 07/06/2011 11:26, Nitin Pawar wrote: Have you tried using UUID module?

  Its pretty handy and comes with base64 encoding function which gives
  extremely high quality randon strings

  ref:
 http://stackoverflow.com/questions/621649/python-and-random-keys-of-2...

 ..
 I didn't actually ask for a suitable method for doing this; I assumed that Tim
 Peters' algorithm (at least I think he's behind most of the python random
 support) is pretty good so that the bits produced are indeed fairly good
 approximations to random.

 I guess what I'm asking is whether any sequence that's using random to 
 generate
 random numbers is predictable if enough samples are drawn. In this case 
 assuming
 that fastcgi is being used can I observe a sequence of generated numbers and
 work out the state of the generator. If that is possible then the sequence
 becomes deterministic and such a scheme is useless. If I use cgi then we're
 re-initializing the sequence hopefully using some other unrelated randomness 
 for
 each number.

 Uuid apparently uses machine internals etc etc to try and produce randomness,
 but urandom and similar can block so are probably not entirely suitable.

/dev/urandom does not block, that's the point of it as compared to /
dev/random.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: GIL in alternative implementations

2011-06-07 Thread Jean-Paul Calderone
On Jun 7, 12:03 am, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
 En Sat, 28 May 2011 14:05:16 -0300, Steven D'Aprano  
 steve+comp.lang.pyt...@pearwood.info escribi :









  On Sat, 28 May 2011 09:39:08 -0700, John Nagle wrote:

  Python allows patching code while the code is executing.

  Can you give an example of what you mean by this?

  If I have a function:

  def f(a, b):
      c = a + b
      d = c*3
      return hello world*d

  how would I patch this function while it is executing?

 I think John Nagle was thinking about rebinding names:

 def f(self, a, b):
    while b0:
      b = g(b)
      c = a + b
      d = self.h(c*3)
    return hello world*d

 both g and self.h may change its meaning from one iteration to the next,  
 so a complete name lookup is required at each iteration. This is very  
 useful sometimes, but affects performance a lot.


And even the original example, with only + and * can have side-
effects.  Who knows how a defines __add__?

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sanitizing filename strings across platforms

2011-05-31 Thread Jean-Paul Calderone
On May 31, 10:17 pm, Tim Chase python.l...@tim.thechases.com wrote:
 Scenario: a file-name from potentially untrusted sources may have
 odd filenames that need to be sanitized for the underlying OS.
 On *nix, this generally just means don't use '/' or \x00 in your
 string, while on Win32, there are a host of verboten characters
 and file-names.  Then there's also checking the abspath/normpath
 of the resulting name to make sure it's still in the intended folder.

 I've read through [1] and have started to glom together various
 bits from that thread.  My current course of action is something like

   SACRED_WIN32_FNAMES = set(
     ['CON', 'PRN', 'CLOCK$', 'AUX', 'NUL'] +
     ['LPT%i' % i for i in range(32)] +
     ['CON%i' % i for i in range(32)] +

   def sanitize_filename(fname):
     sane = set(string.letters + string.digits + '-_.[]{}()$')
     results = ''.join(c for c in fname if c in sane)
     # might have to check sans-extension
     if results.upper() in SACRED_WIN32_FNAMES:
       results = _ + results
     return results

 but if somebody already has war-hardened code they'd be willing
 to share, I'd appreciate any thoughts.


There's http://pypi.python.org/pypi/filepath/0.1 (taken from
twisted.python.filepath).

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue12126] incorrect select documentation

2011-05-19 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone invalid@example.invalid:

http://docs.python.org/py3k/howto/sockets.html#non-blocking-sockets

And if you put a socket in more than one input list, it will only be (at most) 
in one output list.


 import socket
 s = socket.socket()
 s.connect(('localhost', 22))
 import select
 select.select([s], [s], [])
([socket._socketobject object at 0xb764333c], [socket._socketobject object 
at 0xb764333c], [])


--
assignee: docs@python
components: Documentation
messages: 136350
nosy: docs@python, exarkun
priority: normal
severity: normal
status: open
title: incorrect select documentation
type: behavior

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



Re: connect SIGINT to custom interrupt handler

2011-05-18 Thread Jean-Paul Calderone
On May 18, 9:28 am, Christoph Scheingraber s...@scheingraber.net
wrote:
 On 2011-05-15, Miki Tebeka miki.teb...@gmail.com wrote:

  Why not just catch KeyboardInterrupt?

 Would it be possible to continue my program as nothing had happened in
 that case (like I did before, setting a flag to tell main() to finish the
 running data download and quit instead of starting the next data download
 {it's a for-loop})?

 I have tried it, but after catching the KeyboardInterrupt I could only
 continue to the next iteration.

No, since the exception being raised represents a different flow of
control
through the program, one that is mutually exclusive with the flow of
control
which would be involved with continuing the processing in the
current
iteration of your loop.

Setting SA_RESTART on SIGINT is probably the right thing to do.  It's
not
totally clear to me from the messages in this thread if you managed to
get
that approach working.  The most commonly encountered problem with
this
approach is that it means that any blocking (eg I/O) operation in
progress
won't be interrupted and you'll have to wait for it to complete
normally.
In this case, it sounds like this is the behavior you actually want,
though.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sockets: bind to external interface

2011-04-25 Thread Jean-Paul Calderone
On Apr 25, 3:49 pm, Chris Angelico ros...@gmail.com wrote:
 On Tue, Apr 26, 2011 at 5:37 AM, Hans Georg Schaathun h...@schaathun.net 
 wrote:

  Has anyone found a simple solution that can be administered without
  root privileges?  I mean simpler than passing the ip address
  manually :-)

 You can run 'ifconfig' without being root, so there must be a way. At
 very worst, parse ifconfig's output.

 The way you talk of the external interface, I'm assuming this
 computer has only one. Is there a reason for not simply binding to
 INADDR_ANY aka 0.0.0.0? Do you specifically need to *not* bind to
 127.0.0.1?

 Chris Angelico

Binding to 0.0.0.0 is usually the right thing to do.  The OP should
probably do that unless he has some particular reason for doing
otherwise.  The comment about the standard solution of binding to
whatever socket.gethostname() returns suggests that perhaps he wasn't
aware that actually the standard solution is to bind to 0.0.0.0.

However, the system stack can usually be tricked into revealing some
more information this way:

 import socket
 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 s.connect(('1.2.3.4', 1234))
 s.getsockname()
('192.168.1.148', 47679)

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: When is PEP necessary?

2011-04-23 Thread Jean-Paul Calderone
On Apr 23, 5:09 pm, Daniel Kluev dan.kl...@gmail.com wrote:
 On Sat, Apr 23, 2011 at 11:16 PM, Disc Magnet discmag...@gmail.com wrote:
  Is PEP necessary to add a new package to the standard library?
  *skip*

 Don't forget that Python is not limited to CPython. Other
 implementations need these PEPs to provide compliant packages.
 While its not that important for pure-python modules, anything tied to
 C-API better be documented, or it becomes a nightmare to keep
 non-CPython version having identical interface.


Unit tests actually serve this purpose much better than do PEPs.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Why doesn't this asyncore.dispatcher.handle_read() get called?

2011-04-20 Thread Jean-Paul Calderone
On Apr 20, 12:25 pm, Dun Peal dunpea...@gmail.com wrote:
 Hi,

 I'm writing and testing an asyncore-based server. Unfortunately, it
 doesn't seem to work. The code below is based on the official docs and
 examples, and starts a listening and sending dispatcher, where the
 sending dispatcher connects and sends a message to the listener - yet
 Handler.handle_read() never gets called, and I'm not sure why. Any
 ideas?

 Thanks, D.

 import asyncore, socket, sys

 COMM_PORT = 9345

 class Handler(asyncore.dispatcher):
     def handle_read(self):
         print 'This never prints'

 class Listener(asyncore.dispatcher):
     def __init__(self, port=COMM_PORT):
         asyncore.dispatcher.__init__(self)
         self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
         self.set_reuse_addr()
         self.bind(('', port))
         self.listen(5)

     def handle_accept(self):
         client, addr = self.accept()
         print 'This prints.'
         return Handler(client)

 class Sender(asyncore.dispatcher):
     def __init__(self, host):
         asyncore.dispatcher.__init__(self)
         self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
         self.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         self.connect( (host, COMM_PORT) )
         self.buffer = 'Msg\r\n'

     def handle_connect(self):
         pass

     def writable(self):
         return len(self.buffer)  0

     def handle_write(self):
         sent = self.send(self.buffer)
         self.buffer = self.buffer[sent:]

 def test_communication():
     from multiprocessing import Process
     def listener():
         l = Listener()
         asyncore.loop(timeout=10, count=1)
     lis = Process(target=listener)
     lis.start()
     def sender():
         s = Sender('localhost')
         asyncore.loop(timeout=10, count=1)
     sen = Process(target=sender)
     sen.start()
     lis.join()

 test_communication()

You didn't let the program run long enough for the later events to
happen.  loop(count=1) basically means one I/O event will be processed
- in the case of your example, that's an accept().  Then asyncore is
done and it never gets to your custom handle_read.

So you can try passing a higher count to loop, or you can add your own
loop around the loop call.  Or you can switch to Twisted which
actually makes testing a lot easier than this - no need to spawn
multiple processes or call accept or recv yourself.  Here's a somewhat
equivalent Twisted-based version of your program:

from twisted.internet.protocol import ServerFactory, Protocol
from twisted.internet import reactor

factory = ServerFactory()
factory.protocol = Protocol

reactor.listenTCP(0, factory)
reactor.run()

It's hard to write the equivalent unit test, because the test you
wrote for the asyncore-based version is testing lots of low level
details which, as you can see, don't actually appear in the Twisted-
based version because Twisted does them for you already.  However,
once you get past all that low-level stuff and get to the part where
you actually implement some of your application logic, you might have
tests for your protocol implementation that look something like this:

from twisted.trial.unittest import TestCase
from twisted.test.proto_helpers import StringTransport

from yourapp import Handler # Or a better name

class HandlerTests(TestCase):
def test_someMessage(self):

When the X message is received, the Y response is sent
back.

transport = StringTransport()
protocol = Handler()
protocol.makeConnection(transport)
protocol.dataReceived(X)
self.assertEqual(transport.value(), Y)

Hope this helps,
Jean-Paul

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Equivalent code to the bool() built-in function

2011-04-19 Thread Jean-Paul Calderone
On Apr 19, 10:23 am, Grant Edwards inva...@invalid.invalid wrote:
 On Tue, Apr 19, 2011 at 7:09 AM, Christian Heimes li...@cheimes.de wrote:
  Am 18.04.2011 21:58, schrieb John Nagle:
  ?? ?? This is typical for languages which backed into a bool type,
  rather than having one designed in. ??The usual result is a boolean
  type with numerical semantics, like

  ?? True + True
  2

  I find the behavior rather useful. It allows multi-xor tests like:

  if a + b + c + d != 1:
  ?? ??raise ValueError(Exactly one of a, b, c or d must be true.)

 I guess I never thought about it, but there isn't an 'xor' operator to
 go along with 'or' and 'and'.  Must not be something I need very often.


You also can't evaluate xor without evaluating both operands, meaning
there
is never a short-circuit; both and and or can short-circuit, though.
Also
boolean xor is the same as !=.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pickling over a socket

2011-04-19 Thread Jean-Paul Calderone
On Apr 19, 6:27 pm, Roger Alexander rtalexan...@mac.com wrote:
 Thanks everybody, got it working.

  I appreciate the help!

 Roger.

It's too bad none of the other respondents pointed out to you that you
_shouldn't do this_!  Pickle is not suitable for use over the network
like this.  Your server accepts arbitrary code from clients and
executes it.  It is completely insecure.  Do not use pickle and
sockets together.  Notice the large red box at the top of http://
docs.python.org/library/pickle.html.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Questions about GIL and web services from a n00b

2011-04-16 Thread Jean-Paul Calderone
On Apr 16, 10:44 am, a...@pythoncraft.com (Aahz) wrote:
 In article e6008cc8-50f0-4d78-be78-ec6e73b97...@22g2000prx.googlegroups.com,
 Raymond Hettinger  pyt...@rcn.com wrote:



 Threading is really only an answer if you need to share data between
 threads, if you only have limited scaling needs, and are I/O bound
 rather than CPU bound

 Threads are also useful for user interaction (i.e. GUI apps).  


I suppose that's why most GUI toolkits use a multithreaded model.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

Trial lets test cases get garbaged collected.  When we noticed this wasn't 
happening, we treated it as a bug and fixed it.  No one ever complained about 
the change.  I don't see any obvious way in which an application would even be 
able to tell the difference (a user can tell the difference by looking at top). 
 In what case do you think this change would result in broken application code?

--
nosy: +exarkun

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



[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

 I thought unittest was just handed a bunch of TestCase instances and couldn't 
 do much about insuring they were garbage collected.

True.  But unittest could ensure that it doesn't keep a reference to each 
TestCase instance after it finishes running it.  Then, if no one else has a 
reference either, it can be garbage collected.

--

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



[issue11798] Test cases not garbage collected after run

2011-04-07 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

Here's Trial's implementation: 
http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py#L138

--

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



Re: Checking against NULL will be eliminated?

2011-03-03 Thread Jean-Paul Calderone
On Mar 3, 8:16 am, Neil Cerutti ne...@norwich.edu wrote:
 On 2011-03-03, Tom Zych freethin...@pobox.com wrote:

  Carl Banks wrote:
  Perl works deterministically and reliably.  In fact, pretty much every
  language works deterministically and reliably.  Total non-argument.

  Well, yes. I think the real issue is, how many surprises are
  waiting to pounce on the unwary developer. C is deterministic
  and reliable, but full of surprises.

 Point of order, for expediency, C and C++ both include lots and
 lots of indeterminate stuff. A piece of specific C code can be
 totally deterministic, but the language is full of undefined
 corners.

  Python is generally low in surprises. Using if identifier
  is one place where you do have to think about unintended
  consequences.

 Python eschews undefined behavior.


C and C++ have standards, and the standards describe what they don't
define.

Python has implementations.  The defined behavior is whatever the
implementation does.  Until someone changes it to do something else.

It's not much of a comparison.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: interrupted system call w/ Queue.get

2011-02-18 Thread Jean-Paul Calderone
On Feb 17, 8:46 pm, Philip Winston pwins...@gmail.com wrote:
 We have a multiprocess Python program that uses Queue to communicate
 between processes.  Recently we've seen some errors while blocked
 waiting on Queue.get:

 IOError: [Errno 4] Interrupted system call

 What causes the exception?  Is it necessary to catch this exception
 and manually retry the Queue operation?  Thanks.


The exception is caused by a syscall returning EINTR.  A syscall will
return EINTR when a signal arrives and interrupts whatever that
syscall
was trying to do.  Typically a signal won't interrupt the syscall
unless you've installed a signal handler for that signal.  However,
you can avoid the interruption by using `signal.siginterrupt` to
disable interruption on that signal after you've installed the
handler.

As for the other questions - I don't know, it depends how and why it
happens, and whether it prevents your application from working
properly.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How to handle sockets - easily?

2011-02-16 Thread Jean-Paul Calderone
On Feb 16, 1:59 pm, William Ahern will...@wilbur.25thandclement.com
wrote:
 Bubba nickn...@banelli.biz.invalid wrote:

 snip









  import asyncore
  import socket
  import string
  import MySQLdb
  import sys
 snip
      def __init__(self, host, port):
          asyncore.dispatcher.__init__(self)
          self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
          self.set_reuse_addr()
          self.bind((host, port))
          self.listen(5)

      def handle_accept(self):
          pair = self.accept()
          if pair is None:
              pass
          else:
              sock, addr = pair
              print 'Incoming connection from %s' % repr(addr)
              handler = Handler(sock)

  server = Server('', 2020)
  asyncore.loop()

 snip
  I do, however, have some more questions (thus crosspost to
  comp.lang.python) - how many connections can this server handle without
  a problem? I'm using Asyncore module, as it can be seen.
  Is it necessary, due to the fact that it should serve more than
  thousand devices that send data every 10 seconds, to do threading (I
  believe that is already done with Asyncore for sockets, but what about
  SQL?)

 The MySQL C library is not asynchronous. Each request does blocking I/O. If
 the MySQLdb module is a wrapper for the MySQL C library--and it seems it
 is--then you will want to use threads (not coroutines or generators). For
 all I know your accept handler is threaded already. MySQL itself almost
 certainly can't handle tens of thousands of simultaneous requests. The
 backend connection and query handler is simply-threaded as well, which means
 for every connection your talking 2 * tens of thousands threads. I didn't
 read over your code much, but the only way to get around this would be to
 handle your socket I/O asynchronously; but I don't enough about Python to
 get the mixed behavior you'd want.

 I think that there's an asynchronous all-Python MySQL library, but I'm not
 sure. Maybe one day I can open source my asynchronous MySQL C library. (I
 always recommend people to use PostgreSQL, though; which is superior in
 almost every way, especially the C client library and the wire protocol.)

There's the very new https://github.com/hybridlogic/txMySQL.
There's also
http://pypi.python.org/pypi/txpostgres.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Shared memory python between two separate shell-launched processes

2011-02-11 Thread Jean-Paul Calderone
On Feb 11, 5:52 am, Charles Fox (Sheffield) charles@gmail.com
wrote:
 On Feb 10, 6:22 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:









  On Feb 10, 12:21 pm, Charles Fox (Sheffield) charles@gmail.com
  wrote:

   On Feb 10, 3:43 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
   wrote:

On Feb 10, 9:30 am, Charles Fox (Sheffield) charles@gmail.com
wrote:

 Hi guys,
 I'm working on debugging a large python simulation which begins by
 preloading a huge cache of data.  I want to step through code on many
 runs to do the debugging.   Problem is that it takes 20 seconds to
 load the cache at each launch.  (Cache is a dict in a 200Mb cPickle
 binary file).

 So speed up the compile-test cycle I'm thinking about running a
 completely separate process (not a fork, but a processed launched form
 a different terminal)

Why _not_ fork?  Load up your data, then go into a loop forking and
loading/
running the rest of your code in the child.  This should be really
easy to
implement compared to doing something with shared memory, and solves
the
problem you're trying to solve of long startup time just as well.  It
also
protects you from possible bugs where the data gets corrupted by the
code
that operates on it, since there's only one copy shared amongst all
your
tests.  Is there some other benefit that the shared memory approach
gives
you?

Of course, adding unit tests that exercise your code on a smaller data
set
might also be a way to speed up development.

Jean-Paul

   Thanks Jean-Paul, I'll have a think about this.  I'm not sure if it
   will get me exactly what I want though, as I would need to keep
   unloading my development module and reloading it, all within the
   forked process, and I don't see how my debugger (and emacs pdb
   tracking) will keep up with that to let me step though the code.

  Not really.  Don't load your code at all in the parent.  Then there's
  nothing to unload in each child process, just some code to load for
  the very first time ever (as far as that process is concerned).

  Jean-Paul

 Jean, sorry I'm still not sure what you mean, could you give a couple
 of lines of pseudocode to illustrate it?   And explain how my emacs
 pdbtrack would still be able to pick it up?
 thanks,
 charles

import os
import loader
data = loader.preload()

while True:
pid = os.fork()
if pid == 0:
import program
program.main(data)
else:
os.waitpid(pid, 0)

But I won't actually try to predict how this is going to interact with
emacs pdbtrack.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Shared memory python between two separate shell-launched processes

2011-02-10 Thread Jean-Paul Calderone
On Feb 10, 9:30 am, Charles Fox (Sheffield) charles@gmail.com
wrote:
 Hi guys,
 I'm working on debugging a large python simulation which begins by
 preloading a huge cache of data.  I want to step through code on many
 runs to do the debugging.   Problem is that it takes 20 seconds to
 load the cache at each launch.  (Cache is a dict in a 200Mb cPickle
 binary file).

 So speed up the compile-test cycle I'm thinking about running a
 completely separate process (not a fork, but a processed launched form
 a different terminal)

Why _not_ fork?  Load up your data, then go into a loop forking and
loading/
running the rest of your code in the child.  This should be really
easy to
implement compared to doing something with shared memory, and solves
the
problem you're trying to solve of long startup time just as well.  It
also
protects you from possible bugs where the data gets corrupted by the
code
that operates on it, since there's only one copy shared amongst all
your
tests.  Is there some other benefit that the shared memory approach
gives
you?

Of course, adding unit tests that exercise your code on a smaller data
set
might also be a way to speed up development.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Shared memory python between two separate shell-launched processes

2011-02-10 Thread Jean-Paul Calderone
On Feb 10, 12:21 pm, Charles Fox (Sheffield) charles@gmail.com
wrote:
 On Feb 10, 3:43 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:









  On Feb 10, 9:30 am, Charles Fox (Sheffield) charles@gmail.com
  wrote:

   Hi guys,
   I'm working on debugging a large python simulation which begins by
   preloading a huge cache of data.  I want to step through code on many
   runs to do the debugging.   Problem is that it takes 20 seconds to
   load the cache at each launch.  (Cache is a dict in a 200Mb cPickle
   binary file).

   So speed up the compile-test cycle I'm thinking about running a
   completely separate process (not a fork, but a processed launched form
   a different terminal)

  Why _not_ fork?  Load up your data, then go into a loop forking and
  loading/
  running the rest of your code in the child.  This should be really
  easy to
  implement compared to doing something with shared memory, and solves
  the
  problem you're trying to solve of long startup time just as well.  It
  also
  protects you from possible bugs where the data gets corrupted by the
  code
  that operates on it, since there's only one copy shared amongst all
  your
  tests.  Is there some other benefit that the shared memory approach
  gives
  you?

  Of course, adding unit tests that exercise your code on a smaller data
  set
  might also be a way to speed up development.

  Jean-Paul

 Thanks Jean-Paul, I'll have a think about this.  I'm not sure if it
 will get me exactly what I want though, as I would need to keep
 unloading my development module and reloading it, all within the
 forked process, and I don't see how my debugger (and emacs pdb
 tracking) will keep up with that to let me step though the code.

Not really.  Don't load your code at all in the parent.  Then there's
nothing to unload in each child process, just some code to load for
the very first time ever (as far as that process is concerned).

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: AF_UNIX socket not supported

2011-02-08 Thread Jean-Paul Calderone
On Feb 8, 7:30 am, gracemia grace...@gmail.com wrote:
 Hello !

 I'm trying to develop with AF_UNIX socket type in python (2.5) but
 python says that AF_UNIX is not supported
 How can I do for work with AF_UNIX sockets?

 Thank you

Where and when does Python say this to you?

http://docs.python.org/library/socket.html#socket.AF_UNIX

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Idea for removing the GIL...

2011-02-08 Thread Jean-Paul Calderone
On Feb 8, 7:34 am, Vishal vsapr...@gmail.com wrote:
 On Feb 8, 3:05 pm, Adam Tauno Williams awill...@whitemice.org wrote:

  On Tue, 2011-02-08 at 01:39 -0800, Vishal wrote:
   Is it possible that the Python process, creates copies of the
   interpreter for each thread that is launched, and some how the thread
   is bound to its own interpreter ?
   and it may also allow the two threads to run in parallel, assuming
   the processors of today can send independent instructions from the
   same process to multiple cores?
   Comments, suggestions, brush offs  are welcome :))

  Yes, it is possible, and done.  See the multiprocessing module.  It
  works very well.
  http://docs.python.org/library/multiprocessing.html

  It isn't exactly the same as threads, but provides many similar
  constructs.

 Hi,

 Pardon me for my ignorance here, but 'multiprocessing' creates actual
 processes using fork() or CreateProcess().
 I was talking of a single process, running multiple instances of the
 interpreter. Each thread, bound with its own interpreter.
 so the GIL wont be an issue anymore...each interpreter has only one
 thing to do, and that one thing holds the lock on its own interpreter.
 Since its still the same process, data sharing should happen just like
 in Threads.

CPython does support multiple interpreters in a single process.
However,
you cannot have your cake and eat it too.  If you create multiple
interpreters,
then why do you think you'll be able to share objects between them for
free?

In what sense would you have *multiple* interpreters in that scenario?

You will need some sort of locking between the interpreters.  Then
you're either
back to the GIL or to some more limited form of sharing - such as you
might
get with the multiprocessing module.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Idea for removing the GIL...

2011-02-08 Thread Jean-Paul Calderone
On Feb 8, 7:12 pm, Paul Rubin no.em...@nospam.invalid wrote:
 But the refcount scheme is just an implementation hack
 that gets rationalized way too much.  I hope PyPy abandons it.

Done. :)

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sending through non-default gateway

2011-02-06 Thread Jean-Paul Calderone
On Feb 6, 1:10 am, Nikola Skoric n...@fly.srk.fer.hr wrote:
 Dana Sat, 5 Feb 2011 14:13:11 -0800,
 Dan Stromberg drsali...@gmail.com kaze:

  IIRC, this is an instance of what's called source routing, and was
  largely shut off after network admins realized it was a security
  issue.

  Of course, if you have root/administrator permission, you could
  probably do it.  But if you have that, you could probably just fix the
  routing table.

 Yeah, I don't have admin priviledges, it's my office computer which is
 supposed to be cut of the Internet.

 I did a bit of reading on source routing and I'd like to try it. Just
 for fun, in case our router accepts such packets. So, is there a way
 to do it in python?

You don't need real source routing (and real source routed packets
will probably be dropped by the first router that sees them).  You
just need to make a different decision at the first hop.  You can do
this with the SO_BINDTODEVICE option on a raw socket.  But this
probably also requires administrative privileges.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: simplest way to create simple standalone wsgi server without import wsgi_lib.server

2011-02-01 Thread Jean-Paul Calderone
On Feb 1, 2:01 pm, Gelonida gelon...@gmail.com wrote:
 On 02/01/2011 03:07 AM, Jean-Paul Calderone wrote:



  On Jan 31, 5:28 pm, Gelonida gelon...@gmail.com wrote:
  Hi,

  Normally I use following code snippet to quickly test a wsgi module
  without a web server.

  import wsgi_lib.server
  wsgi_lib.server.run(application, port=port)

  However Now I'd like to test a small wsgi module on a rather old host
  ( Python 2.4.3 ) where I don't have means to update python.

  Is there any quick and easy code snippet / module, performing the same
  task as my above mentioned lines?

  Thanks in advance for any hints

  You didn't mention why you can't update Python, or if that means you
  can't install new libraries either.  However, if you have Twisted 8.2
  or newer, you can replace your snippet with this shell command:

      twistd -n web --port port --wsgi application

 Thanks Jean-Paul

 The problem is rather simple. The host in question is not 100% under my
 control. I can request to have packages installed if they're in the list
 of available packages.

 python 2.4 is part of it. twisted is not

 In the worst case I could request the installation of python virtualenv,
 the entire gcc tool chain and try to compile twisted,
 or wsgilib, but I wondered whether there isn't a simple pure python way
 of starting a wsgi server for test purposes.


You may be able to install Twisted (or even wsgilib) in your home
directory.  For example, the command:

python setup.py --prefix ~/.local

will install Twisted (or maybe wsgilib) in ~/.local/lib/python2.4/site-
packages/.  Add that to your PYTHONPATH (eg in your .bashrc) and
you're basically all set.  Also, though Twisted has some extension
modules, they're optional.  So you should be fine without a compiler,
*except* that distutils doesn't cope so well with certain cases.  If
you find setup.py install fails for some reason, you can also just
add the unpacked source directory to PYTHONPATH and run it in-place
without installation.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: simplest way to create simple standalone wsgi server without import wsgi_lib.server

2011-01-31 Thread Jean-Paul Calderone
On Jan 31, 5:28 pm, Gelonida gelon...@gmail.com wrote:
 Hi,

 Normally I use following code snippet to quickly test a wsgi module
 without a web server.

 import wsgi_lib.server
 wsgi_lib.server.run(application, port=port)

 However Now I'd like to test a small wsgi module on a rather old host
 ( Python 2.4.3 ) where I don't have means to update python.

 Is there any quick and easy code snippet / module, performing the same
 task as my above mentioned lines?

 Thanks in advance for any hints

You didn't mention why you can't update Python, or if that means you
can't install new libraries either.  However, if you have Twisted 8.2
or newer, you can replace your snippet with this shell command:

twistd -n web --port port --wsgi application

application is the fully-qualified Python name of your application
object.  So, for example if you have a module named foo that defines
an application name, you would pass foo.application.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-20 Thread Jean-Paul Calderone

Jean-Paul Calderone invalid@example.invalid added the comment:

 Phillip, your argument about interfacing with code written in C doesn't work 
 for built-in immutable types like str.

Sure it does.  Definitely-str is easier to handle in C than maybe-str-subclass. 
 It doesn't matter that str.__new__ gets called.  Other things might get called 
too, with who-knows-what side-effects.

wsgi is right to demand str and only str and exactly str.

--
nosy: +exarkun

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



Re: Interrput a thread

2011-01-04 Thread Jean-Paul Calderone
On Jan 4, 12:31 pm, Fuzzyman fuzzy...@gmail.com wrote:
 On Jan 4, 3:31 pm, Roy Smith r...@panix.com wrote:



  In article
  2ebc11a5-1b45-4faa-97b9-c84f0db01...@k22g2000yqh.googlegroups.com,

   Fuzzyman fuzzy...@gmail.com wrote:
   It is unsafe to terminate an os level thread at an arbitrary point
   because it may be executing code in a critical section.
   [...]
   The standard advice is to use a flag and do manual checking to abort
   threads. This only works for fine grained operations and *doesn't*
   work for very coarse grained operations or where there aren't
   convenient places to check the flag.

  Another possibility is to not use threads!  If you

  1) Need asynchronous operation

  2) Need iterruptability

  3) Can't poll for an please stop signal

  You should look at running your thread as a separate process, which
  you can send a kill signal to when you want it to go away.  You can then
  communicate with it via pipes, sockets, shared memory segments, whatever.

  Threads are a wonderful invention, but they are not a panacea for all
  possible parallelism tasks.  Sometimes they're just the wrong tool.

 However some tasks / algorithms are done much better with threads than
 processes.

 Asynchronous operations are good for IO bound concurrency but not for
 CPU bound concurrency.



Asynchronous and threads aren't mutually exclusive.  An asynchronous
multithreading or multiprocessing library is perfectly well suited for
CPU bound concurrency.


 Michael Foord
 --http://www.voidspace.org.uk/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interrput a thread

2011-01-03 Thread Jean-Paul Calderone
On Jan 3, 3:22 pm, gervaz ger...@gmail.com wrote:
 On 3 Gen, 17:47, de...@web.de (Diez B. Roggisch) wrote:



  gervaz ger...@gmail.com writes:
   On 31 Dic 2010, 23:25, Alice Bevan–McGregor al...@gothcandy.com
   wrote:
   On 2010-12-31 10:28:26 -0800, John Nagle said:

Even worse, sending control-C to a multi-thread program
is unreliable in CPython.  See http://blip.tv/file/2232410;
for why.  It's painful.

   AFIK, that has been resolved in Python 3.2 with the introduction of an
   intelligent thread scheduler as part of the GIL release/acquire process.

           - Alice.

   Ok, but then suppose I have multiple long running threads that I want
   to delete/suspend because they are tooking too much time, which
   solution do you propose?

  If possible, use multiple processes instead.

  Diez- Nascondi testo citato

  - Mostra testo citato -

 Multiple processes, ok, but then regarding processes' interruption
 there will be the same problems pointed out by using threads?


No.  Processes can be terminated easily on all major platforms.  See
`os.kill`.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interrput a thread

2011-01-03 Thread Jean-Paul Calderone
On Jan 3, 4:17 pm, Adam Skutt ask...@gmail.com wrote:
 On Jan 3, 4:06 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:



   Multiple processes, ok, but then regarding processes' interruption
   there will be the same problems pointed out by using threads?

  No.  Processes can be terminated easily on all major platforms.  See
  `os.kill`.

 Yes, but that's not the whole story, now is it?  It's certainly much
 more reliable and easier to kill a process.  It's not any easier to do
 it and retain defined behavior, depending on exactly what you're
 doing.  For example, if you kill it while it's in the middle of
 updating shared memory, you can potentially incur undefined behavior
 on the part of any process that can also access shared memory.

Then don't use shared memory.


 In short, taking a program that uses threads and shared state and
 simply replacing the threads with processes will likely not gain you a
 thing.  It entirely depends on what those threads are doing and how
 they do it.


Of course.  The whole point here is not about threads vs processes.
It's about shared memory concurrency vs non-shared memory
concurrency.  You can implement both with threads and both with
processes, but threads are geared towards shared memory and processes
are geared towards non-shared memory.  So what most people mean by
use processes is don't use shared memory.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Interrput a thread

2011-01-03 Thread Jean-Paul Calderone
On Jan 3, 6:17 pm, Adam Skutt ask...@gmail.com wrote:
 On Jan 3, 5:24 pm, Jean-Paul Calderone calderone.jeanp...@gmail.com
 wrote:

  Of course.  The whole point here is not about threads vs processes.
  It's about shared memory concurrency vs non-shared memory
  concurrency.  You can implement both with threads and both with
  processes, but threads are geared towards shared memory and processes
  are geared towards non-shared memory.  So what most people mean by
  use processes is don't use shared memory.

 This is entirely my presumption, but I think if the OP were keenly
 aware of the differences between thread and processes, it's pretty
 likely he wouldn't have asked his question in the first place.


Fair enough. :)

 Also, I've written lots and lots of use processes code on multiple
 platforms, and much of it has used some sort of shared memory
 construct.  It's actually pretty common, especially in code bases with
 a lot of history.  Not all the world is Apache.


Hee hee, Apache. :)

 Adam

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Design Ideals Goals Python 3 - Forest for the trees

2010-12-26 Thread Jean-Paul Calderone
On Dec 26, 5:34 am, Alice Bevan–McGregor al...@gothcandy.com wrote:

 I've never really attempted to use JIT optimizers due to the fact that
 all of my development and production environments are 64-bit, and I
 haven't found one yet that supports 64-bit properly.  Relying on dead
 projects, however, is an issue of larger scope than mere portability.  
 ;)


The PyPy JIT supports x86_64.  It's still being improved, but it does
provide real speedups in some cases already.

Jean-Paul
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: dns library

2010-12-09 Thread Jean-Paul Calderone
On Dec 9, 8:15 pm, Paulo da Silva psdasilva.nos...@netcabonospam.pt
wrote:
 Hi.

 Is there a python library/module to handle both the server and client
 sides of dns protocol?

 I have googled for it but I only found client side ones (at least from
 the superficial readings I did).

 Thanks.

Twisted Names is one such library:  
http://twistedmatrix.com/trac/wiki/TwistedNames
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue10661] ElementTree QName has a very uninformative repr()

2010-12-09 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone inva...@example.invalid:

This is somewhat unfortunate behavior:

 from xml.etree.ElementTree import QName
 QName('foo')
xml.etree.ElementTree.QName instance at 0x10049c830
 

It becomes even more apparent when encountered in a situation like this:

 print {QName('foo'): 'bar', QName('baz'): 'quux'}
{xml.etree.ElementTree.QName instance at 0x10049cb90: 'bar', 
xml.etree.ElementTree.QName instance at 0x10049c248: 'quux'}
 

I would like to see QName.__repr__ return something like 'QName %r' % (text,)

--
messages: 123687
nosy: exarkun
priority: normal
severity: normal
status: open
title: ElementTree QName has a very uninformative repr()
type: behavior

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



  1   2   3   4   5   6   7   8   9   10   >