Announcement - Learning NumPy Array

2014-06-30 Thread Priyanka Budkuley

Hi,

I am pleased to inform you about the Publication of Learning NumPy 
Array http://bit.ly/UyKBJ1 by Ivan Idris. This book is a step-by-step 
guide which gives a comprehensive overview of Nympy.



Now that the book is published, I am looking for people who can review 
our new title on their Blog/Website and Amazon/Goodreads. In case you 
are interested in taking a look at the book and giving us your honest 
thoughts on it, I'll be happy to provide you with an e-copy.


At the same time, I am delighted to inform you that its been 10 years 
since Packt Publishing embarked on its mission to deliver effective 
learning and information services to IT professionals. To celebrate this 
successful journey, Packt is offering all of its eBooks and Videos at 
just $10 each for 10 days -- this promotion covers every title and 
customers can stock up on as many copies as they like until July 5th.

Looking forward to hear from you.

Thanks and Regards,
--

*Priyanka Budkuley**
Marketing Research Executive*
Packt Publishing | www.PacktPub.com http://www.packtpub.com/
Email and Skype*:* priyankabudku...@packtpub.com 
mailto:priyankabudku...@packtpub.com
For any feedback on my interaction, mail us at - 
marketingfeedb...@packtpub.com 
mailto:marketingfeedb...@packtpub.com?subject=Interaction%20Feedback:%20Priyanka%20Budkuley



Twitter: @priyankabudkule https://twitter.com/PriyankaBudkule
//
--
https://mail.python.org/mailman/listinfo/python-announce-list

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


Translation of Python!

2014-06-30 Thread Doriven Basha
Hello everybody!
I want to translate python into albanian language because it's very flexible 
and similar to english words used in programming.Can anybody help me to start 
translation of the python the programm used or anything else to get started 
with programming translation???I can do it by myself but i want the road how to 
do it???Please help me !
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Translation of Python!

2014-06-30 Thread INADA Naoki
Do you mean translating official document?

We are translating docs into Japanese using Transifex.
https://www.transifex.com/projects/p/python-33-ja/

But I hope PSF have official project on Transifex.

On Mon, Jun 30, 2014 at 4:24 PM, Doriven Basha dori...@live.com wrote:
 Hello everybody!
 I want to translate python into albanian language because it's very flexible 
 and similar to english words used in programming.Can anybody help me to start 
 translation of the python the programm used or anything else to get started 
 with programming translation???I can do it by myself but i want the road how 
 to do it???Please help me !
 --
 https://mail.python.org/mailman/listinfo/python-list



-- 
INADA Naoki  songofaca...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


[Q] override __init__() method of classes implemented in C

2014-06-30 Thread Makoto Kuwata
Is it impossible to override __init__() method of classes
implemented in C (such as datetime.datetime) ?


example.py:

from datetime import datetime
 class Foo(datetime):
def __init__(self):
pass
 obj = Foo()


Result (Python 2.7.7 and 3.4.1):

Traceback (most recent call last):
  File hoge.py, line 7, in module
obj = Foo()
TypeError: Required argument 'year' (pos 1) not found


It seems to be failed to override datetime.__init__() in subclass.


--
regards,
makoto kuwata
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [Q] override __init__() method of classes implemented in C

2014-06-30 Thread Chris Angelico
On Mon, Jun 30, 2014 at 5:45 PM, Makoto Kuwata k...@kuwata-lab.com wrote:
 Result (Python 2.7.7 and 3.4.1):

 Traceback (most recent call last):
  File hoge.py, line 7, in module
obj = Foo()
 TypeError: Required argument 'year' (pos 1) not found


 It seems to be failed to override datetime.__init__() in subclass.


Actually, __init__ isn't the problem here, __new__ is.

class Foo(datetime):
def __new__(self):
return super().__new__(self,2014,1,1)

 Foo()
Foo(2014, 1, 1, 0, 0)

Maybe that helps, maybe it doesn't, but the issue you're seeing is
specific to that class.

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


Re: [Q] override __init__() method of classes implemented in C

2014-06-30 Thread Makoto Kuwata
On Mon, Jun 30, 2014 at 4:52 PM, Chris Angelico ros...@gmail.com wrote:


 Actually, __init__ isn't the problem here, __new__ is.

 class Foo(datetime):
 def __new__(self):
 return super().__new__(self,2014,1,1)

  Foo()
 Foo(2014, 1, 1, 0, 0)

 Maybe that helps, maybe it doesn't, but the issue you're seeing is
 specific to that class.


Got it! Thank you!

--
regards,
makoto kuwata
-- 
https://mail.python.org/mailman/listinfo/python-list


Python While loop Takes too much time.

2014-06-30 Thread Jaydeep Patil
I have did excel automation using python.
In my code I am creating python dictionaries for different three columns data 
at a time.There are are many rows above 4000. Lets have look in below function. 
Why it is taking too much time?

Code:

def transientTestDict(self,ws,startrow,startcol):

self.hwaDict = OrderedDict()
self.yawRateDict = OrderedDict()

rng = ws.Cells(startrow,startcol)

while not rng.Value is None:
r = rng.Row
c = rng.Column

time = rng.Value

rng1 = rng.GetOffset(0,1)
hwa = rng1.Value

rng2 = rng.GetOffset(0,2)
yawrate = rng2.Value

self.hwaDict[time] = hwa,rng.Row,rng.Column
self.yawRateDict[time] = yawrate,rng.Row,rng.Column

rng = ws.Cells(r+1,c)



Please have look in above code  suggest me to improve speed of my code.



Regards
Jaydeep Patil
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python While loop Takes too much time.

2014-06-30 Thread Peter Otten
Jaydeep Patil wrote:

 I have did excel automation using python.
 In my code I am creating python dictionaries for different three columns
 data at a time.There are are many rows above 4000. Lets have look in below
 function. Why it is taking too much time?
 
 Code:
 
 def transientTestDict(self,ws,startrow,startcol):
 
 self.hwaDict = OrderedDict()
 self.yawRateDict = OrderedDict()
 
 rng = ws.Cells(startrow,startcol)
 
 while not rng.Value is None:
 r = rng.Row
 c = rng.Column
 
 time = rng.Value
 
 rng1 = rng.GetOffset(0,1)
 hwa = rng1.Value
 
 rng2 = rng.GetOffset(0,2)
 yawrate = rng2.Value
 
 self.hwaDict[time] = hwa,rng.Row,rng.Column
 self.yawRateDict[time] = yawrate,rng.Row,rng.Column
 
 rng = ws.Cells(r+1,c)
 
 
 
 Please have look in above code  suggest me to improve speed of my code.

Assuming that what slows down things is neither Python nor Excel, but the 
communication between these I'd try to do as much as possible in Python. For 
example (untested):

def transientTestDict(self, ws, startrow, startcol):
self.hwaDict = OrderedDict()
self.yawRateDict = OrderedDict()

time_col, hwa_col, yawrate_col = range(startcol, startcol+3)

for row in xrange(startrow, sys.maxint):
time = ws.Cells(row, time_col).Value
if time is None:
break
hwa = ws.Cells(row, hwa_col).Value
yawrate = ws.Cells(row, yawrate_col).Value

self.hwaDict[time] = hwa, row, time_col
self.yawRateDict[time] = yawrate, row, time_col

While this avoids cell arithmetic in Excel it still fetches every value 
separately, so I have no idea if there is a significant effect.

Does Excel provide a means to get multiple cell values at once? That would 
likely help.


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


Re: [OT] What can Nuitka do?

2014-06-30 Thread Michael Torrie
On 06/28/2014 09:16 AM, Chris Angelico wrote:
 I remember approx. 10 years ago a neighboring dept. at my work effectively
 killed our 10 MB/s Ethernet segment with such traffic (due to a
 misconfigured switch/router?). Running an ethernet analyzer showed a single
 X11 host-server session occupied ~80% bandwidth.  AFAICR, it was a Sun
 workstation.
 A real PITA.
 
 Either that was a horribly inefficient X11 connection (as mine was -
 the virtual machine sent basically a constantly-updated bitmapped
 image to rdesktop, which then couldn't do anything more efficient than
 feed that image to the X server), or something was horribly
 misconfigured. I've frequently done much more reasonable X11
 forwarding, with high success and low traffic;

