ANN: eGenix pyOpenSSL Distribution 0.13.1.1.0.1.5

2013-03-14 Thread eGenix Team: M.-A. Lemburg

ANNOUNCING

   eGenix.com pyOpenSSL Distribution

 Version 0.13.1.1.0.1.5


 An easy-to-install and easy-to-use distribution
 of the pyOpenSSL Python interface for OpenSSL -
available for Windows, Mac OS X and Unix platforms


This announcement is also available on our web-site for online reading:
http://www.egenix.com/company/news/eGenix-pyOpenSSL-Distribution-0.13.1.1.0.1.5.html


INTRODUCTION

The eGenix.com pyOpenSSL Distribution includes everything you need to
get started with SSL in Python.

It comes with an easy-to-use installer that includes the most recent
OpenSSL library versions in pre-compiled form, making your application
independent of OS provided OpenSSL libraries:

http://www.egenix.com/products/python/pyOpenSSL/

pyOpenSSL is an open-source Python add-on that allows writing SSL/TLS-
aware network applications as well as certificate management tools:

https://launchpad.net/pyopenssl/

OpenSSL is an open-source implementation of the SSL/TLS protocol:

http://www.openssl.org/


NEWS

This new release of the eGenix.com pyOpenSSL Distribution updates the
included OpenSSL version to 1.0.1c.


New in OpenSSL 1.0.1e since our last release for OpenSSL 1.0.1c
---

OpenSSL 1.0.1e includes several important fixes:

 * OpenSSL security advisory: ​http://www.openssl.org/news/secadv_20130204.txt
   - also known as Lucky 13
   
​http://www.h-online.com/security/news/item/TLS-tripped-up-by-Lucky-13-1798423.html

 * OpenSSL security advisory: ​http://www.openssl.org/news/secadv_20130205.txt

 * corrected fix for CVE-2013-0169 in 1.0.1e:
   ​http://www.mail-archive.com/openssl-users@openssl.org/msg70100.html

 * fixes the SSL3_GET_RECORD:wrong version number problem:

http://openssl.6102.n7.nabble.com/error-1408F10B-SSL-routines-SSL3-GET-RECORD-wrong-version-number-td22477.html

as well as several other new features compared to 1.0.0:

http://lwn.net/Articles/486426/

fixes vulnerabilities relative to 1.0.1c:

http://openssl.org/news/vulnerabilities.html

and includes a number of stability enhancements as well as extra
protection against attacks:

http://openssl.org/news/changelog.html


New in the eGenix pyOpenSSL Distribution


 * Changed the package version scheme to be PEP 386 compatible. The
   new scheme no longer contains underscores or patch level letters.

 * Added a CA root certificate bundle file ca-bundle.crt, which is
   created from the current Mozilla root CA certificate list.

   This allows verifying server certificates without having to rely on the
   system root CA certificate list. The bundle file will be updated with
   each new release of eGenix pyOpenSSL. We also make the file available
   as separate download. Please see the product page for details.

 * Added pyOpenSSL examples/ directory to the source distribution.

 * Added a new OpenSSL.ca_bundle module which provides easy to use
   access to the embedded ca-bundle.crt file.

 * Added new example https_client.py to the examples/ directory, which
   demonstrates setting up an SSL connection and using the new
   OpenSSL.ca_bundle module.

 * Windows x64 builds now have assembler code turned back on again,
   after a problem with OpenSSL 1.0.1c.

As always, we provide binaries that include both pyOpenSSL and the
necessary OpenSSL libraries for all supported platforms:
Windows x86 and x64, Linux x86 and x64, Mac OS X PPC, x86 and x64.

We've also added egg-file distribution versions of our eGenix.com
pyOpenSSL Distribution for Windows, Linux and Mac OS X to the
available download options. These make setups using e.g. zc.buildout
and other egg-file based installers a lot easier.


DOWNLOADS

The download archives and instructions for installing the package can
be found at:

http://www.egenix.com/products/python/pyOpenSSL/


UPGRADING

Before installing this version of pyOpenSSL, please make sure that
you uninstall any previously installed pyOpenSSL version. Otherwise,
you could end up not using the included OpenSSL libs.

___
SUPPORT

Commercial support for these packages is available from eGenix.com.
Please see

http://www.egenix.com/services/support/

for details about our support offerings.


MORE INFORMATION

For more information about the eGenix pyOpenSSL Distribution, licensing
and download instructions, please visit our web-site or 

Re: String performance regression from python 3.2 to 3.3

2013-03-14 Thread Chris Angelico
On Thu, Mar 14, 2013 at 1:35 PM, Terry Reedy tjre...@udel.edu wrote:
On 3/13/2013 7:43 PM, Chris Angelico wrote:
 It's complexity cost, though, and people would need to know when it
 would be worth giving Python that switch to change its string format.
 Plus, every C extension would need to cope with both formats. I
 personally doubt it'd be worth it, but if you want to knock together a
 patched CPython and get some timing stats, I'm sure this list or
 python-dev will be happy to discuss the matter. :)


 I presume the smiley indicates that you know that python developers are too
 busy with real problems to have any interest in bogus solutions to bogus
 problems.

It indicates more that the list(s) would almost certainly open up with
quite a bit of discussion - especially this one. It's not hard to get
talk happening, as evidenced by the number of times we've already
discussed this very topic. Frankly, I doubt there'll be anything to
discuss - that the patched version will be consistently worse; but if
I've learned one thing about timings, it's that there are surprises
*everywhere*, so I'm not prepared to state categorically that it
*cannot* be better. (I will, however, state that I do not expect any
such improvement to be worth the trouble of writing it.)

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


Re: String performance regression from python 3.2 to 3.3

2013-03-14 Thread Chris Angelico
On Thu, Mar 14, 2013 at 3:05 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 That depends on how you use the strings. Because strings are immutable,
 there isn't really anything like switching between widths -- the width
 is set when the string is created, and then remains fixed.

The nearest thing to switching is where you repeatedly replace() or
append/slice to add/remove the one non-ASCII character that your
contrived test is using. Let's see...

Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600
32 bit (Intel)] on win32

ASCII - ASCII:
 timeit.timeit(s=s[:-1]+'\u0034',s='asdf'*1,number=1)
0.14999895238081962

ASCII - BMP:
 timeit.timeit(s=s[:-1]+'\u1234',s='asdf'*1,number=1)
1.7513426985832012

BMP - BMP:
 timeit.timeit(s=s[:-1]+'\u1234',s='\u1234sdf'*1,number=1)
0.22562895563542895

ASCII - SMP:
 timeit.timeit(s=s[:-1]+'\U00012345',s='asdf'*1,number=1)
1.9037101084076369

BMP - SMP:
 timeit.timeit(s=s[:-1]+'\U00012345',s='\u1234sdf'*1,number=1)
1.9659967956821163

SMP - SMP:
 timeit.timeit(s=s[:-1]+'\U00012345',s='\U00012345sdf'*1,number=1)
0.7214749360603037

So there *is* cost to changing size. Trying them again in Python 2.6 Narrow:

Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit
(Intel)] on win32

ASCII - ASCII:
 timeit.timeit(s=s[:-1]+u'\u0034',s=u'asdf'*1,number=1)
0.53506213778566547

ASCII - BMP:
 timeit.timeit(s=s[:-1]+u'\u1234',s=u'asdf'*1,number=1)
0.57752172412974268

BMP - BMP:
 timeit.timeit(s=s[:-1]+u'\u1234',s=u'\u1234sdf'*1,number=1)
0.53309121690045913

ASCII - SMP:
 timeit.timeit(s=s[:-1]+u'\U00012345',s=u'asdf'*1,number=1)
0.55128347317885584

BMP - SMP:
 timeit.timeit(s=s[:-1]+u'\U00012345',s=u'\u1234sdf'*1,number=1)
0.55610140394938412

SMP - SMP:
 timeit.timeit(s=s[:-1]+u'\U00012345',s=u'\U00012345sdf'*1,number=1)
0.6599570615818493

Much more consistent. (Note that the SMP timings are quite probably a
bit off as the string will continue to grow - I'm taking off one
16-bit character and putting on two.)

I don't have a 2.6 wide build on the same hardware, so these times
don't truly compare to the above ones. This is slower hardware than
the above tests.

Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
[GCC 4.4.5] on linux2

 timeit.timeit(s=s[:-1]+u'\u0034',s=u'asdf'*1,number=1)
1.5774970054626465
 timeit.timeit(s=s[:-1]+u'\u1234',s=u'asdf'*1,number=1)
1.5743560791015625
 timeit.timeit(s=s[:-1]+u'\u1234',s=u'\u1234sdf'*1,number=1)
1.6072981357574463
 timeit.timeit(s=s[:-1]+u'\U00012345',s=u'asdf'*1,number=1)
1.6745591163635254
 timeit.timeit(s=s[:-1]+u'\U00012345',s=u'\u1234sdf'*1,number=1)
1.6705770492553711
 timeit.timeit(s=s[:-1]+u'\U00012345',s=u'\U00012345sdf'*1,number=1)
1.7078530788421631

Here's my reading of all these stats. Python 3.3's str is faster than
2.6's unicode when the copy can be done directly (ie when the size
isn't changing), but converting sizes costs a lot (suggestion: memcpy
is blazingly fast, no surprise there). Since MOST string operations
won't change the size, this is a benefit to most programs.