Only the most primitive X11 apps are at all fast over network
forwarding.  If the app uses any modern toolkit, then it's basically
just sending a bunch of bitmaps over the wire (changes), which would be
fine, but X11 involves a lot of server round trips.  Forwarding works
fine over SSH on a LAN (compression with -X helps too), but anything
slower than that is very nearly unusable.  I used to run XEmacs over a
modem (I know; I just preferred it to Emacs and I didn't know ViM), and
it worked great with server-side drawing and fonts, as X11 was designed
to do 90s-style.  But now if I need to run X11 apps over a slower link
these days I use OpenNX which dramatically helps by eliminating round
trips, and applying bitmap compression.  But the fact remains X11 kind
of sucks these days, and network transparency now basically means a
slightly suckier version of VNC in effect.  RDP protocol is actually
much more efficient than X11 forwarding with modern apps.  So your
rdesktop example is actually not a horribly inefficient X11 connection,
other than the fact that X11 is inefficient.  Honestly once Wayland has
per-app RDP built into it, there'll be no reason at all to cheer for X11.

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


Re: [OT] What can Nuitka do?

2014-06-30 Thread Chris Angelico
On Mon, Jun 30, 2014 at 11:10 PM, Michael Torrie torr...@gmail.com wrote:
 Only the most primitive X11 apps are at all fast over network
 forwarding.  If the app uses any modern toolkit, then it's basically
 just sending a bunch of bitmaps over the wire (changes), which would be
 fine, but X11 involves a lot of server round trips.  Forwarding works
 fine over SSH on a LAN (compression with -X helps too), but anything
 slower than that is very nearly unusable.  I used to run XEmacs over a
 modem (I know; I just preferred it to Emacs and I didn't know ViM), and
 it worked great with server-side drawing and fonts, as X11 was designed
 to do 90s-style.  But now if I need to run X11 apps over a slower link
 these days I use OpenNX which dramatically helps by eliminating round
 trips, and applying bitmap compression.  But the fact remains X11 kind
 of sucks these days, and network transparency now basically means a
 slightly suckier version of VNC in effect.  RDP protocol is actually
 much more efficient than X11 forwarding with modern apps.  So your
 rdesktop example is actually not a horribly inefficient X11 connection,
 other than the fact that X11 is inefficient.  Honestly once Wayland has
 per-app RDP built into it, there'll be no reason at all to cheer for X11.

Hmm. I'm not sure that it's necessarily that bad; I've done 3G-based
X11 forwarding fairly successfully on occasion. Yes, it's potentially
quite slow, but it certainly works - I've used SciTE, for instance,
and I've used some GTK2 apps without problems. What do you mean by
modern toolkit?

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


Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
As a diagnostic tool, I would like to create a dict-like class
that counts successful and failed key matches by key. By failed
I mean in the sense that a default value was returned vs. an
exception raised. By count, I mean by tracking counts for
individual keys vs. just total success/failure counts. The
class needs to support setting values, retrieving values, and
retrieving keys, items, and key/item pairs. Basically anything
that a regular dict, I'd like my modified class to do as well.
Use case: I'm curious to see what key's we're missing that our
code is using default to provide and I'm also interested in
looking at our high frequency keys as a way to double check our
processes.
Is this a common pattern covered by the standard lib (I don't
see anything in collections)?
I'm looking for ideas on how to implement ... as a subclass of
Dict, as a duck-like class offering Dict like methods, other?
I'm also looking for some hints on what magic methods I should
override to accomplish my goal, eg. beyond __getitem__.
Thank you,
Malcolm
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
After some additional research, it looks like I may have even
more options to consider including using a UserDict mixin.



I think I've identified another magic method to subclass ...
__missing__.





- Original message -

From: [1]pyt...@bdurham.com

To: [2]python-list@python.org

Subject: Creating a dict-like class that counts successful and
failed key matches

Date: Mon, 30 Jun 2014 09:43:49 -0400



As a diagnostic tool, I would like to create a dict-like class
that counts successful and failed key matches by key. By failed
I mean in the sense that a default value was returned vs. an
exception raised. By count, I mean by tracking counts for
individual keys vs. just total success/failure counts. The
class needs to support setting values, retrieving values, and
retrieving keys, items, and key/item pairs. Basically anything
that a regular dict, I'd like my modified class to do as well.



Use case: I'm curious to see what key's we're missing that our
code is using default to provide and I'm also interested in
looking at our high frequency keys as a way to double check our
processes.



Is this a common pattern covered by the standard lib (I don't
see anything in collections)?



I'm looking for ideas on how to implement ... as a subclass of
Dict, as a duck-like class offering Dict like methods, other?



I'm also looking for some hints on what magic methods I should
override to accomplish my goal, eg. beyond __getitem__.



Thank you,

Malcolm



--

[3]https://mail.python.org/mailman/listinfo/python-list

References

1. mailto:pyt...@bdurham.com
2. mailto:python-list@python.org
3. https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Chris Angelico
On Mon, Jun 30, 2014 at 11:43 PM,  pyt...@bdurham.com wrote:
 As a diagnostic tool, I would like to create a dict-like class that counts
 successful and failed key matches by key. By failed I mean in the sense that
 a default value was returned vs. an exception raised. By count, I mean by
 tracking counts for individual keys vs. just total success/failure counts.
 The class needs to support setting values, retrieving values, and retrieving
 keys, items, and key/item pairs. Basically anything that a regular dict, I'd
 like my modified class to do as well.

Sounds like you want to subclass dict, then. Something like this:

class StatsDict(dict):
def __init__(self, *a, **ka):
super().__init__(*a, **ka)
self.success = defaultdict(int)
self.fail = defaultdict(int)
def __getitem__(self, item):
try:
ret = super().__getitem__(item)
self.success[item] += 1
return ret
except KeyError:
self.fail[item] += 1
raise

On initialization, set up some places for keeping track of stats. On
item retrieval (I presume you're not also looking for stats on item
assignment - for that, you'd want to also override __setitem__),
increment either the success marker or the fail marker for that key,
based exactly on what you say: was something returned, or was an
exception raised.

To get the stats, just look at the success and fail members:

 d = StatsDict()
 d[foo]=1234
 d[foo]
1234
 d[spam]
(chomp)
KeyError: 'spam'
 d[foo]
1234
 d[foo]
1234
 d[test]
(chomp)
KeyError: 'test'
 len(d.success) # Unique successful keys
1
 len(d.fail) # Unique failed keys
2
 sum(d.success.values()) # Total successful lookups
3
 sum(d.fail.values()) # Total unsuccessful lookups
2

You can also interrogate the actual defaultdicts, eg to find the hottest N keys.

For everything other than simple key retrieval, this should function
identically to a regular dict. Its repr will be a dict's repr, its
iteration will be its keys, all its other methods will be available
and won't be affected by this change. Notably, the .get() method isn't
logged; if you use that and want to get stats for it, you'll have to
reimplement it - something like this:

def get(self, k, d=None):
try:
return self[k]
except KeyError:
return d

The lookup self[k] handles the statisticking, but if you let this go
through to the dict implementation of get(), it seems to ignore
__getitem__.

This probably isn't exactly what you want, but it's a start, at least,
and something to tweak into submission :)

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


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
Hi Chris,

 Sounds like you want to subclass dict, then. Something like this:

Nice!!! 

I need to study your solution, but at first blush it looks exactly like
what I wanted to implement.

Thank you!
Malcolm
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Ethan Furman

On 06/30/2014 07:44 AM, pyt...@bdurham.com wrote:


Nice!!!

I need to study your solution, but at first blush it looks exactly like
what I wanted to implement.


Keep in mind that dict /will not/ call your overridden methods, so if, for example, you provide your own __getitem__ you 
will also need to provide your own copies of any dict method that calls __getitem__.


--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
Ethan,

 Keep in mind that dict /will not/ call your overridden methods, so if, for 
 example, you provide your own __getitem__ you 
will also need to provide your own copies of any dict method that calls
__getitem__.

I'm not sure I understand. Are you saying that Chris's __getitem__ will
not be called by other dict methods that would normally call this magic
method and instead call the parent's __getitem__ directly (via super()
or something similar?)?

Is this specific to the native Dict class (because its implemented in C
vs. Python?) or is this behavior more general.

Malcolm
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Ethan Furman

On 06/30/2014 09:47 AM, pyt...@bdurham.com wrote:


Keep in mind that dict /will not/ call your overridden methods, so if,
for example, you provide your own __getitem__ you will also need to
provide your own copies of any dict method that calls __getitem__.


I'm not sure I understand. Are you saying that Chris's __getitem__ will
not be called by other dict methods that would normally call this magic
method and instead call the parent's __getitem__ directly (via super()
or something similar?)?


That is what I am saying.



Is this specific to the native Dict class (because its implemented in C
vs. Python?) or is this behavior more general.


I /think/ it's only dict, but I haven't played with subclassing lists, tuples, etc.  It's not a C vs Python issue, but a 
'implemented with __private methods' issue.  From what I have seen so far in the confusion and frustration that decision 
has caused, I do not think it was a good one.  :(


--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python While loop Takes too much time.

2014-06-30 Thread marco . nawijn
On Monday, June 30, 2014 1:32:23 PM UTC+2, Jaydeep Patil wrote:
 I have did excel automation using python.
 
 In my code I am creating python dictionaries for different three columns data 
 at a time.There are are many rows above 4000. Lets have look in below 
 function. Why it is taking too much time?
 
 
 
 Code:
 
 
 
 def transientTestDict(self,ws,startrow,startcol):
 
 
 
 self.hwaDict = OrderedDict()
 
 self.yawRateDict = OrderedDict()
 
 
 
 rng = ws.Cells(startrow,startcol)
 
 
 
 while not rng.Value is None:
 
 r = rng.Row
 
 c = rng.Column
 
 
 
 time = rng.Value
 
 
 
 rng1 = rng.GetOffset(0,1)
 
 hwa = rng1.Value
 
 
 
 rng2 = rng.GetOffset(0,2)
 
 yawrate = rng2.Value
 
 
 
 self.hwaDict[time] = hwa,rng.Row,rng.Column
 
 self.yawRateDict[time] = yawrate,rng.Row,rng.Column
 
 
 
 rng = ws.Cells(r+1,c)
 
 
 
 
 
 
 
 Please have look in above code  suggest me to improve speed of my code.
 
 
 
 
 
 
 
 Regards
 
 Jaydeep Patil

Hi Jaydeep,

I agree with Peter. I would avoid moving from cell to
cell through the EXCEL interface if you can avoid.

If possible, I would try to read ranges from EXCEL into
a python list (or maybe numpy arrays) and do the processing
in Python. In the past I even dumped an EXCEL sheet as a
CSV file and then used the numpy recfromcsv function to 
process the data.

If you are really brave, dump EXCEL alltogether :) and do
all the work in Python (have you already tried IPython 
notebook?).

Regards,

Marco

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


Re: Translation of Python!

2014-06-30 Thread Doriven Basha
I want to translate it into my language like the chinese python 
https://code.google.com/p/zhpy/w/list?q=label:Chinese
can you help me?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Translation of Python!

2014-06-30 Thread Doriven Basha
On Monday, June 30, 2014 8:37:43 PM UTC+2, Doriven Basha wrote:
 I want to translate it into my language like the chinese python 
 https://code.google.com/p/zhpy/w/list?q=label:Chinese
 
 can you help me?

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


unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread RainyDay
Hi, in python 3.4.1, I get this surpising behaviour:

 l=Loc(0,0)
 l2=Loc(1,1)
 ll2
False
 ll2
True
 l=l2
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unorderable types: Loc() = Loc()
 l==l2
False
 ll2 or l==l2
True

Loc implements both __lt__ and __eq__, which should be enough (?),
but even after I've added __lte__, I still have the error.

implementation:

class Loc:
def __init__(self, x, y):
self._loc = x, y
self.x, self.y = x, y

def __eq__(self, other):
return self._loc == getattr(other, _loc, None)

def __lt__(self, other):
return self._loc  other._loc

 - andrei
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Writing Multiple files at a times

2014-06-30 Thread subhabangalore
On Sunday, June 29, 2014 4:19:27 PM UTC+5:30, subhaba...@gmail.com wrote:
 Dear Group,
 
 
 
 I am trying to crawl multiple URLs. As they are coming I want to write them 
 as string, as they are coming, preferably in a queue. 
 
 
 
 If any one of the esteemed members of the group may kindly help.
 
 
 
 Regards,
 
 Subhabrata Banerjee.

Dear Group,

Thank you for your kind suggestion. But I am not being able to sort out,
fp = open( scraped/body{:05d}.htm.format( n ), w ) 
please suggest.

Regards,
Subhabrata Banerjee. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread Peter Otten
RainyDay wrote:

 Hi, in python 3.4.1, I get this surpising behaviour:
 
 l=Loc(0,0)
 l2=Loc(1,1)
 ll2
 False
 ll2
 True
 l=l2
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: unorderable types: Loc() = Loc()
 l==l2
 False
 ll2 or l==l2
 True
 
 Loc implements both __lt__ and __eq__, which should be enough (?),

These two methods should be sufficient if you use the 
functools.total_ordering class decorator, see

https://docs.python.org/dev/library/functools.html#functools.total_ordering

 but even after I've added __lte__, I still have the error.

There is no special method of that name; it should probably be __le__().

 
 implementation:
 
 class Loc:
 def __init__(self, x, y):
 self._loc = x, y
 self.x, self.y = x, y
 
 def __eq__(self, other):
 return self._loc == getattr(other, _loc, None)

Note that None is not a good default when _loc is expected to be a tuple:

 None  ()
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unorderable types: NoneType()  tuple()

 
 def __lt__(self, other):
 return self._loc  other._loc
 
  - andrei


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


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread python
Ethan,

 Is this specific to the native Dict class (because its implemented in C vs. 
 Python?) or is this behavior more general.

 I /think/ it's only dict, but I haven't played with subclassing lists, 
 tuples, etc.  It's not a C vs Python issue, but a 
'implemented with __private methods' issue.  From what I have seen so
far in the confusion and frustration that decision 
has caused, I do not think it was a good one.  :(

Thanks for the heads-up!

Malcolm
-- 
https://mail.python.org/mailman/listinfo/python-list


Writing files at run time

2014-06-30 Thread subhabangalore
Dear Group,

In my previous 
post[https://groups.google.com/forum/#!topic/comp.lang.python/ZYjsskV5MgE;] I 
was trying to discuss some issue on file writing. 

I got an associated issue. 

I am trying to crawl a link, through urllib and trying to store its results in 
different files. As discussed I could work out a solution for this and with 
your kind help trying to learn some new coding styles. 

Now, I am getting an associated issue. 

The crawler I am trying to construct would run daily-may be at a predefined 
time. 
[I am trying to set the parameter with time module]. 

Now, in the file(s) data are stored, are assigned or created at one time.

Data changes daily if I crawl daily newspapers. 

I generally change the name of the files with a sitting for few minutes before 
a run. But this may not be the way. 

I am thinking of a smarter solution. 

If anyone of the esteemed members may kindly show a hint, how the name of the 
storing files may be changed automatically as crawler runs every day, so that 
data may be written there and retrieved. 

Thanking you in advance,
Regards,
Subhabrata Banerjee. 
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Translation of Python!

2014-06-30 Thread Michael Torrie
On 06/30/2014 12:37 PM, Doriven Basha wrote:
 I want to translate it into my language like the chinese python
 https://code.google.com/p/zhpy/w/list?q=label:Chinese can you help
 me?

I don't understand chinese, so I am not sure what this web page is
about. Do you want to translate Python's messages (error tracebacks,
etc) into Romanian?  Or are you wanting to create a language that uses
Python syntax but with Romanian keywords replacing english ones like if,
else, while, def, etc?

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


Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread RainyDay
On Monday, June 30, 2014 3:34:25 PM UTC-4, Peter Otten wrote:
 RainyDay wrote:
 
 
 
  Hi, in python 3.4.1, I get this surpising behaviour:
 
  
 
  l=Loc(0,0)
 
  l2=Loc(1,1)
 
  ll2
 
  False
 
  ll2
 
  True
 
  l=l2
 
  Traceback (most recent call last):
 
File stdin, line 1, in module
 
  TypeError: unorderable types: Loc() = Loc()
 
  l==l2
 
  False
 
  ll2 or l==l2
 
  True
 
  
 
  Loc implements both __lt__ and __eq__, which should be enough (?),
 
 
 
 These two methods should be sufficient if you use the 
 
 functools.total_ordering class decorator, see


Thanks! I literally failed to read one more paragraph in a SO answer
which referenced this decorator. I really need to start reading those
paragraphs, they often provide answers...

  but even after I've added __lte__, I still have the error.
 
 
 
 There is no special method of that name; it should probably be __le__().


Right, I used lte in django and assumed they were consistent with python.
 
  def __eq__(self, other):
 
  return self._loc == getattr(other, _loc, None)
 
 
 
 Note that None is not a good default when _loc is expected to be a tuple:
 

I'm only using None in equality comparison, it's never a default value of
_loc itself, so this should be ok because it'll compare to all other object
types and correctly say they're unequal.

 
 - andrei
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unorderable error: less ok, equal ok, less-or-equal gives unorderable error!

2014-06-30 Thread Ethan Furman

On 06/30/2014 12:34 PM, Peter Otten wrote:

RainyDay wrote:


 def __eq__(self, other):
 return self._loc == getattr(other, _loc, None)


Note that None is not a good default when _loc is expected to be a tuple:


In this case None is not being returned, but will be comparid with self._loc, 
so RainyDay is good there.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: Creating a dict-like class that counts successful and failed key matches

2014-06-30 Thread Chris Angelico
On Tue, Jul 1, 2014 at 2:47 AM,  pyt...@bdurham.com wrote:
 I'm not sure I understand. Are you saying that Chris's __getitem__ will
 not be called by other dict methods that would normally call this magic
 method and instead call the parent's __getitem__ directly (via super()
 or something similar?)?