I expect that Python 3.2 will behave comparably to the 2.6 stats, but
I don't have 3.2s handy - can someone confirm please?

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


timeit module in IDLE

2013-03-14 Thread Chris Angelico
While putting together some timing stats for the latest Python 3.3
string representation thread, I ran into an oddity in how IDLE handles
timeit. The normal way to profile Python code, according to stuff I've
found on the internet, is timeit.timeit:

 import timeit
 timeit.timeit(s=s[:-1]+u'\u1234',s=u'asdf'*1,number=1)
0.57752172412974268

Now I knew that the module I wanted was timeit, but I didn't remember
the full incantation, so I did the obvious thing:

 import timeit
 timeit.ctrl-space

Only one thing came up: Timer. And help(timeit) doesn't mention
timeit.timeit either. Whereas the documentation:

http://docs.python.org/2/library/timeit.html
http://docs.python.org/3/library/timeit.html

clearly states that timeit.timeit() is the way to do things.

Snooping the source shows that timeit.timeit() is just a tiny
convenience function (alongside timeit.repeat()), but it'd still be
nice to have that come up in the Ctrl-Space list, since it's the
most-normal way to run timing tests.

Would there be a problem with adding timeit (and possibly repeat) to __all__?

-__all__ = [Timer]
+__all__ = [Timer, timeit]

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


Re: timeit module in IDLE

2013-03-14 Thread Terry Reedy

On 3/14/2013 2:58 AM, Chris Angelico wrote:

While putting together some timing stats for the latest Python 3.3
string representation thread, I ran into an oddity in how IDLE handles
timeit. The normal way to profile Python code, according to stuff I've
found on the internet, is timeit.timeit:


import timeit
timeit.timeit(s=s[:-1]+u'\u1234',s=u'asdf'*1,number=1)

0.57752172412974268

Now I knew that the module I wanted was timeit, but I didn't remember
the full incantation, so I did the obvious thing:


import timeit
timeit.ctrl-space


Only one thing came up: Timer. And help(timeit) doesn't mention
timeit.timeit either. Whereas the documentation:

http://docs.python.org/2/library/timeit.html
http://docs.python.org/3/library/timeit.html

clearly states that timeit.timeit() is the way to do things.

Snooping the source shows that timeit.timeit() is just a tiny
convenience function (alongside timeit.repeat()), but it'd still be
nice to have that come up in the Ctrl-Space list, since it's the
most-normal way to run timing tests.

Would there be a problem with adding timeit (and possibly repeat) to __all__?

-__all__ = [Timer]
+__all__ = [Timer, timeit]


I believe everything in the doc should be in __all__. Open an issue on 
the tracker and add terry.reedy as nosy.
Note on the issue that timeit.default_timer is not callable, contrary to 
the doc (which should also be fixed).


--
Terry Jan Reedy

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


Re: timeit module in IDLE

2013-03-14 Thread Chris Angelico
On Thu, Mar 14, 2013 at 6:21 PM, Terry Reedy tjre...@udel.edu wrote:
 I believe everything in the doc should be in __all__. Open an issue on the
 tracker and add terry.reedy as nosy.
 Note on the issue that timeit.default_timer is not callable, contrary to the
 doc (which should also be fixed).

Thanks! Issue 17414 created.

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


Getting a list in user defined selection order

2013-03-14 Thread e . tekinalp
Hello everybody,

I want to select components(vertices) in a particular Order with python.
So when I create a list the main problem is, that maya is not listing the verts 
in the correct selected order as I did. 

Here an example:

I have selected from a polySphere the following vtx

[sphere.vtx400, sphere.vtx250, sphere.vtx260, sphere.vtx500, sphere.vtx100]

so maya is giving me a list like that:

[sphere.vtx100, sphere.vtx250, sphere.vtx260, sphere.vtx400, sphere.vtx500]

I know that there is a flag in the cmds.ls that created a list in ordered 
Selection and that you have to enable the tos flag from the selectPref command

cmds.selectPref(tso = 1)
vtx = cmds.ls(os = 1, flatten = 1)
cmds.select(vtx)

But then he gives me an empty list, I also tried to toggle it in the preference 
window, but to be honest that couldn't be the way.

So how can I get a list in an userdefined selection order.

Thank you guys for any help.

Cheerio
the turkish engineer
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting a list in user defined selection order

2013-03-14 Thread e . tekinalp
Ah sorry this is the correct snippet

cmds.selectPref(tso = 1)
vtx = cmds.ls(os = 1, flatten = 1)
print vtx

the other one wouldn't make any sense. :)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Sphinx highlighting

2013-03-14 Thread Jean-Michel Pichavant
- Original Message -
 What controls the yellow highlight bar that Sphinx sometimes puts in
 the
 documentation?
 E.g.:
 .. py:function:: basic_parseStrTest ()
 generates bold-face text, where
 .. py:function:: basicParseStrTest ()
 generates text with a yellow bar highlight.
 
 I actually rather like the yellow bar highlight, but I can't stand
 having it appear for some of my functions, and not for others, and I
 haven't been able to figure out what turns it on or off.
 
 --
 Charles Hixson

I think the yellow bar only shows up when you folllow a link to that function.

See for instance the difference between
http://docs.python.org/2/library/multiprocessing.html#multiprocessing.Process.start


and http://docs.python.org/2/library/multiprocessing.html
where you go manually to the start method.

Cheers,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be 
privileged. If you are not the intended recipient, please notify the sender 
immediately and do not disclose the contents to any other person, use it for 
any purpose, or store or copy the information in any medium. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


TypeError: 'float' object is not iterable

2013-03-14 Thread Ana Dionísio
Hi!!

I keep having this error and I don't know why: TypeError: 'float' object is not 
iterable.

I have this piece of code, that imports to python some data from Excel and 
saves it in a list:


t_amb = []

for i in range(sh2.nrows):
t_amb.append(sh2.cell(i,2).value)

print t_amb


Here is everything ok.

But then, I need to pass the data again to exel, so I wrote this:


a=8
for b in range (len(t_amb)):
a=8
for d in t_amb[b]:
a=a+1
sheet.write(a,b+1,d)


The error appear in for d in t_amb[b]: and I don't understand why. Can you 
help me?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread Joel Goldstick
On Thu, Mar 14, 2013 at 6:12 AM, Ana Dionísio anadionisio...@gmail.comwrote:

 Hi!!

 I keep having this error and I don't know why: TypeError: 'float' object
 is not iterable.

 I have this piece of code, that imports to python some data from Excel and
 saves it in a list:

 
 t_amb = []

 for i in range(sh2.nrows):
 t_amb.append(sh2.cell(i,2).value)

 print t_amb

 
 Here is everything ok.

 But then, I need to pass the data again to exel, so I wrote this:

 
 a=8
 for b in range (len(t_amb)):
 a=8
 for d in t_amb[b]:
 a=a+1
 sheet.write(a,b+1,d)
 

 The error appear in for d in t_amb[b]: and I don't understand why. Can
 you help me?


Most likely the value of t_amb[[b] is a float.  It would have to be a list
or a tuple or some other sequence to be iterable.  I can't tell what you
are trying to do here

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




-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread Ana Dionísio
But isn't t_amb a list? I thought that the first piece of script would create a 
list.

I'm trying to create a list named t_amb with some values that are in a Excel 
sheet. And then I need to export that list to another Excel sheet
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread MRAB

On 14/03/2013 10:12, Ana Dionísio wrote:

Hi!!

I keep having this error and I don't know why: TypeError: 'float' object is not 
iterable.

I have this piece of code, that imports to python some data from Excel and 
saves it in a list:


t_amb = []

for i in range(sh2.nrows):
 t_amb.append(sh2.cell(i,2).value)

print t_amb


Here is everything ok.

But then, I need to pass the data again to exel, so I wrote this:


a=8
for b in range (len(t_amb)):
 a=8
 for d in t_amb[b]:
 a=a+1
 sheet.write(a,b+1,d)


The error appear in for d in t_amb[b]: and I don't understand why. Can you 
help me?


t_amb is a list of float, so t_amb[b] is a float, but you can't iterate
over a float.
--
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread Joel Goldstick
On Thu, Mar 14, 2013 at 6:34 AM, Ana Dionísio anadionisio...@gmail.comwrote:

 But isn't t_amb a list? I thought that the first piece of script would
 create a list.

t_amb might be a list, but t_amb[b] is apparently a number of type float
that is in that list


 I'm trying to create a list named t_amb with some values that are in a
 Excel sheet. And then I need to export that list to another Excel sheet
 --
 http://mail.python.org/mailman/listinfo/python-list




-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: String performance regression from python 3.2 to 3.3

2013-03-14 Thread rusi
On Mar 14, 11:47 am, Chris Angelico ros...@gmail.com wrote:
snipped
 I expect that Python 3.2 will behave comparably to the 2.6 stats, but
 I don't have 3.2s handy - can someone confirm please?

I have 3.2 but not 3.3. Can run it later today if no one does.
But better if someone with both on the same machine do the comparison.


jmf will you please run Chris' examples on all your pythons?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread Chris Rebert
On Thu, Mar 14, 2013 at 3:12 AM, Ana Dionísio anadionisio...@gmail.com wrote:
 Hi!!

 I keep having this error and I don't know why: TypeError: 'float' object is 
 not iterable.

In general, in the future, always include the full exception
Traceback, not just the final error message. The extra details this
provides can greatly aid debugging.

 I have this piece of code, that imports to python some data from Excel and 
 saves it in a list:

 
 t_amb = []

 for i in range(sh2.nrows):
 t_amb.append(sh2.cell(i,2).value)

`t_amb` is a list, and you are apparently putting floats (i.e. real
numbers) into it. `t_amb` is a list of floats.
Therefore every item of `t_amb` (i.e. `t_amb[x]`, for any `x` that's
within the bounds of the list's indices) will be a float.
(Also, you may want to rewrite this as a list comprehension;
http://docs.python.org/2/tutorial/datastructures.html#list-comprehensions
)

 print t_amb

 
 Here is everything ok.

 But then, I need to pass the data again to exel, so I wrote this:

 
 a=8
This duplicate assignment is pointless.

 for b in range (len(t_amb)):
 a=8
 for d in t_amb[b]:

Given our earlier conclusion, we likewise know that `t_amb[b]` will be
a float (we merely replaced the arbitrary `x` with `b`). A single
float is a scalar, not a collection, so it's nonsensical to try and
iterate over it like you are in for d in t_amb[b]:; a number is not
a list. `t_amb[b]` is a lone number, and numbers contain no
items/elements over which to iterate. Perhaps you want just d =
t_amb[b] ? Remember that in a `for` loop, the expression after the
`in` (i.e. `t_amb[b]`) is evaluated only once, at the beginning of the
loop, and not repeatedly. In contrast, assuming this were a valid
`for` loop, `d` would take on different values at each iteration of
the loop.

In any case, it's rarely necessary nowadays to manually iterate over
the range of the length of a list; use `enumerate()` instead;
http://docs.python.org/2/library/functions.html#enumerate

 a=a+1
 sheet.write(a,b+1,d)
 

 The error appear in for d in t_amb[b]: and I don't understand why. Can you 
 help me?

I hope this explanation has been sufficiently clear. If you haven't
already, you may wish to review the official Python tutorial at
http://docs.python.org/2/tutorial/index.html . You may also find it
helpful to run your program step-by-step in the interactive
interpreter/shell, printing out the values of your variables along the
way so as to understand what your program is doing.

Regards,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Finding the Min for positive and negative in python 3.3 list

2013-03-14 Thread 88888 Dihedral
Wolfgang Maier於 2013年3月13日星期三UTC+8下午6時43分38秒寫道:
 Steven D'Aprano steve+comp.lang.python at pearwood.info writes:
 
 
 
  
 
  On Tue, 12 Mar 2013 17:03:08 +, Norah Jones wrote:
 
  
 
   For example:
 
   a=[-15,-30,-10,1,3,5]
 
   
 
   I want to find a negative and a positive minimum.
 
   
 
   example: negative
 
   print(min(a)) = -30
 

 
   positive
 
   print(min(a)) = 1
 
  
 
  Thank you for providing examples, but they don't really cover all the 
 
  possibilities. For example, if you had:
 
  
 
  a = [-1, -2, -3, 100, 200, 300]
 
  
 
  I can see that you consider -3 to be the negative minimum. Do you 
 
  consider the positive minimum to be 100, or 1?
 
  
 
  If you expect it to be 100, then the solution is:
 
  
 
  min([item for item in a if item  0])
 
  
 
  If you expect it to be 1, then the solution is:
 
  
 
  min([abs(item) for item in a])
 
  
 
  which could also be written as:
 
  
 
  min(map(abs, a))
 
  
 
  A third alternative is in Python 3.3:
 
  
 
  min(a, key=abs)
 
  
 
  which will return -1.
 
  
 
 
 
 thinking again about the question, then the min() solutions suggested so far
 
 certainly do the job and they are easy to understand.
 
 However, if you need to run the function repeatedly on larger lists, using 
 min()
 
 is suboptimal because its performance is an O(n) one.
 
 It's faster, though less intuitive, to sort your list first, then use bisect 
 on
 
 it to find the zero position in it. Two manipulations running at O(log(n)).
 
 
 
 compare these two functions:
 
 
 
 def with_min(x):
 
 return (min(n for n in a if n0), min(n for n in a if n=0))
 
 
 
 def with_bisect(x):
 
 b=sorted(x)
 
 return (b[0] if b[0]0 else None, b[bisect.bisect_left(b,0)])
 
 
 
 then either time them for small lists or try:
 
 
 
 a=range(-1000,1000)
 
 with_min(a)
 
 with_bisect(a)
 
 
 
 of course, the disadvantage is that you create a huge sorted list in memory 
 and
 
 that it's less readable.
 
 
 
 Best,
 
 Wolfgang

Sorting numbers of such range M in a list of length N by radix sort 
is faster but requires more memory.
-- 
http://mail.python.org/mailman/listinfo/python-list


how to couper contenier of a canvas in an outer canvas???

2013-03-14 Thread olsr . kamal
how to couper all the obejcts in a canvas in an auther canvas? 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: What's the easiest Python datagrid GUI (preferably with easy database hooks as well)?

2013-03-14 Thread Wolfgang Keller
 I want to write a fairly trivial database driven application, it will
 basically present a few columns from a database, allow the user to add
 and/or edit rows, recalculate the values in one column and write the
 data back to the database.
 
 I want to show the data and allow editing of the data in a datagrid as
 being able to see adjacent/previous data will help a huge amount when
 entering data.
 
 So what toolkits are there out there for doing this sort of thing?  A
 GUI toolkit would be lovely (allowing layout etc.) but isn't
 absolutely necessary.
 
 I'm a reasonably experienced programmer and know python quite well
 but I'm fairly much a beginner with event driven GUI stuff so I need
 a user friendly framework.

This is becoming an FAQ.

The currently available (non-web) database application development
frameworks for Python are:

using wxPython:
Dabohttp://www.dabodev.com
Defis   http://sourceforge.net/projects/defis/ (Russian only)
GNUehttp://www.gnuenterprise.org/

using PyQt:
Pypapi  https://pypi.python.org/pypi/PyPaPi
Camelot http://www.python-camelot.com/
Qtalchemy   http://www.qtalchemy.org/
Thyme   http://clocksoft.co.uk/downloads/
Kexihttp://www.kexi-project.org/

using PyGTK:
SQLkit  http://sqlkit.argolinux.org/
Kiwihttp://www.async.com.br/projects/kiwi/
Glomhttp://www.glom.org

Openoffice Base
http://www.openoffice.org/product/base.html
Libreoffice Base
http://www.libreoffice.org/features/base/

OpenERP http://www.openerp.org
Tryton  http://www.tryton.org

Dabo (they're about to release 1.0 for Pycon), Pypapi, Camelot, SQLkit
seem to be the most actively developed and best documented ones.

OpenERP and Tryton are ERP systems that can also be used as
frameworks for non-ERP custom applications.

Apparently defunct:

Pythoncard  http://pythoncard.sourceforge.net/
Boa Constructor http://boa-constructor.sourceforge.net/
Knoda   http://www.knoda.org/
Rekall  ?
Gemello http://abu.sourceforge.net/

Sincerely,

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


Re: Pygame mouse cursor load/unload

2013-03-14 Thread Ian Kelly
On Tue, Mar 12, 2013 at 5:33 PM, Alex Gardner agardner...@gmail.com wrote:
 Sorry but im back to square one.  My paddle isn't showing up at all! 
 http://pastebin.com/PB5L8Th0

paddle_rect.center = pygame.mouse.get_pos()

This updates the paddle position.

screen.blit(beeper, paddle_rect)

This draws the paddle at that position.

screen.blit(bpaddle, paddle_rect)

This draws the blank paddle at that same position.  Try to think about
why this results in the paddle not showing up.

If this is for a class, I think you should spend some quality time
with the TA rather than continue to throw non-functional code at this
list, which is clearly getting you nowhere.
-- 
http://mail.python.org/mailman/listinfo/python-list


Generating Filenames from Feeds

2013-03-14 Thread Chuck
HI all,

I am trying to write a podcast catcher for fun, and I am trying to come up with 
a way to generate a destination filename to use in the function 
urlretrieve(url, destination).  I  would like the destination filename to end 
in a .mp3 extension.  

My first attempts were parsing out the pubdate and stripping the whitespace 
characters, and joining with os.path.join.  I haven't been able to make that 
work for some reason.  Whenever I put the .mp3 in the os.path.join I get syntax 
errors.  I am wondering if there is a better way?

I was doing something like os.path.join('C:\\Users\\Me\\Music\\Podcasts\\', 
pubdate.mp3), where pubdate has been parsed and stripped of whitespace.  I keep 
getting an error around the .mp3.

Any ideas?

Thanks!!
Chuck  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Generating Filenames from Feeds

2013-03-14 Thread Joel Goldstick
On Thu, Mar 14, 2013 at 11:38 AM, Chuck galois...@gmail.com wrote:

 HI all,

 I am trying to write a podcast catcher for fun, and I am trying to come up
 with a way to generate a destination filename to use in the function
 urlretrieve(url, destination).  I  would like the destination filename to
 end in a .mp3 extension.

 My first attempts were parsing out the pubdate and stripping the
 whitespace characters, and joining with os.path.join.  I haven't been able
 to make that work for some reason.


The reason is apparently a  syntax error.

Whenever I put the .mp3 in the os.path.join I get syntax errors.  I am
 wondering if there is a better way?


Yes, don't write code with syntax errors!


 I was doing something like
 os.path.join('C:\\Users\\Me\\Music\\Podcasts\\', pubdate.mp3), where
 pubdate has been parsed and stripped of whitespace.  I keep getting an
 error around the .mp3.

 Any ideas?


Seriously, if you don't post a minimal code example that shows the problem
and with a full traceback you are asking strangers to do magic tricks for
your pleasure.


 Thanks!!
 Chuck
 --
 http://mail.python.org/mailman/listinfo/python-list




-- 
Joel Goldstick
http://joelgoldstick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Generating Filenames from Feeds

2013-03-14 Thread MRAB

On 14/03/2013 15:38, Chuck wrote:

HI all,

I am trying to write a podcast catcher for fun, and I am trying to
come up with a way to generate a destination filename to use in the
function urlretrieve(url, destination).  I  would like the
destination filename to end in a .mp3 extension.

My first attempts were parsing out the pubdate and stripping the
whitespace characters, and joining with os.path.join.  I haven't been
able to make that work for some reason.  Whenever I put the .mp3 in
the os.path.join I get syntax errors.  I am wondering if there is a
better way?

I was doing something like
os.path.join('C:\\Users\\Me\\Music\\Podcasts\\', pubdate.mp3), where
pubdate has been parsed and stripped of whitespace.  I keep getting
an error around the .mp3.

Any ideas?


The filename referred to by pubdate is a string, and you want to append
an extension, also a string, to it. Therefore:

os.path.join('C:\\Users\\Me\\Music\\Podcasts\\', pubdate + '.mp3')
--
http://mail.python.org/mailman/listinfo/python-list


editing a HTML file

2013-03-14 Thread Tracubik

Hi all,

I'would like to make a script that automatically change some text in a 
html file.


I need to make some changes in the text of p tags

My question is: there is a way to just update/substitute the text in 
the html p tags or do i have to make a new modified copy of the html file?


To be clear, i'ld like to make something like this:

open html file
for every p tags:
  if foo in text:
change foo in bar
close html file

any sample would be really appreciated
I'm really a beginner as you can see

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


Re: TypeError: 'float' object is not iterable

2013-03-14 Thread John Ladasky
On Thursday, March 14, 2013 3:12:11 AM UTC-7, Ana Dionísio wrote:

 for b in range (len(t_amb)):
 a=8
 for d in t_amb[b]:
 a=a+1
 sheet.write(a,b+1,d)
 
 The error appear in for d in t_amb[b]: and I don't understand why. Can you 
 help me?

It looks to me like you know how to program in some other language, possibly C, 
and your other language's needs are affecting the way that you write Python.  

You are supplying an explicit variable, b to step through... something.  I 
THINK that you want to step through t_amb, and not through the Bth element of 
t_amb.  Python's in statement will do this for you automatically, without you 
having to keep track of an index variable.

You didn't show your import statements, but I assume you are using the xlwt 
module.  That's where I find the sheet.write() function.  Now, exactly HOW did 
you want to write the data back to the Excel file?  In a single column?  A 
single row?  Or in a diagonal?  You have two nested loops.  I'm confused by the 
fact that you are incrementing both the row and column indices for 
sheet.write().

Do you know about the enumerate() function?  It's very handy.  It yields a 
tuple, the first element of which is a number counting up from zero, and the 
second element of which is an element from the (iterable) variable that you 
provide.

Does this code accomplish your task?

for column, data in enumerate(t_amb):
sheet.write(8, column+1, data)

Or this?

for row, data in enumerate(t_amb):
sheet.write(row+8, 1, data)

If you have any questions, feel free to ask.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: editing a HTML file

2013-03-14 Thread Jean-Michel Pichavant
- Original Message -
 Hi all,
 
 I'would like to make a script that automatically change some text in
 a
 html file.
 
 I need to make some changes in the text of p tags
 
 My question is: there is a way to just update/substitute the text
 in
 the html p tags or do i have to make a new modified copy of the
 html file?
 
 To be clear, i'ld like to make something like this:
 
 open html file
 for every p tags:
if foo in text:
  change foo in bar
 close html file
 
 any sample would be really appreciated
 I'm really a beginner as you can see
 
 Thanks
 --
 http://mail.python.org/mailman/listinfo/python-list
 

Hi,

You can use
http://www.crummy.com/software/BeautifulSoup/bs4/doc/#modifying-the-tree

Almost all functions have an example.


Cheers,

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be 
privileged. If you are not the intended recipient, please notify the sender 
immediately and do not disclose the contents to any other person, use it for 
any purpose, or store or copy the information in any medium. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Generating Filenames from Feeds

2013-03-14 Thread Chuck

 Seriously, if you don't post a minimal code example that shows the problem 
 and with a full traceback you are asking strangers to do magic tricks for 
 your pleasure. 

I'm asking more for a better way of generating destination filenames, not so 
much debugging questions.  I only put my attempts there to show people that I 
was actually trying something, and not just relying on people to do my thinking 
for me.

I'm trying to take a feed such as this 

http://www.theskepticsguide.org/feed/rss.aspx?feed=SGU

and parse some useful data out of it for a destination filename.  The solution 
should be general, and not just for this particular feed.

Thanks!















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


Re: IOError:[Errno 27] File too large

2013-03-14 Thread ch . valderanis

 Taking a wild guess, I think that you are using a Samba share on a Linux 
 
 server. A file FILENAME.xml; was accidentally creating on this share 
 
 from the Linux filesystem layer, since Linux will allow you to use 
 
 semicolons in file names. But samba enforces the same restrictions as 
 
 Windows, so when you access the file system through sambda, it gives an 
 
 error when you try to create a new file FILENAME.sub;.
 
 This is a wild guess, and could be completely wrong. Please come back and 
 
 tell us the solution when you have solved it.

So, let me report the solution.
All the files were in an afs filesystem. afs has a limit for the total length 
of  the filenames per directory. for more details take a look at 
http://www.inf.ed.ac.uk/systems/AFS/topten.html#Tip13
In my case 10k files with ~160characters per filename were just hitting the 
limit. The error message is basically misleading.

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


Re: Pygame mouse cursor load/unload

2013-03-14 Thread Alex Gardner
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote:
 I am in the process of making a pong game in python using the pygame library. 
  My current problem is that when I move the mouse, it turns off as soon as 
 the mouse stops moving.  The way I am doing this is by making the default 
 cursor invisible and using .png files as replacements for the cursor.  
 Perhaps my code would best explain my problem.  I will take help in any way 
 that I can.  Here are the links that contain my code:
 
 
 
 Main class:  http://pastebin.com/HSQzX6h2
 
 Main file (where the problem lies):  http://pastebin.com/67p97RsJ
 
 
 
 If the links yield nothing, please let me know (agardner...@gmail.com)

It's all working now with one exception.  I just want to arrange the paddle to 
the right side.  I managed to do just that, but it won't move freely 
vertically.  I am not fully aware of the arguments of pygame.Rect().  Here is 
what I am using:


bounds_rect = pygame.Rect(880,200,0,500)


Again, it all works minus the vertcal movement.  The full code (keep in mind it 
works fine now) is http://pastebin.com/xAAda30e

I thank you all (esp. Ian) for this help.  I broke down and remade the code and 
behold it works (with this exception).  Oh, Ian, this isn't a class assignment; 
it's a personal project to help me in the process of learning python.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: 2-D drawing/map with python

2013-03-14 Thread Matteo Boscolo

Il 12/03/2013 16:58, Huseyin Emre Guner ha scritto:

Hello,
I am newbie in Python. I would like to make a project using python.
The main ideo of this project is that a user enters the x,y values to  the Gui(PyQt or 
Gtk) and then a 2-D map is plotted due to the x,y values. First, I use Pygame commands 
(pygame.draw.line(window, (255, 255, 255), (10, 10), (200, 400)) However  I 
could not establish a gui with pygame. Now I would like to use the PyQt.  Could you 
please give me advice for this project?
have a look at : http://sourceforge.net/projects/pythoncad/ it's also 
integrated with sympy ..


regards,
Matteo

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


Re: how to couper contenier of a canvas in an outer canvas???

2013-03-14 Thread Rick Johnson
On Thursday, March 14, 2013 7:16:05 AM UTC-5, olsr@gmail.com wrote:
 how to couper all the obejcts in a canvas in an auther canvas?

Hmm, well before i can even start solving your problem, i'll need to spend some 
time figuring out what the hell you're problem is. o_O. Maybe you meant to 
say this:

 how to [copy] all the [canvas items] in [one] canvas [into another] canvas?

 Ahhh, the sweet nectar of articulate communication!

Why would you want to do that exactly? Hopefully you have a good reason. There 
are quite a few canvas items to consider:

* arc objects
* bitmap objects
* image objects
* line objects
* oval objects
* polygon objects
* rectangle objects
* text objects
* window objects

There does not seem to be an easy way to do this via the Tkinter API (feel free 
to dig through the TCL/Tk docs if you like), however, if all you need to do is 
transfer a few simple primitives from one canvas to another, then the following 
(very general and admittedly quite naive) approach might get you there:

for object in canvas1
# create newobject in canvas2
# configure newobject 

But there are quite a few (very important) details that that little sample 
leaves out, for instance: tags, stacking orders, tag bindings, etc. 
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pygame mouse cursor load/unload

2013-03-14 Thread Ian Kelly
On Thu, Mar 14, 2013 at 4:16 PM, Alex Gardner agardner...@gmail.com wrote:
 It's all working now with one exception.  I just want to arrange the paddle 
 to the right side.  I managed to do just that, but it won't move freely 
 vertically.  I am not fully aware of the arguments of pygame.Rect().

I recommend you read the docs, then:

http://www.pygame.org/docs/ref/rect.html

In particular, the clamp method documentation states:

If the rectangle is too large to fit inside, it is centered
inside the argument Rect, but its size is not changed.

This is the case because your bounds_rect has width 0.  I suggest
changing the width of the bounds_rect to be equal to the width of the
paddle.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting a list in user defined selection order

2013-03-14 Thread Terry Reedy

On 3/14/2013 5:34 AM, e.tekin...@gmx.de wrote:

Hello everybody,

I want to select components(vertices) in a particular Order with python.
So when I create a list the main problem is, that maya is not listing the verts 
in the correct selected order as I did.

Here an example:

I have selected from a polySphere the following vtx

[sphere.vtx400, sphere.vtx250, sphere.vtx260, sphere.vtx500, sphere.vtx100]

so maya is giving me a list like that:

[sphere.vtx100, sphere.vtx250, sphere.vtx260, sphere.vtx400, sphere.vtx500]


It is sorting by name.


I know that there is a flag in the cmds.ls that created a list in ordered 
Selection and that you have to enable the tos flag from the selectPref command

cmds.selectPref(tso = 1)
vtx = cmds.ls(os = 1, flatten = 1)
cmds.select(vtx)

But then he gives me an empty list, I also tried to toggle it in the preference 
window, but to be honest that couldn't be the way.

So how can I get a list in an userdefined selection order.

Thank you guys for any help.


This is a maya question rather than a python question. Is not there a 
maye list where you can ask? If not, is a a stackovevflow-like site that 
covers maya?


--
Terry Jan Reedy

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


Re: Pygame mouse cursor load/unload

2013-03-14 Thread Alex Gardner
On Saturday, March 2, 2013 7:56:31 PM UTC-6, Alex Gardner wrote:
 I am in the process of making a pong game in python using the pygame library. 
  My current problem is that when I move the mouse, it turns off as soon as 
 the mouse stops moving.  The way I am doing this is by making the default 
 cursor invisible and using .png files as replacements for the cursor.  
 Perhaps my code would best explain my problem.  I will take help in any way 
 that I can.  Here are the links that contain my code:
 
 
 
 Main class:  http://pastebin.com/HSQzX6h2
 
 Main file (where the problem lies):  http://pastebin.com/67p97RsJ
 
 
 
 If the links yield nothing, please let me know (agardner...@gmail.com)

The docs helped (never knew they were there!) and its all safe and sound for 
now.   Thanks :)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Generating Filenames from Feeds

2013-03-14 Thread Steven D'Aprano
On Thu, 14 Mar 2013 11:19:18 -0700, Chuck wrote:

 Seriously, if you don't post a minimal code example that shows the
 problem and with a full traceback you are asking strangers to do magic
 tricks for your pleasure.
 
 I'm asking more for a better way of generating destination filenames,
 not so much debugging questions.  I only put my attempts there to show
 people that I was actually trying something, and not just relying on
 people to do my thinking for me.
 
 I'm trying to take a feed such as this
 
 http://www.theskepticsguide.org/feed/rss.aspx?feed=SGU
 
 and parse some useful data out of it for a destination filename.  The
 solution should be general, and not just for this particular feed.

There is no such general solution, because some useful data will depend 
on what you intend to do with it, what the feed is, and what *you* 
consider useful.

Your earlier approach is probably fine, once you fix the syntax error.


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


Re: Getting a list in user defined selection order

2013-03-14 Thread e . tekinalp
Am Donnerstag, 14. März 2013 10:34:31 UTC+1 schrieb e.tek...@gmx.de:
 Hello everybody,
 
 
 
 I want to select components(vertices) in a particular Order with python.
 
 So when I create a list the main problem is, that maya is not listing the 
 verts in the correct selected order as I did. 
 
 
 
 Here an example:
 
 
 
 I have selected from a polySphere the following vtx
 
 
 
 [sphere.vtx400, sphere.vtx250, sphere.vtx260, sphere.vtx500, sphere.vtx100]
 
 
 
 so maya is giving me a list like that:
 
 
 
 [sphere.vtx100, sphere.vtx250, sphere.vtx260, sphere.vtx400, sphere.vtx500]
 
 
 
 I know that there is a flag in the cmds.ls that created a list in ordered 
 Selection and that you have to enable the tos flag from the selectPref command
 
 
 
 cmds.selectPref(tso = 1)
 
 vtx = cmds.ls(os = 1, flatten = 1)
 
 cmds.select(vtx)
 
 
 
 But then he gives me an empty list, I also tried to toggle it in the 
 preference window, but to be honest that couldn't be the way.
 
 
 
 So how can I get a list in an userdefined selection order.
 
 
 
 Thank you guys for any help.
 
 
 
 Cheerio
 
 the turkish engineer

ah thank you Terry I was in the wrong group.. XD
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: String performance regression from python 3.2 to 3.3

2013-03-14 Thread Terry Reedy

On 3/14/2013 6:48 AM, rusi wrote:

On Mar 14, 11:47 am, Chris Angelico ros...@gmail.com wrote:
snipped

I expect that Python 3.2 will behave comparably to the 2.6 stats, but
I don't have 3.2s handy - can someone confirm please?


I have 3.2 but not 3.3. Can run it later today if no one does.
But better if someone with both on the same machine do the comparison.


The python devs use the microbenchmarks in 
Tools/stringbench/stringbench.py, which covers all string operations, as 
the basis for improving particular string functions. Overall, Unicode is 
nearly as fast as bytes and 3.3 as fast as 3.2. Find/replace is the 
notable exception in stringbench, so it is an anomaly. Other things are 
faster in 3.3.  In selecting the new implementation, the devs also 
considered space and speed gains that do not show up in microbenchmarks.


--
Terry Jan Reedy

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


Re: String performance regression from python 3.2 to 3.3

2013-03-14 Thread Terry Reedy

On 3/14/2013 7:14 PM, Terry Reedy wrote:

On 3/14/2013 6:48 AM, rusi wrote:

On Mar 14, 11:47 am, Chris Angelico ros...@gmail.com wrote:
snipped

I expect that Python 3.2 will behave comparably to the 2.6 stats, but
I don't have 3.2s handy - can someone confirm please?


I have 3.2 but not 3.3. Can run it later today if no one does.
But better if someone with both on the same machine do the comparison.


The python devs use the microbenchmarks in
Tools/stringbench/stringbench.py, which covers all string operations, as
the basis for improving particular string functions. Overall, Unicode is
nearly as fast as bytes and 3.3 as fast as 3.2. Find/replace is the
notable exception in stringbench, so it is an anomaly. Other things are
faster in 3.3.  In selecting the new implementation, the devs also
considered space and speed gains that do not show up in microbenchmarks.


Links to the readme and code for stringbench can be found here:
http://hg.python.org/cpython/file/c25bc2587c48/Tools/stringbench


--
Terry Jan Reedy

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


Re: how to couper contenier of a canvas in an outer canvas???

2013-03-14 Thread alex23
On Mar 15, 8:24 am, Rick Johnson rantingrickjohn...@gmail.com wrote:
 Hmm, well before i can even start solving your problem, i'll need to
 spend some time figuring out what the hell you're problem is. o_O.
 Maybe you meant to say this:

  how to [copy] all the [canvas items] in [one] canvas [into another] canvas?

  Ahhh, the sweet nectar of articulate communication!

Mocking people for whom English is obviously not their first language
just makes you look petty and racist.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: editing a HTML file

2013-03-14 Thread Dave Angel

On 03/14/2013 02:09 PM, Tracubik wrote:

Hi all,

I'would like to make a script that automatically change some text in a
html file.

I need to make some changes in the text of p tags

My question is: there is a way to just update/substitute the text in
the html p tags or do i have to make a new modified copy of the html
file?

To be clear, i'ld like to make something like this:

open html file
for every p tags:
   if foo in text:
 change foo in bar
close html file

any sample would be really appreciated
I'm really a beginner as you can see

Thanks



As JM points out, you can use Beautiful Soup to parse html.  Then you 
can make structural changes, and write it back out.  Beautiful Soup is 
NOT part of the standard library.


But if you haven't already written something that modifies regular text 
files, I'd do that long before I even started messing with html.  You 
cannot in general update things in place, so you have to think about the 
mechanics of updating, and of minimizing or eliminating the likelihood 
of losing data.


For example, suppose you have a text file (created with any text editor) 
that has just one occurrence of the string Sammy.  You want to replace 
that with the word Gazelda.  Notice the replacement string is longer 
than the original.  Think about how you'd go about it, and write the 
simplest program that would accomplish it.  Then think about what could 
go wrong.  What about if somebody shuts the machine off just as you're 
starting to rewrite the file, or the program crashes just then, or 
whatever ?  So plan to write the replacement file to a new name, and 
after written, do the appropriate renames and delete of the old one.


Don't forget about closing each file, especially if you're going to 
manipulate it with other functions.




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


Re: IOError:[Errno 27] File too large

2013-03-14 Thread Dave Angel

On 03/14/2013 04:12 PM, ch.valdera...@gmail.com wrote:



Taking a wild guess, I think that you are using a Samba share on a Linux

server. A file FILENAME.xml; was accidentally creating on this share

from the Linux filesystem layer, since Linux will allow you to use

semicolons in file names. But samba enforces the same restrictions as

Windows, so when you access the file system through sambda, it gives an

error when you try to create a new file FILENAME.sub;.

This is a wild guess, and could be completely wrong. Please come back and

tell us the solution when you have solved it.


So, let me report the solution.
All the files were in an afs filesystem. afs has a limit for the total length 
of  the filenames per directory. for more details take a look at 
http://www.inf.ed.ac.uk/systems/AFS/topten.html#Tip13
In my case 10k files with ~160characters per filename were just hitting the 
limit. The error message is basically misleading.

Makis



Aha!  So the file that was too large was the directory file.

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


Re: Yet another attempt at a safe eval() call

2013-03-14 Thread Ken Seehart
On 1/4/2013 5:33 AM, Steven D'Aprano wrote:
 On Fri, 04 Jan 2013 07:24:04 -0500, Terry Reedy wrote:

 On 1/3/2013 6:25 PM, Grant Edwards wrote:
 I've written a small assembler in Python 2.[67], and it needs to
 evaluate integer-valued arithmetic expressions in the context of a
 symbol table that defines integer values for a set of names.  The
 right thing is probably an expression parser/evaluator using ast, but
 it looked like that would take more code that the rest of the assembler
 combined, and I've got other higher-priority tasks to get back to.
 Will ast.literal_eval do what you want?
 No. Grant needs to support variables, not just literal constants, hence 
 the symbol table.


Apologies for the delayed response...

Seems like it would be a bit safer and easier to approach this problem
by stretching the capability of ast.literal_eval() rather than
attempting to sandbox eval().

How about ast.literal_eval after performing lexical substitution using
the symbol table?

Assignment into the symbol table, and error handling, are exercises left
to the reader.

Something vaguely like this:

/pseudocode:/

def safe_eval(s, symbols={}):
while search(s, r'\w+'):
replace match with '('+repr(symbols[match])+')' in s
return ast.literal_eval(s)

- Ken

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


changes on windows registry doesn’t take effect immediately

2013-03-14 Thread iMath
changes on windows registry doesn’t take effect immediately

I am trying to change IE’s proxy settings by the following 2 code snippets 

to enable the proxy by this code 

from winreg import *
with 
OpenKey(HKEY_CURRENT_USER,rSoftware\Microsoft\Windows\CurrentVersion\Internet 
Settings ,0, KEY_ALL_ACCESS) as key:
SetValueEx(key,ProxyServer,0, REG_SZ, 127.0.0.1:8087)
SetValueEx(key,ProxyEnable,0, REG_DWORD, 1)
SetValueEx(key,ProxyOverride,0, REG_SZ, local)
FlushKey(key)

to disable the proxy by this code 

from winreg import *
with 
OpenKey(HKEY_CURRENT_USER,rSoftware\Microsoft\Windows\CurrentVersion\Internet 
Settings ,0, KEY_ALL_ACCESS) as key:

DeleteValue(key,ProxyServer)
SetValueEx(key,ProxyEnable,0, REG_DWORD, 0)
DeleteValue(key,ProxyOverride)
FlushKey(key)

but the changes on windows registry doesn’t take effect immediately,so is there 
some way to change the windows registry and let the changes  take effect 
immediately without restarting IE ?

BTW ,I use the code on winxp ,and I am going to embed the 2 code snippets in my 
PyQt application .
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue11656] Debug builds for Windows would be very helpful

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Can this be closed then?

--
nosy: +ezio.melotti
status: open - pending

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



[issue15121] devguide doesn't document all bug tracker components

2013-03-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2889f71c9e20 by Ezio Melotti in branch 'default':
#15121: document the email component.
http://hg.python.org/devguide/rev/2889f71c9e20

--
nosy: +python-dev

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



[issue15121] devguide doesn't document all bug tracker components

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

I documented the email component, and removed the None component.
I'm still not sure what to do about Cross-build -- maybe it should be removed 
as well.  Its name is self-explanatory, so even if it's not removed and it's 
not documented I don't think it's a big deal.

--
assignee:  - ezio.melotti
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - enhancement

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



[issue17044] Implement PEP 422: Simple class initialisation hook

2013-03-14 Thread Nick Coghlan

Nick Coghlan added the comment:

I hadn't noticed that type.__new__ copied the contents (it surprises me that it 
does both that *and* restricts the input type to a true dict instance).

The Extending a class example should still work as shown, since the magic of 
that happens while the body of ExtendedExample is running.

For the order preserving case, it turns out CPython already keeps a copy of the 
original namespace around as cls.__locals__, but this is currently undocumented 
(as far as I can tell anyway).

If we elevate that to documented behaviour, then __init_class__ implementations 
can reference both the original object, as well as the snapshot underlying the 
class object.

Given that, it is probably also better to revert the namespace keyword to 
accepting an instance rather than a factory function, since the copy operation 
after execution of the class body is automatic.

--

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



[issue15917] hg hook to detect unmerged changesets

2013-03-14 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Reviewed the patch - the logic looks okay to me - namely verifying that the 
changeset the merged with the next +0.1, 3.x branch or default.

I tested.

2.7 - push - success.
3.1 - push - fail - merge to 3.2 - fail - merge to default - success.

Looks like a good server-side hgrc hook to have.

--
nosy: +orsenthil

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



[issue14468] Update cloning guidelines in devguide

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


Removed file: http://bugs.python.org/file29394/issue14468-new-faqs.diff

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



[issue14468] Update cloning guidelines in devguide

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

The attached patch fixes the typo and mentions ``hg heads branch``.

 I think a version of your 6 step display would be helpful. It was for me.

The FAQ already describes the general approach (merge heads in each branch and 
then merge branches as usual).  The worst-case scenario that those 6 steps 
address is something that doesn't really happen often (and it's also a bit 
intimidating), so I preferred to leave it out and just describe a more common 
example.