He's pointing out the general principle behind what I said about the
.get() method; if you don't override .get() with your own
implementation, it won't pass the request through your __getitem__, so
it won't be statistically analyzed. That might be a good thing; it
means you're going to have to be explicit about what gets counted.

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


Re: Writing Multiple files at a times

2014-06-30 Thread Denis McMahon
On Mon, 30 Jun 2014 12:23:08 -0700, subhabangalore wrote:

 Thank you for your kind suggestion. But I am not being able to sort out,
 fp = open( scraped/body{:05d}.htm.format( n ), w ) 
 please suggest.

look up the python manual for string.format() and open() functions.

The line indicated opens a file for write whose name is generated by the 
string.format() function by inserting the number N formatted to 5 digits 
with leading zeroes into the string scraped/bodyN.htm

It expects you to have a subdir called scraped below the dir you're 
executing the code in.

Also, this newsgroup is *NOT* a substitute for reading the manual for 
basic python functions and methods.

Finally, if you don't understand basic string and file handling in 
python, why on earth are you trying to write code that arguably needs a 
level of competence in both? Perhaps as your starter project you should 
try something simpler, print hello world is traditional.

To understand the string formatting, try:

print hello {:05d} world.format( 5 )
print hello {:05d} world.format( 50 )
print hello {:05d} world.format( 500 )
print hello {:05d} world.format( 5000 )
print hello {:05d} world.format( 5 )

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Validating Data Extracted from Files

2014-06-30 Thread Ari King
Hi,

I'm sourcing data from multiple excel files (workbooks) each with multiple 
worksheets. Prior to persisting the aggregated data, I want to validate it. I 
was thinking of creating classes to hold the data and validate type and content 
via methods. I'd appreciate feedback on this approach, suggestions on possibly 
better alternatives, and if there are existing libraries that provide this 
functionality. Thanks.

Best,
Ari 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python While loop Takes too much time.

2014-06-30 Thread Gregory Ewing

marco.naw...@colosso.nl wrote:

In the past I even dumped an EXCEL sheet as a
CSV file


That's probably the only way you'll speed things up
significantly. In my experience, accessing Excel via
COM is abysmally slow no matter how you go about it.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re:Writing files at run time

2014-06-30 Thread Dave Angel
subhabangal...@gmail.com Wrote in message:
 Dear Group,
 
 In my previous 
 post[https://groups.google.com/forum/#!topic/comp.lang.python/ZYjsskV5MgE;] 
 I was trying to discuss some issue on file writing. 
 
 I got an associated issue. 
 
 I am trying to crawl a link, through urllib and trying to store its results 
 in different files. As discussed I could work out a solution for this and 
 with your kind help trying to learn some new coding styles. 
 
 Now, I am getting an associated issue. 
 
 The crawler I am trying to construct would run daily-may be at a predefined 
 time. 
 [I am trying to set the parameter with time module]. 
 
 Now, in the file(s) data are stored, are assigned or created at one time.
 
 Data changes daily if I crawl daily newspapers. 
 
 I generally change the name of the files with a sitting for few minutes 
 before a run. But this may not be the way. 
 
 I am thinking of a smarter solution. 
 
 If anyone of the esteemed members may kindly show a hint, how the name of the 
 storing files may be changed automatically as crawler runs every day, so that 
 data may be written there and retrieved. 
 
 Thanking you in advance,
 Regards,
 Subhabrata Banerjee. 
  
 

Make a directory name from datetime. datetime. now () and put the
 files there. 

-- 
DaveA

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


Re: Translation of Python!

2014-06-30 Thread Steven D'Aprano
On Mon, 30 Jun 2014 14:24:46 -0600, Michael Torrie wrote:

 On 06/30/2014 12:37 PM, Doriven Basha wrote:
 I want to translate it into my language like the chinese python
 https://code.google.com/p/zhpy/w/list?q=label:Chinese can you help me?
 
 I don't understand chinese, so I am not sure what this web page is
 about. Do you want to translate Python's messages (error tracebacks,
 etc) into Romanian?  

Doriven is Albanian, not Romanian.


 Or are you wanting to create a language that uses
 Python syntax but with Romanian keywords replacing english ones like if,
 else, while, def, etc?

Yes, that's what ChinesePython does:

http://reganmian.net/blog/2008/11/21/chinese-python-translating-a-programming-language/

http://www.chinesepython.org/english/english.html

For what it's worth, when this came up on the Python-Dev mailing list a 
few years ago, Guido gave his blessing to the idea.

I don't know how ChinesePython does it, but if I were doing this, I would 
use a pre-processor that translates custom source code into Python. Here 
are two joke languages that do something similar:

http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html

http://www.staringispolite.com/likepython/



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


Re: [OT] What can Nuitka do?

2014-06-30 Thread Michael Torrie
On 06/30/2014 07:36 AM, Chris Angelico wrote:
 Hmm. I'm not sure that it's necessarily that bad; I've done 3G-based
 X11 forwarding fairly successfully on occasion. Yes, it's potentially
 quite slow, but it certainly works - I've used SciTE, for instance,
 and I've used some GTK2 apps without problems. What do you mean by
 modern toolkit?

Modern toolkit is defined as anything that uses client-side rendering.
In the good old days of Motif and Xaw widgets, if a program wanted to
draw, the toolkit would instruct the server to draw primitives.
Rectangles, lines, etc.  Each widget would be created in its own window,
and events would be all handled on the server.  Unfortunately we quickly
hit some limits with that idea, as good and fast as it was.  First of
all, anti-aliased fonts were difficult to accomplish.  There were hacks
to do this early on, but it quickly became apparent that the actual
application could do a better job of it if it would just do the
rendering itself and have the X server draw it.  Not only anti-aliased
fonts, but also when you start talking about wanting to do layered
effects like alpha-blending.  All of this the app could do better and
more efficiently than the X server could, since the X server would have
had to round-trip to the app anyway to get the information since the X
server is in a different process (or different computer) and cannot
access the memory the app is using to store things.  Kieth Packard wrote
some X extensions to allow client-side rendering to be efficient and to
let the X server to handle RGBA images, and to composite them together.

Also, events in modern toolkits are done very differently than the
original X toolkits.  Instead of using multiple windows, clients now
just establish one window and then handle events and figure out what
widgets should receive the events client-side instead of server-side.
This allows handling of things like scrollable canvases.

Anyway, all of this improved the behavior and appearance of
applications.  When used locally, shared memory facilities make X pretty
fast, although latency is still quite high. There's no way to
synchronize frame redraws, so apps tear and stutter when you drag and
resize.  But over a network now, the nature of the X protocol means a
lot of round-trips to the server to do things. This is very apparent
when you run on a very slow connection. You might see widgets get drawn,
then erase, then drawn again.  Using a complex app like firefox, which
has another layer of abstraction over GTK that makes it even worse, is
very difficult on anything less than a LAN.  Or try a Java Swing app!
I've done it on occasion. I'd rather run Xvnc on the remote host and vnc
in than forward X.

FreeNX makes things very usable.
http://en.wikipedia.org/wiki/NX_technology describes how NX works.

I love that X11 apps work over a forward connection.  And I love that I
can run a remote window manager on a local X server if I wanted to.  But
I recognize X has it's problems and I can see how Wayland will
eventually be so much better while still letting me remote apps, which
is essential to me.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: [OT] What can Nuitka do?

2014-06-30 Thread Michael Torrie
I highly recommend the talk by Daniel Stone who used to be a core X.org
developer.  He explains it quite well how X is used currently, and why
it has problems and why they are considered so hard to fix that Wayland
(and Mir) was created.

https://www.youtube.com/watch?v=RIctzAQOe44

One interesting point he made was the X server is no longer network
transparent like it used to be.  It is network capable now but when used
in that way (ssh forwarding), it's essentially done in the same way as
VNC, but more poorly because of the way X11 is architected.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue20577] IDLE: Remove FormatParagraph's width setting from config dialog

2014-06-30 Thread Tal Einat

Tal Einat added the comment:

I've been waiting to commit this for some time. I'd really like to do this 
myself, if you don't mind.

I'm just waiting for my SSH key to be added, which is taking a long time since 
apparently all three people who could do so are traveling and unable to help.

--

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



[issue17442] code.InteractiveInterpreter doesn't display the exception cause

2014-06-30 Thread Claudiu Popa

Claudiu Popa added the comment:

Well, for instance, my use cases with InteractiveInterpreter are for debugging 
or creating custom interpreters for various apps and in those cases the patch 
helps, by giving better debugging clues through the exception cause. I agree 
that this was overlooked when exception chaining was added. Also, idlelib's 
PyShell is based on InteractiveInterpreter, but in addition, it implements the 
exception chaining.

--

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



[issue17442] code.InteractiveInterpreter doesn't display the exception cause

2014-06-30 Thread Claudiu Popa

Claudiu Popa added the comment:

Also, solving this issue seems to be, partially, a prerequisite for issue14805.

--

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



[issue10342] trace module cannot produce coverage reports for zipped modules

2014-06-30 Thread Claudiu Popa

Claudiu Popa added the comment:

Hi, I left a couple of comments on Rietveld.

--
nosy: +Claudiu.Popa

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



[issue21811] Anticipate fixes to 3.x and 2.7 for OS X 10.10 Yosemite support

2014-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 53112afddae6 by Ned Deily in branch '2.7':
Issue #21811: Add Misc/NEWS entry.
http://hg.python.org/cpython/rev/53112afddae6

New changeset ec27c85d3001 by Ned Deily in branch '3.4':
Issue #21811: Add Misc/NEWS entry.
http://hg.python.org/cpython/rev/ec27c85d3001

New changeset 1f59baf609a4 by Ned Deily in branch 'default':
Issue #21811: Add Misc/NEWS entry.
http://hg.python.org/cpython/rev/1f59baf609a4

--

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



[issue8902] add datetime.time.now() for consistency

2014-06-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

For the reasons listed by others, marking this as closed/rejected.

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

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



[issue21881] python cannot parse tcl value

2014-06-30 Thread Ned Deily

Ned Deily added the comment:

What version of Tcl are you using and on what platform?

--
nosy: +ned.deily, serhiy.storchaka

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



[issue8902] add datetime.time.now() for consistency

2014-06-30 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
stage: needs patch - resolved

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



[issue15347] IDLE - does not close if the debugger was active

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

A pythonw.exe process is left running if I try this with 3.4.1 on Windows 7.

--
nosy: +BreamoreBoy, terry.reedy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue11762] Ast doc: warning and version number

2014-06-30 Thread Berker Peksag

Berker Peksag added the comment:

 1. Add a warning similar to the one for the dis module.

The current documentation says:

The abstract syntax itself might change with each Python release; [...]

https://docs.python.org/3.4/library/ast.html

 2. Add a full entry for __version__. Currently (3.2):

ast.__version__ has been removed in issue 12273.

Closing this as out of date.

--
nosy: +berker.peksag
resolution:  - out of date
stage: needs patch - resolved
status: open - closed

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



[issue10417] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

Does this need following up, can it be closed as won't fix as it only affects 
2.7, or what?

--
nosy: +BreamoreBoy

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



[issue10417] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2014-06-30 Thread STINNER Victor

STINNER Victor added the comment:

 Does this need following up, can it be closed as won't fix as it only 
 affects 2.7, or what?

IMO we should fix this issue. I proposed a fix in msg121294.

--

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



[issue21884] turtle regression of issue #21823: uncaught exception on AMD64 Snow Leop 3.x buildbot

2014-06-30 Thread STINNER Victor

New submission from STINNER Victor:

Since the changeset 1ae2382417dcc7202c708cac46ae8a61412ca787 from the issue 
#21823, Tcl/Tk crashs beacuse of an uncaught exception on the buildbot AMD64 
Snow Leop 3.x on tk.call('update') called by tkinter.Misc().update().

First failure on the buildbot 3.4:
http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.4/builds/235

Last error on buildbot 3.x:
http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/1831/steps/test/logs/stdio