--
Added file: http://bugs.python.org/file29406/issue14468-new-faqs.diff

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



[issue11479] Add discussion of trailing backslash in raw string to tutorial

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage: patch review - commit review

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



[issue17232] Improve -O docs

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

I left a review on rietveld.

--
nosy: +ezio.melotti
stage:  - patch review

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



[issue17403] Robotparser fails to parse some robots.txt

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
nosy: +ezio.melotti
stage:  - test needed

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



[issue11869] Include information about the bug tracker Rietveld code review tool

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Closing this as duplicate of #13963.

--
resolution:  - duplicate
stage: needs patch - committed/rejected
status: open - closed
superseder:  - dev guide has no mention of mechanics of patch review

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



[issue11454] email.message import time

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
stage:  - patch review
versions: +Python 3.4 -Python 3.3

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



[issue1243730] Big speedup in email message parsing

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
versions: +Python 3.4 -Python 3.3

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



[issue6640] urlparse should parse mailto: URL headers as query parameters

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
versions: +Python 3.4 -Python 3.2

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



[issue17413] format_exception() breaks on exception tuples from trace function

2013-03-14 Thread Helmut Jarausch

Helmut Jarausch added the comment:

The problem is caused by the new format_exception in Python's traceback.py 
file. It reads

def format_exception(etype, value, tb, limit=None, chain=True): 
  list = []
  if chain:
 values = _iter_chain(value, tb)
  else:
 values = [(value, tb)]
  for value, tb in values:
  if isinstance(value, str):