Sun Jun 29 21:49:20 buddy.home.bitdance.com python.exe[75372] Error: 
kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they 
are logged.
_RegisterApplication(), FAILED TO establish the default connection to the 
WindowServer, _CGSDefaultConnection() is NULL.
2014-06-29 21:49:22.399 python.exe[75372:903] An uncaught exception was raised
2014-06-29 21:49:22.400 python.exe[75372:903] Error (1002) creating CGSWindow
2014-06-29 21:49:22.419 python.exe[75372:903] *** Terminating app due to 
uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1002) 
creating CGSWindow'
*** Call stack at first throw:
(
0   CoreFoundation  0x7fff84954784 
__exceptionPreprocess + 180
1   libobjc.A.dylib 0x7fff84eb9f03 
objc_exception_throw + 45
2   CoreFoundation  0x7fff849545a7 
+[NSException raise:format:arguments:] + 103
3   CoreFoundation  0x7fff84954534 
+[NSException raise:format:] + 148
4   AppKit  0x7fff850a2f52 
_NSCreateWindowWithOpaqueShape2 + 473
5   AppKit  0x7fff85037691 -[NSWindow 
_commonAwake] + 1214
6   AppKit  0x7fff850551c9 -[NSWindow 
_makeKeyRegardlessOfVisibility] + 96
7   AppKit  0x7fff8505513e -[NSWindow 
makeKeyAndOrderFront:] + 24
8   Tk  0x0001035fd86c XMapWindow + 
155
9   Tk  0x00010356c6d0 Tk_MapWindow 
+ 89
10  Tk  0x0001035755e6 
TkToplevelWindowForCommand + 2658
11  Tcl 0x0001034d20d3 
TclServiceIdle + 76
12  Tcl 0x0001034b82ce 
Tcl_DoOneEvent + 329
13  Tk  0x00010354bf33 
TkGetDisplayOf + 379
14  Tcl 0x000103454559 
Tcl_CreateInterp + 4820
15  Tcl 0x000103455769 Tcl_EvalObjv 
+ 66
16  _tkinter.so 0x000103433b4f Tkapp_Call + 
562
17  python.exe  0x0001000872af 
PyCFunction_Call + 202
18  python.exe  0x000100195bac 
call_function + 1715
19  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
20  python.exe  0x000100196256 
fast_function + 515
21  python.exe  0x000100195df9 
call_function + 2304
22  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
23  python.exe  0x000100196256 
fast_function + 515
24  python.exe  0x000100195df9 
call_function + 2304
25  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
26  python.exe  0x000100193136 
_PyEval_EvalCodeWithName + 4056
27  python.exe  0x0001001963aa 
fast_function + 855
28  python.exe  0x000100195df9 
call_function + 2304
29  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
30  python.exe  0x000100193136 
_PyEval_EvalCodeWithName + 4056
31  python.exe  0x0001001963aa 
fast_function + 855
32  python.exe  0x000100195df9 
call_function + 2304
33  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
34  python.exe  0x000100196256 
fast_function + 515
35  python.exe  0x000100195df9 
call_function + 2304
36  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
37  python.exe  0x000100193136 
_PyEval_EvalCodeWithName + 4056
38  python.exe  0x0001001963aa 
fast_function + 855
39  python.exe  0x000100195df9 
call_function + 2304
40  python.exe  0x00010018df4f 
PyEval_EvalFrameEx + 69858
  

[issue21884] turtle regression of issue #21823: uncaught exception on AMD64 Snow Leop 3.x buildbot

2014-06-30 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +r.david.murray

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



[issue21732] SubprocessTestsMixin.test_subprocess_terminate() hangs on AMD64 Snow Leop 3.x buildbot

2014-06-30 Thread STINNER Victor

STINNER Victor added the comment:

I cannot check if the error occurred recently because of another issue: #21884.

--

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



[issue21645] test_read_all_from_pipe_reader() of test_asyncio hangs on FreeBSD 9

2014-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69d474dab479 by Victor Stinner in branch 'default':
Issue #21645: asyncio: add a watchdog in test_read_all_from_pipe_reader() for
http://hg.python.org/cpython/rev/69d474dab479

--
nosy: +python-dev

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



[issue21209] q.put(some_tuple) fails when PYTHONASYNCIODEBUG=1

2014-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset defd09a5339a by Victor Stinner in branch '3.4':
asyncio: sync with Tulip
http://hg.python.org/cpython/rev/defd09a5339a

New changeset 8dc8c93e74c9 by Victor Stinner in branch 'default':
asyncio: sync with Tulip
http://hg.python.org/cpython/rev/8dc8c93e74c9

--

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-06-30 Thread STINNER Victor

STINNER Victor added the comment:

Hum, dont_log_pending.patch is not correct for wait(): wait() returns (done, 
pending), where pending is a set of pending tasks. So it's still possible that 
pending tasks are destroyed while they are not a still pending, after the end 
of wait(). The log should not be made quiet here.

--

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



[issue21163] asyncio doesn't warn if a task is destroyed during its execution

2014-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 13e78b9cf290 by Victor Stinner in branch '3.4':
Issue #21163: BaseEventLoop.run_until_complete() and test_utils.run_briefly()
http://hg.python.org/cpython/rev/13e78b9cf290

New changeset 2d0fa8f383c8 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #21163: BaseEventLoop.run_until_complete() and
http://hg.python.org/cpython/rev/2d0fa8f383c8

--

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-06-30 Thread Ian Cordasco

Changes by Ian Cordasco graffatcolmin...@gmail.com:


--
nosy: +icordasc

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



[issue19475] Add microsecond flag to datetime isoformat()

2014-06-30 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Here is some prior art: GNU date utility has an --iso-8601[=timespec] option 
defined as

‘-I[timespec]’
‘--iso-8601[=timespec]’
Display the date using the ISO 8601 format, ‘%Y-%m-%d’.
The argument timespec specifies the number of additional terms of the time to 
include. It can be one of the following:

‘auto’
Print just the date. This is the default if timespec is omitted. 
‘hours’
Append the hour of the day to the date. 
‘minutes’
Append the hours and minutes. 
‘seconds’
Append the hours, minutes and seconds. 
‘ns’
Append the hours, minutes, seconds and nanoseconds.
If showing any time terms, then include the time zone using the format ‘%z’. 

https://www.gnu.org/software/coreutils/manual/html_node/Options-for-date.html

--
versions: +Python 3.5 -Python 3.4

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



[issue21882] turtledemo modules imported by test___all__ cause side effects or failures

2014-06-30 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +jesstess

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



[issue19475] Add microsecond flag to datetime isoformat()

2014-06-30 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Based on GNU date prior art, we can introduce timespec='auto' keyword 
argument with the following values:

'auto' - (default) same as current behavior
'hours' - %H
'minutes' - %H:%M
'seconds' - %H:%M:%S
'us' - %H:%M:%S.%f

--

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



[issue17849] Missing size argument in readline() method for httplib's class LineAndFileWrapper

2014-06-30 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: needs patch - commit review

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



[issue21885] shutil.copytree hangs (on copying root directory of a lxc container) (should succeed or raise exception nested)

2014-06-30 Thread Karl Richter

New submission from Karl Richter:

reproduction (on Ubuntu 14.04 amd64 with lxc 1.0.4) (with python 2.7.6 and 
3.4.0)

# as root/with privileges
lxc-create -n ubuntu-trusty-amd64 -t ubuntu -- --arch amd64 --release trusty
lxc-stop -n ubuntu-trusty-amd64 # assert container isn't running
cd /var/lib/lxc
python
 import shutil
 shutil.copytree(ubuntu-trusty-amd64, ubuntu-trusty-amd64-orig)
 # never returns (after a multiple of the time rsync needs (see below) no 
more I/O operations)

verify behavior of rsync (3.1.0):

# as root/with privileges
rsync -a ubuntu-trusty-amd64/ ubuntu-trusty-amd64-orig/
# succeeds

If the container is shutdown it should no longer point to system resources, and 
thus be able to get stuck on reading from a device file (and should rsync get 
stuck as well in this case?).

It would be nice if python fails with an exception (or succeeds, of course) 
instead of getting stuck.

--
messages: 221960
nosy: krichter
priority: normal
severity: normal
status: open
title: shutil.copytree hangs (on copying root directory of a lxc container) 
(should succeed or raise exception nested)
versions: Python 2.7

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



[issue21886] asyncio: Future.set_result() called on cancelled Future raises asyncio.futures.InvalidStateError

2014-06-30 Thread STINNER Victor

New submission from STINNER Victor:

Ok, I found a way to reproduce the error InvalidStateError in asyncio. I'm not 
sure that it's the same the error in #21447.

Output of attached bug.py in debug mode:
---
Exception in callback Future.set_result(None)
handle: TimerHandle when=79580.878306285 Future.set_result(None)
source_traceback: Object created at (most recent call last):
  File /home/haypo/bug.py, line 11, in module
loop.run_until_complete(task2)
  File /home/haypo/prog/python/default/Lib/asyncio/base_events.py, line 239, 
in run_until_complete
self.run_forever()
  File /home/haypo/prog/python/default/Lib/asyncio/base_events.py, line 212, 
in run_forever
self._run_once()
  File /home/haypo/prog/python/default/Lib/asyncio/base_events.py, line 912, 
in _run_once
handle._run()
  File /home/haypo/prog/python/default/Lib/asyncio/events.py, line 96, in _run
self._callback(*self._args)
  File /home/haypo/prog/python/default/Lib/asyncio/tasks.py, line 241, in 
_step
result = next(coro)
  File /home/haypo/prog/python/default/Lib/asyncio/coroutines.py, line 72, in 
__next__
return next(self.gen)
  File /home/haypo/prog/python/default/Lib/asyncio/tasks.py, line 487, in 
sleep
h = future._loop.call_later(delay, future.set_result, result)
Traceback (most recent call last):
  File /home/haypo/prog/python/default/Lib/asyncio/events.py, line 96, in _run
self._callback(*self._args)
  File /home/haypo/prog/python/default/Lib/asyncio/futures.py, line 326, in 
set_result
raise InvalidStateError('{}: {!r}'.format(self._state, self))
asyncio.futures.InvalidStateError: CANCELLED: Future cancelled
---

The fix is to replace the following line of sleep():
---
h = future._loop.call_later(delay, future.set_result, result)
---

with:
---
def maybe_set_result(future, result):
if not future.cancelled():
future.set_result(result)
h = future._loop.call_later(delay, maybe_set_result, future, result)
---

This generic issue was already discussed there:
https://groups.google.com/forum/?fromgroups#!searchin/python-tulip/set_result$20InvalidStateError/python-tulip/T1sxLqjuoVY/YghF-YsgosgJ

A patch was also proposed:
https://codereview.appspot.com/69870048/

--
files: bug.py
messages: 221961
nosy: haypo
priority: normal
severity: normal
status: open
title: asyncio: Future.set_result() called on cancelled Future raises 
asyncio.futures.InvalidStateError
versions: Python 3.5
Added file: http://bugs.python.org/file35807/bug.py

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



[issue21447] Intermittent asyncio.open_connection / futures.InvalidStateError

2014-06-30 Thread STINNER Victor

STINNER Victor added the comment:

This issue contains two sub-issues:
- race condition in_write_to_self() = already fixed
- race condition with scheduled call to future.set_result(), InvalidStateError 
= I just opened the issue #21886 to discuss it

@Ryder: If you are able to reproduce the second issue (InvalidStateError), 
please use set the environment variable PYTHONASYNCIODEBUG=1 to see the 
traceback where the call to set_result() was scheduled. It requires the latest 
development version of Tulip, Python 3.4 or Python 3.5 to get the traceback.

I close this issue because I prefer to discuss the InvalidStateError in the 
issue #21886.

Thanks for the report Ryder. Thanks for the fix for the race condition in 
_write_to_self() Guido.

--
resolution:  - fixed
status: open - closed

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



[issue21886] asyncio: Future.set_result() called on cancelled Future raises asyncio.futures.InvalidStateError

2014-06-30 Thread Ryder Lewis

Changes by Ryder Lewis rle...@softgatesystems.com:


--
nosy: +ryder.lewis

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



[issue9248] multiprocessing.pool: Proposal: waitforslot

2014-06-30 Thread Ask Solem

Ask Solem added the comment:

This patch is quite dated now and I have fixed many bugs since.  The feature is 
available in billiard and is working well but The code has diverged quite a lot 
from python trunk.  I will be updating billiard to reflect the changes for 
Python 3.4 soon (billiard is currently 3.3).

I think we can forget about taking individual patches from billiard for now,
and instead maybe merge the codebases at some point if there's interest.
we have a version of multiprocessing.Pool using async IO and one pipe per 
process that drastically improves performance
and also avoids the threads+forking issues (well, not the initial fork), but I 
have not yet adapted it to use the new asyncio module in 3.4

So suggestion is to close this and rather get a discussion going for combining 
our efforts.

--

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



[issue6721] Locks in the standard library should be sanitized on fork

2014-06-30 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
title: Locks in python standard library should be sanitized on fork - Locks in 
the standard library should be sanitized on fork
versions: +Python 3.5 -Python 3.3

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



[issue6721] Locks in the standard library should be sanitized on fork

2014-06-30 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe tshep...@gmail.com:


--
nosy: +tshepang

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



[issue21887] Python3 can't detect Tcl

2014-06-30 Thread Joe Borg

New submission from Joe Borg:

Trying to configure 3.4.1 on Cent OS 6.4.  I have built Tcl and Tk, using the 
prefix /scratch/root.  I can confirm the builds with:

$ find /scratch/root/ -name tcl.h
/scratch/root/include/tcl.h

$ find /scratch/root/ -name tk.h
/scratch/root/include/tk.h

But, when configuring Python, they aren't picked up:

$ ./configure --prefix=/scratch/root 
--with-tcltk-includes=/scratch/root/include --with-tcltk-libs=/scratch/root/lib 
| grep tcl
checking for --with-tcltk-includes... /scratch/root/include
checking for --with-tcltk-libs... /scratch/root/lib
checking for UCS-4 tcl... no

I've tried to make install with this, but then get the usual exception from 
_tkinter.

--
components: Build
messages: 221964
nosy: Joe.Borg
priority: normal
severity: normal
status: open
title: Python3 can't detect Tcl
versions: Python 3.4

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



[issue21884] turtle regression of issue #21823: uncaught exception on AMD64 Snow Leop 3.x buildbot

2014-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

(Brett, the question is about import.)

The problem is the mode call in clock.py, which I will move today as part of 
21882.

I am sorely puzzled that the patch in #21823 could have changed the effect of 
mode(). There are only two changes, only one of which could be relevant.

1.
 from turtle import *
+from turtle import Terminator  # not in __all__
 mode()

My understanding is that the newly added second import should just add a 
reference to Terminator in the existing module. It is a standard Exception 
subclass: from turtle.py, class Terminator(Exception): pass.  I could and 
will add 'Terminator' to __all__ instead, but it seems to me that the added 
statement *should* be innocuous.

What am I missing? Does __all__ change the import machinery in the calls to 
frozen importlib.bootstrap or do these call always happen behind the scene with 
any import?  From the most recent first traceback:
...
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/turtledemo/clock.py,
 line 17 in module
  File frozen importlib._bootstrap, line 321 in _call_with_frames_removed
  File frozen importlib._bootstrap, line 1420 in exec_module
  File frozen importlib._bootstrap, line 1149 in _load_unlocked
  File frozen importlib._bootstrap, line 2175 in _find_and_load_unlocked
  File frozen importlib._bootstrap, line 2186 in _find_and_load
  File string, line 1 in module
  File 
/Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test___all__.py,
 line 23 in check_all
...

2. Added a try:except: within a function, not called on import, to catch 
previously uncaught Terminator exception.

--
nosy: +brett.cannon

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



[issue21887] Python3 can't detect Tcl/Tk 8.6.1

2014-06-30 Thread Joe Borg

Changes by Joe Borg cyborg101...@gmail.com:


--
title: Python3 can't detect Tcl - Python3 can't detect Tcl/Tk 8.6.1

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



[issue21882] turtledemo modules imported by test___all__ cause side effects or failures

2014-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am working on the turtle demos now. Victor gave more info in #21884.

I was partly wrong in my comments. turtledemo uses reload to re-initialize 
demos when one switches between them. I am tempted to remove this as part of 
discouraging side-effects on import. It is not a good example to be followed.

--
assignee:  - terry.reedy

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



[issue14117] Turtledemo: exception and minor glitches.

2014-06-30 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
dependencies: +turtledemo modules imported by test___all__ cause side effects 
or failures

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



[issue21876] os.rename(src, dst) does nothing when src and dst files are hard-linked

2014-06-30 Thread Aaron Swan

Aaron Swan added the comment:

At any rate, it is a bit of a nuisance that files remain present when the 
intent was to move them.

--

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



[issue14261] Cleanup in smtpd module

2014-06-30 Thread Michele Orrù

Michele Orrù added the comment:

On Sun, Jun 29, 2014 at 03:15:44PM +, Mark Lawrence wrote:

 Mark Lawrence added the comment:

 @Michele as 8739 has been implemented would you like to put up a patch for 
 this?
No, but setting keyword easy could help for future contributions.

--

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



[issue21888] plistlib.FMT_BINARY behavior doesn't send required dict parameter

2014-06-30 Thread Nathan Henrie

New submission from Nathan Henrie:

When using the new plistlib.load and the FMT_BINARY option, line 997: 

p = _FORMATS[fmt]['parser'](use_builtin_types=use_builtin_types)

doesn't send the dict_type to _BinaryPlistParser.__init__ (line 601), which has 
dict_type as a required positional parameter, causing an error

def __init__(self, use_builtin_types, dict_type):

My first bugs.python.org report, hope I'm doing it right...

--
components: Library (Lib)
messages: 221969
nosy: n8henrie
priority: normal
severity: normal
status: open
title: plistlib.FMT_BINARY behavior doesn't send required dict parameter
type: behavior
versions: Python 3.4

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



[issue14322] More test coverage for hmac

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

If there isn't a signed contributor agreement I'll put up a new version of the 
patch.

In msg156758 Antoine said 'don't use except: self.fail(), just let the 
exception pass through'.  There are several of these in the existing code.  
Should they all be removed or must it be done on a case by case basis?

--
nosy: +BreamoreBoy

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



[issue9517] Make test.script_helper more comprehensive, and use it in the test suite

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

@Rodrigue did you ever make any progress with this?

--
nosy: +BreamoreBoy

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



[issue13231] sys.settrace - document 'some other code blocks' for 'call' event type

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

I find this request excessive.  The first sentence for sys.settrace states Set 
the system’s trace function, which allows you to implement a Python source code 
debugger in Python.  I suspect that anyone wanting to write a debugger would 
know the Python and its documentation better than the back of their hand.  So I 
say close as won't fix but I wouldn't argue if anyone disagreed and wanted to 
provide a patch.

--
nosy: +BreamoreBoy

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



[issue21881] python cannot parse tcl value

2014-06-30 Thread Andreas Schwab

Andreas Schwab added the comment:

You will see this on any architecture where the canonical NaN has all bits set 
(or a subset of them).  This include mips and m68k.

--

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




[issue21887] Python3 can't detect Tcl/Tk 8.6.1

2014-06-30 Thread Ned Deily

Ned Deily added the comment:

for the --with-tcltk-includes and -libs options, you need to pass the same cc 
options that would go on CFLAGS and LDFLAGS.

  ./configure --help
  [...]
  --with-tcltk-includes='-I...'
  override search for Tcl and Tk include files
  --with-tcltk-libs='-L...'
  override search for Tcl and Tk libs

So your values should likely look something like:

  --with-tcltk-includes=-I/scratch/root/include
  --with-tcltk-libs=-L/scratch/root/lib -ltcl8.6 -ltk8.6

--
nosy: +ned.deily
resolution:  - works for me
stage:  - resolved
status: open - closed

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