and then

def _iter_chain(exc, custom_tb=None, seen=None):
if seen is None:
seen = set()
seen.add(exc)
its = []
context = exc.__context__

As you can see, the new keyword parameter chain is True by default. Thus, 
iter_chain is called by default.

And there you have context= exc.__context__.
Now, if value is an object of type str Python tries to access the __context__ 
field of an object of type str.

And this raises an attribute error.

In an application (pudb) I've used the fixed

exc_info= sys.exc_info()

format_exception(*exc_info,chain=not isinstance(exc_info[1],str))

So, why is the keyword parameter 'chain' True by default.
This causes the problem.

--
nosy: +HJarausch

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



[issue16931] mention work-around to create diffs in default/non-git mode

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

 This can be in a general Mercurial section before the section specific
 to committers, or else spread throughout (e.g. in the FAQ).

FWIW I'm leaning towards making the committing.rst page for committers only, 
and move general instructions for non-committers elsewhere.  For this issue I 
think it might be OK to either add a FAQ about Rietveld that also mentions the 
git format, or possibly include it in a new Rietveld section somewhere in the 
tracker docs (see #13963).

--
stage:  - needs patch
type:  - enhancement

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



[issue15575] Tutorial is unclear on multiple imports of a module.

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy
nosy: +ezio.melotti
stage:  - needs patch

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



[issue10872] Add mode to TextIOWrapper repr

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Should this still be backported on 2.7?

--
keywords: +easy
nosy: +ezio.melotti

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



[issue17413] format_exception() breaks on exception tuples from trace function

2013-03-14 Thread R. David Murray

R. David Murray added the comment:

Because the second argument to format_traceback is supposed to be (is 
documented to be) an exception object.  The fact that it used to work anyway in 
Python2 if you passed a string was an accident of the implementation.  
Likewise, settrace is documented to provide a value, not a string, so the fact 
that it provides a string is a bug.  That needs to be fixed.

(As to specifically why chain defaults to True, it defaults to having the same 
behavior as the normal exception machinery.)

--

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



[issue17414] timeit.timeit not in __all__ even though documented

2013-03-14 Thread Chris Angelico

New submission from Chris Angelico:

The timeit module is commonly used via the convenience function timeit.timeit, 
which is listed in the documentation as the recommended Python Interface:
http://docs.python.org/3/library/timeit.html

However, this function is not listed in __all__, meaning that it does not come 
up in IDLE when Ctrl-Space is pressed. It is also not mentioned in the module 
docstring, which says Library usage: see the Timer class..

Same applies to timeit.repeat(), save that it's not as commonly used. Both are 
listed in the online docs but not in the docstring or __all__.

--
components: Library (Lib)
messages: 184147
nosy: Rosuav, terry.reedy
priority: normal
severity: normal
status: open
title: timeit.timeit not in __all__ even though documented
type: enhancement
versions: Python 2.6, Python 3.3

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



[issue14515] tempfile.TemporaryDirectory documented as returning object but returns name

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, terry.reedy
stage: needs patch - patch review
versions: +Python 3.4

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



[issue17414] timeit.timeit not in __all__ even though documented

2013-03-14 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee:  - docs@python
components: +Documentation
keywords: +easy
nosy: +docs@python, ezio.melotti
stage:  - needs patch
versions: +Python 2.7, Python 3.2, Python 3.4

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



[issue13604] update PEP 393 (match implementation)

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

What's the status of this?

--
nosy: +ezio.melotti

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



[issue3701] test_ntpath.test_relpath fails when launched from a different Windows drive

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Since 3.1 is no longer maintained I'm going to close this.

--
nosy: +ezio.melotti
resolution:  - out of date
stage: needs patch - committed/rejected
status: open - closed

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



[issue9104] test_exceptions does not test pickling with pickle.py

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

 there's an issue about that.

That would be #8273.  See also #17037 and PEP 399.

--
nosy: +ezio.melotti

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



[issue2786] Names in traceback should have class names, if they're methods

2013-03-14 Thread Ezio Melotti

Ezio Melotti added the comment:

Perhaps __qualname__ could be used in the traceback.

--
keywords: +easy
nosy: +ezio.melotti, pitrou
stage:  - needs patch
versions: +Python 3.4 -Python 3.2

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



[issue17415] Documentation Ambiguity 1

2013-03-14 Thread Gurmeet Singh

New submission from Gurmeet Singh:

This is the first time I am creating an issue. I may be doing something wrong. 
I will correct that if you make me aware about it!

Issue with documentation:
Documentation page: http://docs.python.org/3/library/os.path.html
Entry: os.path.normpath(path)
Contention line: It should be understood that this may change the meaning of 
the path if it contains symbolic links!

Ambiguity Source: Contention line immediately follows the line On Windows, it 
converts forward slashes to backward slashes. relating contention line to also 
windows.

Ambiguity: I think (i.e. I do not know for sure) that, the contention line 
should apply to all OS, not just windows. for example, .. after a symlink 
should, according to me, remove the symlink itself by the normpath function. 
This would be an incorrect behaviour of the normpath (I consider that 
incorrect). Hence, should be documented for all OS.

--
assignee: docs@python
components: Documentation
messages: 184152
nosy: docs@python, gsingh
priority: normal
severity: normal
status: open
title: Documentation Ambiguity 1
type: enhancement
versions: Python 3.3

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



[issue17416] Documentation Ambiguity 2

2013-03-14 Thread Gurmeet Singh

New submission from Gurmeet Singh:

Source page: http://docs.python.org/3/library/os.html
Entry: os.walk(...)

Ambiguity Source: Name of the argument TopDown and / or its description.

The TopDown name is misleading to me. I would suggest BFS or DFS instead. 
TopDown false would imply to me that the traversal would run bottom up from 
the directory mentioned in the argument list (even though the name of that 
argument is top, it is confusing indicating a possibility of another naming 
mistake instead!)

--
assignee: docs@python
components: Documentation
messages: 184153
nosy: docs@python, gsingh
priority: normal
severity: normal
status: open
title: Documentation Ambiguity 2
type: enhancement
versions: Python 3.3

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



[issue12684] profile does not dump stats on exception like cProfile does

2013-03-14 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

I wasn't aware of this issue (sorry) and I have already fixed this back in cset 
422169310b7c for the 3.4 branch.
2.7, 3.2 and 3.3 branches can still be fixed though.

--
versions: +Python 2.7 -Python 3.4

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



[issue17417] Documentation Modification Suggestion: os.walk, fwalk

2013-03-14 Thread Gurmeet Singh

New submission from Gurmeet Singh:

Source page: http://docs.python.org/3/library/os.html
Entry: os.walk(...), os.fwalk()

These functions seems to be a generator functions. An expert like yourself may 
have no trouble to make this out. But for novice (or for people out of touch) 
like myself would have preferred a starting line of this function as A 
generator function that generates file names , rather than currently 
Generates file names

--
assignee: docs@python
components: Documentation
messages: 184155
nosy: docs@python, gsingh
priority: normal
severity: normal
status: open
title: Documentation Modification Suggestion: os.walk, fwalk
type: enhancement
versions: Python 3.3

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



[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-14 Thread Vinay Sajip

Vinay Sajip added the comment:

I don't believe this is logging-related - it relates to how you can rename open 
files on POSIX. Both loggers use the same file, until rollover - thereafter, 
they use different files, resulting in the behaviour you saw. To illustrate, 
run the following script on your system, which has no logging code:

# rotest.py
import os

FN = 'dummy-%s.log' % os.getpid()

print('Using %s' % FN)

fa = open(FN, 'a')
fb = open(FN, 'a')

aline = 'a' * 40 + '\n'
bline = 'b' * 40 + '\n'

for i in range(5):
if i == 2:
# simulate rollover of a
fa.write('Rolling over - a\n'); fa.flush()
fa.close()
os.rename(FN, FN + '.1')
fa = open(FN, 'a')
fa.write('Rolled over - a\n'); fa.flush()
if i == 3:
# simulate rollover of b
fb.write('Rolling over - b\n'); fa.flush()
fb.close()
os.rename(FN + '.1', FN + '.2')
os.rename(FN, FN + '.1')
fb = open(FN, 'a')
fb.write('Rolled over - b\n'); fa.flush()
fa.write(aline); fa.flush()
fb.write(bline); fb.flush()

When run, I get the following results:

$ python rotest.py
Using dummy-2320.log
$ cat dummy-2320.log
Rolled over - b


$ cat dummy-2320.log.1
Rolled over - a



$ cat dummy-2320.log.2




Rolling over - a

Rolling over - b

As in your case, the oldest file contains both 'a' and 'b' lines, but after 
rollover, 'a' and 'b' lines are segregated.

Note that the script (and your approach) won't work on Windows, because there 
you can't rename open files (one handler has the file open even when the other 
has closed it).

Based on the above, I'm marking this issue as invalid. For obvious reasons, the 
approach you are using here is not recommended.

--
resolution:  - invalid
status: open - closed

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



[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-14 Thread Vinay Sajip

Vinay Sajip added the comment:

BTW in the example script I do fa.flush() a couple of times when I meant to do 
fb.flush() (in the i == 3 clause). The result is the same after correcting this.

--

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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2013-03-14 Thread Piotr Dobrogost

Piotr Dobrogost added the comment:

 I don't understand whether you are proposing to include the patch into Python 
 as-is;

I think Richard is well aware of the constraints you specify and current patch 
was meant as a proof of concept; to show that all tests pass with such a 
change. Of course that's only my belief and we shall see what Richard has to 
say.

 That said, having maximum sharing when opnening files sounds fine to me.

Good to hear. However I started to wonder if we are ready for all consequences 
of this. For example taking into account what Richard noted in 
http://bugs.python.org/issue14243, specifically:

 Unfortunately using O_TEMPORARY is the only way allowed by msvcrt to
 get FILE_SHARE_DELETE, even though it also has the orthogonal effect
 of unlinking the file when all handles are closed.

forces programs which would like to open a file being opened at the same time 
by Python code (by means of built-in open() or os.open() with default 
arguments) to either use O_TEMPORARY when using msvcrt or to go low level and 
use CreateFile() Win32 API function with FILE_SHARE_DELETE flag. Are we ok with 
it?

--

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



[issue11420] Make testsuite pass with -B/DONTWRITEBYTECODE set.

2013-03-14 Thread Berker Peksag

Berker Peksag added the comment:

+skip_if_dont_write_bytecode = unittest.skipIf(
+sys.dont_write_bytecode,
+test meaningful only when writing bytecode)

Maybe this could be added to the test.support module?

--
nosy: +berker.peksag

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



[issue17414] timeit.timeit not in __all__ even though documented

2013-03-14 Thread Anuj Gupta

Anuj Gupta added the comment:

I'm a new contributor so, not sure if I'm missing anything:

The issue seems straightforward to me, the exports should definitely be 
included in both - the docstring and __all__. Also, default_timer is documented 
and should be imported as well.

I've contributed a patch for the dev version. After a review, I can submit 
patches for all remaining versions.

Thanks!

--
keywords: +patch
nosy: +anuj
Added file: http://bugs.python.org/file29407/timeit_exports.diff

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



[issue17390] display python version on idle title bar

2013-03-14 Thread bagrat lazaryan

bagrat lazaryan added the comment:

good. thank you.

i'm not sure about the architecture. i understand it's not crucial for most of 
the users. i would like to have it though.

--

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



[issue1222585] C++ compilation support for distutils

2013-03-14 Thread Jeroen Demeyer

Changes by Jeroen Demeyer jdeme...@cage.ugent.be:


--
nosy: +jdemeyer

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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2013-03-14 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Am 14.03.13 03:31, schrieb Piotr Dobrogost:
 forces programs which would like to open a file being opened at the
 same time by Python code (by means of built-in open() or os.open()
 with default arguments) to either use O_TEMPORARY when using msvcrt
 or to go low level and use CreateFile() Win32 API function with
 FILE_SHARE_DELETE flag. Are we ok with it?

That's why I was asking for an actual patch. The proposed change may
well not be implementable. If os.open continues to create CRT handles,
a way needs to be found to get a CRT handle that as the
FILE_SHARE_DELETE bit set.

An alternative approach could be that os.open stops creating CRT
handles, and directly uses OS handles. The problem with that is that
stdin/stdout/stderr would stop being 0/1/2, which is not acceptable.
An alternative solution to that could be that we introduce a notion
of python io handles, parallel, but indepedendent from CRT handles.
And so on.

--

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



[issue11656] Debug builds for Windows would be very helpful

2013-03-14 Thread Martin v . Löwis

Changes by Martin v. Löwis mar...@v.loewis.de:


--
resolution:  - wont fix
status: pending - closed

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



[issue8918] distutils test_config_cmd failure on Solaris

2013-03-14 Thread alef

alef added the comment:

The same happens with AIX 6.1 using xlc 10.1. Using -P implies removing -o 
output_file. The resulting _configtest.i is anyhow empty, even using -qppline.

--
nosy: +alef

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



[issue11188] test_time error on AIX

2013-03-14 Thread alef

Changes by alef alessandro.for...@eumetsat.int:


--
nosy: +alef

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



[issue11192] test_socket error on AIX

2013-03-14 Thread alef

Changes by alef alessandro.for...@eumetsat.int:


--
nosy: +alef

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



[issue11190] test_locale error on AIX

2013-03-14 Thread alef

Changes by alef alessandro.for...@eumetsat.int:


--
nosy: +alef

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



[issue15477] test_cmath failures on OS X 10.8

2013-03-14 Thread alef

Changes by alef alessandro.for...@eumetsat.int:


--
nosy: +alef

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



[issue15477] test_cmath failures on OS X 10.8

2013-03-14 Thread alef

Changes by alef alessandro.for...@eumetsat.int:


--
nosy:  -alef

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



[issue9920] test_cmath on atan fails on AIX

2013-03-14 Thread alef

Changes by alef alessandro.for...@eumetsat.int:


--
nosy: +alef

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



[issue15244] Support for opening files with FILE_SHARE_DELETE on Windows

2013-03-14 Thread Richard Oudkerk

Richard Oudkerk added the comment:

On 14/03/2013 1:00pm, Martin v. Löwis wrote:
 That's why I was asking for an actual patch. The proposed change may
 well not be implementable. If os.open continues to create CRT handles,
 a way needs to be found to get a CRT handle that as the
 FILE_SHARE_DELETE bit set.

The patch *does* create CRT fds from win32 handles by using 
msvcrt.open_osfhandle().

One other issue is that I do not know of a way to determine the current 
umask without temporarily changing it, causing a thread-race.

In the end I am not sure it is worth the hassle.  (But maybe it would be 
a good idea to add test.support.open() using FILE_SHARE_DELETE and 
test.support.unlink() to make the testsuite more resilient to 
Permission Denied errors.)

 An alternative approach could be that os.open stops creating CRT
 handles, and directly uses OS handles. The problem with that is that
 stdin/stdout/stderr would stop being 0/1/2, which is not acceptable.
 An alternative solution to that could be that we introduce a notion
 of python io handles, parallel, but indepedendent from CRT handles.
 And so on.

http://bugs.python.org/issue12939 has C implementations of _io.WinFileIO 
and _io.openhandle() which are equivalents for _io.FileIO and os.open() 
which use native Windows handles.

--

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



[issue13918] locale.atof documentation is missing func argument

2013-03-14 Thread Stefan Krah

Stefan Krah added the comment:

I agree with won't fix for the original issue. These locale functions
are in effect superseded by PEP 3101 formatting.

For decimal locale specific formatting, use:

format(Decimal(1729.1415927), n)


IOW, I don't think new formatting functions should be added to the
locale module.

--
status: open - closed

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



[issue17418] Documentation Bug

2013-03-14 Thread Gurmeet Singh

New submission from Gurmeet Singh:

Incompletely explained documentation at 2 places:

1. http://docs.python.org/3/library/functions.html#open

The buffering argument is not correctly explained when setting to a positive 
argument in binary mode.

2. http://docs.python.org/3/library/os.html#os.open

It is not very clear where to find descriptions of the arguments of this 
function. Where to find the required information and where to find C run-time 
documentation could be explained in following preferably:
(Python/C API Reference Manual) http://docs.python.org/3/c-api/index.html and / 
or 
(The Python Standard Library) http://docs.python.org/3/library and  / or 
(Python Runtime Services) http://docs.python.org/3/library/python.html 

A hyperlink may be added if so felt.

--
assignee: docs@python
components: Documentation
messages: 184166
nosy: docs@python, gsingh
priority: normal
severity: normal
status: open
title: Documentation Bug
versions: Python 3.3

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



[issue13918] locale.atof documentation is missing func argument

2013-03-14 Thread Cédric Krier

Cédric Krier added the comment:

locale.atof is not about formatting but parsing string into float following the 
locale.
For now, the only ways I see to parse a string to get a Decimal is to first 
convert it into float (which is not good if precision matters) or to use the 
undocumented parameter.

--
status: closed - open

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



[issue13918] locale.atof documentation is missing func argument

2013-03-14 Thread Stefan Krah

Stefan Krah added the comment:

Cédric Krier rep...@bugs.python.org wrote:
 locale.atof is not about formatting but parsing string into float following 
 the locale.

You're right. Sorry, I never use these locale functions. My impression is
that locales are often buggy or differ across platforms (see #16944).

So actually I now agree that making the parameter official is one reasonable
solution.

--

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



[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-14 Thread James Kesser

James Kesser added the comment:

My approach was just as outlined in the first few paragraphs here, just naming 
loggers for each module using __name__:

http://docs.python.org/2/howto/logging.html#logging-advanced-tutorial

If this is not recommended the documentation should be updated to reflect this.

In my project, I can work around this by having all modules use the same logger 
instance and just printing the module name in the Formatter instead of the 
logger name.

--

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



[issue17407] RotatingFileHandler issue when using multiple loggers instances (but one process/thread) to the same file

2013-03-14 Thread James Kesser

James Kesser added the comment:

Thanks for quick response!

--

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



[issue17419] bdist_wininst installer should allow install in user directory

2013-03-14 Thread Sergio Callegari

New submission from Sergio Callegari:

When installing a package by calling setup you have a --user option to install 
the package for a single user in his disk area.

E.g.,

python setup.py install --user

A similar possibility should be offered via the windows installer

An exe created by

python setup.py bdist_wininst

when run should offer a tickbox to install in the user disk area rather than 
globally.

--
messages: 184171
nosy: Sergio.Callegari
priority: normal
severity: normal
status: open
title: bdist_wininst installer should allow install in user directory
versions: Python 2.7

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



[issue17420] bdist_wininst does not play well with unicode descriptions

2013-03-14 Thread Sergio Callegari

New submission from Sergio Callegari:

When creating an installer with bdist_wininst, any unicode characters in the 
description and long_description fields get mangled when running the installer.

--
messages: 184172
nosy: Sergio.Callegari
priority: normal
severity: normal
status: open
title: bdist_wininst does not play well with unicode descriptions
versions: Python 2.7

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



[issue17413] format_exception() breaks on exception tuples from trace function

2013-03-14 Thread Andreas Kloeckner

Andreas Kloeckner added the comment:

Thanks for the suggestion. Since 3.2 and 3.3 will be with us for a while, I've 
implemented the workaround you've suggested. Works, too. :)

--

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



[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2013-03-14 Thread paul j3

paul j3 added the comment:

If nargs=2, type=float, an argv like '1e4 -.002' works, but '1e4 -2e-3' 
produces the same error as discussed here.  The problem is that 
_negative_number_matcher does not handle scientific notation.  The proposed 
generalize matcher, r'^-.+$', would solve this, but may be overkill.

I'm not as familiar with optparse and other argument processes, but I suspect 
argparse is different in that it processes the argument strings twice.  On one 
loop it parses them, producing an arg_strings_pattern that looks like 'OAA' (or 
'OAO' in these problem cases).  On the second loop is consumes the strings 
(optionals and positionals).  This gives it more power, but produces problems 
like this if the parsing does not match expectations.

--
nosy: +paul.j3

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



  1   2   >