[issue13743] xml.dom.minidom.Document class is not documented

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

This 
https://docs.python.org/3/library/xml.dom.minidom.html#module-xml.dom.minidom 
currently states under section 20.7.1 The definition of the DOM API for Python 
is given as part of the xml.dom module documentation. This section lists the 
differences between the API and xml.dom.minidom..  The Document object is 
described here https://docs.python.org/3/library/xml.dom.html#document-objects

--
nosy: +BreamoreBoy

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



[issue21884] turtle regression of issue #21823: uncaught exception on AMD64 Snow Leop 3.x buildbot

2014-06-30 Thread Ned Deily

Ned Deily added the comment:

This is an instance of the problems identified in Issue21882, namely that 
test___all__ is importing turtledemo modules and some of them have bad side 
effects. In this case, it's turtledemo.clock which is calling mode() which now 
unconditionally attempts to create a Tk window during the import. That means Tk 
is being called without being subject to the checks of 
test_support.requires('gui'). One of the reasons for having that check is to 
prevent this kind of crash (as documented in Issue8716) in Tk when Tk is 
invoked in a process that cannot make a window manager connection, as when 
running under a buildbot with a user name that is not logged in as the main gui 
user.  Note also that when Tk crashes, there is nothing the Python code can 
really do to recover from it.  The solution is as outlined in #21882: don't 
unconditionally call mode() in the import path.

--
assignee: ronaldoussoren - 
components:  -Macintosh
nosy: +ned.deily
resolution:  - duplicate
stage:  - resolved
status: open - closed
superseder:  - turtledemo modules imported by test___all__ cause side effects 
or failures

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



[issue21881] python cannot parse tcl value

2014-06-30 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy:  -ned.deily
stage:  - needs patch
versions: +Python 3.4, Python 3.5

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



[issue21885] shutil.copytree hangs (on copying root directory of a lxc container) (should succeed or raise exception nested)

2014-06-30 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +hynek, tarek

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



[issue21888] plistlib.FMT_BINARY behavior doesn't send required dict parameter

2014-06-30 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  Can you supply a test case and/or a fix patch?  
Ideally, the test case would be a patch to Lib/test/test_plistlib.py.  If 
you're interested, there's more info here: https://docs.python.org/devguide/

--
nosy: +ned.deily, ronaldoussoren, serhiy.storchaka
stage:  - test needed
versions: +Python 3.5

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



[issue21882] turtledemo modules imported by test___all__ cause side effects or failures

2014-06-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c173a34f20c0 by Terry Jan Reedy in branch '2.7':
Issue #21882: In turtle demos, remove module scope gui and sys calls by
http://hg.python.org/cpython/rev/c173a34f20c0

New changeset fcfa9c5a00fd by Terry Jan Reedy in branch '3.4':
Issue #21882: In turtle demos, remove module scope gui and sys calls by
http://hg.python.org/cpython/rev/fcfa9c5a00fd

--
nosy: +python-dev

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



[issue1647489] zero-length match confuses re.finditer()

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

How does the Regexp 2.7 engine in issue 2636 from msg73742 deal with this 
situation?

--
nosy: +BreamoreBoy

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



[issue14117] Turtledemo: exception and minor glitches.

2014-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

21884 removed or moved global system-changing or gui calls to main. Wrapping 
two_canvases code (except for window preserving mainloop) to a new main fixed 
its problems.

Should remove reload from main driver, and test.

--

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



[issue21882] turtledemo modules imported by test___all__ cause side effects or failures

2014-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

2. Done
3. I just removed the setrecursionlimit call, added for 3.0. I moved the 
colormixer sliders around for longer than anyone is likely to and it ran fine.
4. two-canvases works fine now. The extra window just has to be clicked away.
5. nim had a call to turtle.Screen, now in main().
6. Done
Let's see what the buildbots say.

1. Since demos are part of the delivered stdlib, it could be argued that they 
should get minimal sanity check of being importable. I don't care either way. I 
leave this to either of you.

--
assignee: terry.reedy - 
stage: test needed - commit review

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



[issue17126] test_gdb fails

2014-06-30 Thread ddve...@ucar.edu

ddve...@ucar.edu added the comment:

I am not sure what you mean by Double Dutch, but let me try to restate the
problem.

This test fails (even with current python 2.7.7) with the stated version of
gdb (given the lack of feedback since I initially opened this ticket, I
have not verified that the failure mode is still exactly the same, and I
cannot check it right now, but let's assume it is).

Let's just pick one of the simple failures:

==
FAIL: test_exceptions (test.test_gdb.PrettyPrintTests)
--
Traceback (most recent call last):
  File /glade/scratch/ddvento/build/Python-2.7.3-westmere-gdb-
without-tipc/Lib/test/test_gdb.py, line 307, in test_exceptions
exceptions.RuntimeError('I am an error',))
AssertionError: op@entry=exceptions.RuntimeError('I am an error',) !=
exceptions.RuntimeError('I am an error',)
==

So this fails because there is a op@ prefix in the strings being compared
(many, but not all failures have this problem with string prefix). I do not
know anything about the test itself or the module under test, so I have no
idea whether or not that string prefix is essential for the module to work
properly.

Regards,
Davide

On Sun, Jun 29, 2014 at 4:46 PM, Mark Lawrence rep...@bugs.python.org
wrote:


 Mark Lawrence added the comment:

 Can we have a follow up on this please as most of the data in msg181358 is
 Double Dutch to me.

 --
 nosy: +BreamoreBoy
 type:  - behavior

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


--

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

Has anyone made any progress with this issue or others referenced like #7559 or 
#14787 ?  Regardless I'd like to help out directly if possible as I'm suffering 
from an acute case of triagitis :-)

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.3

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

Note that this issue is referred to from #15358.

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

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



[issue7559] TestLoader.loadTestsFromName swallows import errors

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

Note that #8297 referenced in msg102236 is closed see changeset d84a69b7ba72.

--

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



[issue14787] pkgutil.walk_packages returns extra modules

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

Note that this is reference from #15358.

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue5619] Pass MS CRT debug flags into subprocesses

2014-06-30 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy: +steve.dower, tim.golden, zach.ware
type:  - behavior
versions: +Python 3.4, Python 3.5 -Python 3.2, Python 3.3

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



[issue9116] test_capi.test_no_FatalError_infinite_loop crash on Windows

2014-06-30 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy: +steve.dower, tim.golden, zach.ware
versions: +Python 3.5 -Python 3.2, Python 3.3

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



[issue21889] https://docs.python.org/2/library/multiprocessing.html#process-and-exceptions doesn't explain exception

2014-06-30 Thread Karl Richter

New submission from Karl Richter:

Although the section 
https://docs.python.org/2/library/multiprocessing.html#process-and-exceptions 
(of the multiprocessing module documentation) is titled ... and exceptions it 
doesn't say anything about exceptions. I assume that it behaves like the thread 
API (as stated and referenced in the introduction of the module doc). This 
implies though that either the reference is limited to that statement (- 
remove and exceptions from the header as there's no special section on them 
because everything can be found in thread API) or add an explicit reference to 
the thread API. If this assumption is wrong the section is badly organized or 
doesn't make any sense at all.

I'm not yet sure about exception handling in the multiprocessing module in case 
it's different from threads, but that shouldn't matter for this doc issue 
report. 

I'd also like to suggest a more detailed section on exceptions with usage of 
queues to pass them as objects to the parent or another process.

--
assignee: docs@python
components: Documentation
messages: 221987
nosy: docs@python, krichter
priority: normal
severity: normal
status: open
title: 
https://docs.python.org/2/library/multiprocessing.html#process-and-exceptions 
doesn't explain exception
type: enhancement
versions: Python 2.7

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



[issue21882] turtledemo modules imported by test___all__ cause side effects or failures

2014-06-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The __all__ test now passes on Snow Leapard.

--

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



[issue16763] test_ssl with connect_ex don't handle unreachable server correctly

2014-06-30 Thread Mark Lawrence

Mark Lawrence added the comment:

Does the backport mentioned in msg178404 still need doing, can this be closed 
as out of date or won't fix or what?

--
nosy: +BreamoreBoy

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



[issue21861] io class name are hardcoded in reprs

2014-06-30 Thread Claudiu Popa

Claudiu Popa added the comment:

The same should be done for _pyio?

--
nosy: +Claudiu.Popa

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



  1   2   >