Re: hg, git, fossil, ...

2014-08-28 Thread Marko Rauhamaa
Ian Kelly : > So then to tag or branch a release I guess you would create the same > tag/branch on every single component subrepository? And when you need > to checkout that old version you checkout every subrepository > independently. Sounds painful, but not unworkable. Where I work, we actually

Re: hg, git, fossil, ...

2014-08-28 Thread Marko Rauhamaa
Ian Kelly : > On Wed, Aug 27, 2014 at 11:58 PM, Marko Rauhamaa wrote: >> I don't see why git has staging or branches, for example. > > I use short-lived development branches in git all the time. Start > working on a bug or feature, checkout a new branch specifically for > that work. I do the sam

Re: xml issue with Type 'bool' cannot be serialized

2014-08-28 Thread Ian Kelly
On Thu, Aug 28, 2014 at 2:58 PM, Noah wrote: > Hi list, > > I am not clear how to fix this issue. > > Traceback (most recent call last): > File "./command.py", line 81, in > connect(host, USER, PASSWORD) > File "./command.py", line 63, in connect > dump = etree.tostring(xml_cmd) > F

Re: python 3.4 use python-gcm can't import

2014-08-28 Thread Ian Kelly
On Thu, Aug 28, 2014 at 8:30 PM, Frank Liou wrote: > i just > > from gcm import GCM > > then > > > Traceback (most recent call last): > File "C:/Users/frank/Desktop/SinyiAPI/SinyiAPI.py", line 7, in > from Model.Order import Order > File "C:\Users\frank\Desktop\SinyiAPI\Model\Order.py", line

Re: Draft PEP - get the regex module into stdlib

2014-08-28 Thread Steven D'Aprano
Mark Lawrence wrote: > Here it is in full, comments welcome. I think you forgot to attach the document. Or your mail/news server deleted it. If you attach it as a .txt file (preferably in ReST format) even the most obnoxiously strict news server ought to accept it. > Please refer to http://bugs.

Re: hg, git, fossil, ...

2014-08-28 Thread Rustom Mody
On Friday, August 29, 2014 7:54:44 AM UTC+5:30, Chris Angelico wrote: > On Fri, Aug 29, 2014 at 12:20 PM, Ian Kelly wrote: > > But then what do you do if you need to checkout an intermediate > > revision of the project that isn't tagged? This need does arise. You > > can't just checkout the revisio

python 3.4 use python-gcm can't import

2014-08-28 Thread Frank Liou
i just from gcm import GCM then Traceback (most recent call last): File "C:/Users/frank/Desktop/SinyiAPI/SinyiAPI.py", line 7, in from Model.Order import Order File "C:\Users\frank\Desktop\SinyiAPI\Model\Order.py", line 7, in from gcm.gcm import GCM File "", line 2237, in _find_and_load

Re: hg, git, fossil, ...

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 12:20 PM, Ian Kelly wrote: > But then what do you do if you need to checkout an intermediate > revision of the project that isn't tagged? This need does arise. You > can't just checkout the revision you want of a particular component, > because that old revision of that com

Re: hg, git, fossil, ...

2014-08-28 Thread Ian Kelly
On Thu, Aug 28, 2014 at 10:17 AM, Marko Rauhamaa wrote: > In large repositories (like CPython), you have independent modules with > relatively independent (and typically linear) histories. Hg and git > don't want to respect that independence. > > As I said before, the problem is alleviated or goes

Re: hg, git, fossil, ...

2014-08-28 Thread Ian Kelly
On Wed, Aug 27, 2014 at 11:58 PM, Marko Rauhamaa wrote: > I don't think a working VC system needs to contain much more than that. > Hg stays closer to the simple ideal than git, which really fails at > being a black box. I don't see why git has staging or branches, for > example. I use short-live

Re: Draft PEP - get the regex module into stdlib

2014-08-28 Thread Skip Montanaro
On Thu, Aug 28, 2014 at 6:10 PM, Chris Angelico wrote: > Ow, that doesn't look like a draft PEP to me, that looks like a > 321-comment tracker issue. A PEP is usually a smidge more coherent > than that :) > From: http://legacy.python.org/dev/peps/pep-0001/ *PEP stands for Python Enhancement Pro

Re: Reading from sys.stdin reads the whole file in

2014-08-28 Thread Akira Li
Chris Angelico writes: > On Wed, Aug 27, 2014 at 4:37 PM, Steven D'Aprano wrote: >> On Wed, 27 Aug 2014 08:29:20 +0300, Marko Rauhamaa wrote: >> >>> Try flushing after each print. >> >> Doesn't help. > > It does, but insufficiently. If slurp.py is run under Py3, it works > fine; or take Naoki's

Re: Media Conversion Using Python - Converting MP3 to Other Formats

2014-08-28 Thread Akira Li
Mark Lawrence writes: > On 25/08/2014 16:28, Parth Trivedi wrote: >> Dear All, >> >> I need some help of yours. I want to convert audio in MP3 format to >> other formats including uncompressed raw format, WAV etc. and I am using >> python 2.7. Is there any built-in module I can use or any third p

Re: Draft PEP - get the regex module into stdlib

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 7:15 AM, Mark Lawrence wrote: > Here it is in full, comments welcome. > > Please refer to http://bugs.python.org/issue2636 > > That's all folks. Ow, that doesn't look like a draft PEP to me, that looks like a 321-comment tracker issue. A PEP is usually a smidge more cohere

Re: hg, git, fossil, ...

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 5:37 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> What you're saying, though, is that there's something inherently >> special about file boundaries. You want files to be magically >> separable within a repo. Why? What's the significance of the file? > > Files do have t

Re: Thread terminate

2014-08-28 Thread Cameron Simpson
On 28Aug2014 12:02, Marko Rauhamaa wrote: Ervin Hegedüs : at this time there is only one thread, as you wrote. I just try to prepare it to higher load, when one thread will not enough... Threads are a necessary evil when dealing with blocking function calls, but evil they remain. [...snip...]

Re: hg, git, fossil, ...

2014-08-28 Thread Mark Lawrence
On 28/08/2014 22:25, Tim Delaney wrote: On 29 August 2014 02:32, Tim Chase mailto:python.l...@tim.thechases.com>> wrote: No, you wouldn't use "hg pull" nor "git pull" but rather "git cherry-pick" or what Mercurial calls "transplant" (I've not used this in Mercurial, but I believe it

Re: Thread terminate

2014-08-28 Thread Chris Kaynor
On Thu, Aug 28, 2014 at 1:35 PM, Ervin Hegedüs wrote: > On Thu, Aug 28, 2014 at 12:34:18PM -0700, Chris Kaynor wrote: depending on what you are doing with the first two arguments to self._exit, >> the following might also work: >> >> def run(self): >> try: >> connect_to_db() >>

Re: hg, git, fossil, ...

2014-08-28 Thread Tim Delaney
On 29 August 2014 02:32, Tim Chase wrote: > > No, you wouldn't use "hg pull" nor "git pull" but rather "git > cherry-pick" or what Mercurial calls "transplant" (I've not used this > in Mercurial, but I believe it's an extension). > hg transplant has been deprecated for a long time now. The corre

Draft PEP - get the regex module into stdlib

2014-08-28 Thread Mark Lawrence
Here it is in full, comments welcome. Please refer to http://bugs.python.org/issue2636 That's all folks. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

xml issue with Type 'bool' cannot be serialized

2014-08-28 Thread Noah
Hi list, I am not clear how to fix this issue. Traceback (most recent call last): File "./command.py", line 81, in connect(host, USER, PASSWORD) File "./command.py", line 63, in connect dump = etree.tostring(xml_cmd) File "lxml.etree.pyx", line 3165, in lxml.etree.tostring (src/l

Re: When does True == True

2014-08-28 Thread Seymore4Head
On Thu, 28 Aug 2014 15:52:48 -0500, Andrew Berg wrote: >On 2014.08.28 15:38, Seymore4Head wrote: >> What am I doing wrong? True == True >True True == "True" >False type(True) > type("True") > > >Also, if is already a boolean test, and it is more Pythonic to simply write "if >p

Re: When does True == True

2014-08-28 Thread Joel Goldstick
On Aug 28, 2014 4:45 PM, "Seymore4Head" wrote: > > import math > import random > import sys > pigword="Razzamattaz" > print ("Pig Latin") > print ("Pick a word containing only alphabetical characters",pigword) > if len(pigword) > 0: > print (pigword) > else: > print ("empty") > if pigword.

Re: When does True == True

2014-08-28 Thread Andrew Berg
On 2014.08.28 15:38, Seymore4Head wrote: > What am I doing wrong? >>> True == True True >>> True == "True" False >>> type(True) >>> type("True") Also, if is already a boolean test, and it is more Pythonic to simply write "if pigword.isalpha():". -- https://mail.python.org/mailman/listinfo/pytho

When does True == True

2014-08-28 Thread Seymore4Head
import math import random import sys pigword="Razzamattaz" print ("Pig Latin") print ("Pick a word containing only alphabetical characters",pigword) if len(pigword) > 0: print (pigword) else: print ("empty") if pigword.isalpha() == "True": print (pigword) print ("True") else: pr

Re: Thread terminate

2014-08-28 Thread Ervin Hegedüs
Hi Chris, On Thu, Aug 28, 2014 at 12:34:18PM -0700, Chris Kaynor wrote: > On Thu, Aug 28, 2014 at 11:39 AM, Ervin Hegedüs wrote: > > > > now the code looks like this: > > > > def run(self): > > try: > > connect_to_db() > > except: > > self._exit(-1, "Connection error", sys.e

Re: importlib.util.find_spec()

2014-08-28 Thread Twirlip2
Excuse me for following up my own post; also, for continuing to use Google Groups (but I've been browsing news.gmane.org, with the intention of using it in future - once I understand how to use it). I should have read this: PEP 451 -- A ModuleSpec Typ

Re: Thread terminate

2014-08-28 Thread Chris Kaynor
On Thu, Aug 28, 2014 at 11:39 AM, Ervin Hegedüs wrote: > Hi Chris, > > thanks for you answer, > > On Thu, Aug 28, 2014 at 09:23:24AM -0700, Chris Kaynor wrote: > > On Thu, Aug 28, 2014 at 1:52 AM, Ervin Hegedüs > wrote: > > > > > > > In your case, you may want to just handle the exceptions insi

Re: hg, git, fossil, ...

2014-08-28 Thread Marko Rauhamaa
Chris Angelico : > What you're saying, though, is that there's something inherently > special about file boundaries. You want files to be magically > separable within a repo. Why? What's the significance of the file? Files do have that magic property. That's only an approximation, but it is a ver

Re: Thread terminate

2014-08-28 Thread Ervin Hegedüs
Hi Chris, thanks for you answer, On Thu, Aug 28, 2014 at 09:23:24AM -0700, Chris Kaynor wrote: > On Thu, Aug 28, 2014 at 1:52 AM, Ervin Hegedüs wrote: > > > > > In your case, you may want to just handle the exceptions inside the > > > thread's run() function directly. If that is not possible an

Re: hg, git, fossil, ...

2014-08-28 Thread Terry Reedy
On 8/28/2014 12:17 PM, Marko Rauhamaa wrote: Imagine we have CPython 3.9. It might have an ancient implementation of the deque. Then somebody realizes there's an embarrassing bug that requires a simple fix in a C file. The fix is implemented in HEAD. Then, it is propagated down to 3.9, 3.8, ...

Re: To modify IDLE source code

2014-08-28 Thread Terry Reedy
On 8/28/2014 6:34 AM, Abhiram R wrote: Hi, I've got the IDLE source code from IDLElib online. It also come with Python unless a distribution removes it. Now I want to modify it so as to improve upon it i.e > I have a feature in mind I want to add into it. If I may ask, what? For yourself on

Re: Thread terminate

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 2:23 AM, Chris Kaynor wrote: > If what you want is to make sure the error is not printed to stderr, you'll > just need to make sure the thread's run function does not exit with an > exception. The simpliest way to do that would be to wrap the entire thread's > run function

Re: hg, git, fossil, ...

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 2:17 AM, Marko Rauhamaa wrote: > Imagine we have CPython 3.9. It might have an ancient implementation of > the deque. Then somebody realizes there's an embarrassing bug that > requires a simple fix in a C file. The fix is implemented in HEAD. Then, > it is propagated down t

Re: hg, git, fossil, ...

2014-08-28 Thread Tim Chase
On 2014-08-28 19:17, Marko Rauhamaa wrote: > > I feel like I am misunderstanding you. My summary of what you > > just said is, "I have two scenarios where my code went through > > different sequences of changes to end up with the same content. > > I expect both of those paths will show the same hi

Re: Thread terminate

2014-08-28 Thread Chris Kaynor
On Thu, Aug 28, 2014 at 1:52 AM, Ervin Hegedüs wrote: > > > In your case, you may want to just handle the exceptions inside the > > thread's run() function directly. If that is not possible and you really > > need to handle them inside the main thread, you would need to store off > the > > error

Re: hg, git, fossil, ...

2014-08-28 Thread Marko Rauhamaa
Ned Batchelder : > I feel like I am misunderstanding you. My summary of what you just said > is, "I have two scenarios where my code went through different sequences > of changes to end up with the same content. I expect both of those > paths will show the same history." That sounds nonsensical

Re: running a python program

2014-08-28 Thread Mark Lawrence
On 28/08/2014 16:53, ngangsia akumbo wrote: thanks i figured it out So what did you feed the cat in the end? Or are we on a new topic? Or what? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.

Re: running a python program

2014-08-28 Thread ngangsia akumbo
thanks i figured it out -- https://mail.python.org/mailman/listinfo/python-list

Re: hg, git, fossil, ...

2014-08-28 Thread Ned Batchelder
On 8/28/14 1:58 AM, Marko Rauhamaa wrote: The main problem with hg (and git) is the way cherrypicking is done. See these graphics: [1] Product-Ver1 | | bugfix | V feature development Product-Ver1' -->

Re: To modify IDLE source code

2014-08-28 Thread Mark Lawrence
On 28/08/2014 11:34, Abhiram R wrote: Hi, I've got the IDLE source code from IDLElib online. Now I want to modify it so as to improve upon it i.e I have a feature in mind I want to add into it. Is there any documentation that will help me make sense (more easily) of each of the py files in said l

Re: hg, git, fossil, ...

2014-08-28 Thread Tim Chase
On 2014-08-28 08:58, Marko Rauhamaa wrote: > The main problem with hg (and git) is the way cherrypicking is done. > > See these graphics: > > [1] Product-Ver1 > | > | bugfix > | > V feature development >Product-Ver1'

Re: running a python program

2014-08-28 Thread Mark Lawrence
On 28/08/2014 10:31, ngangsia akumbo wrote: i have done so before posting here Done what, fed the cat? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: python string, best way to concat

2014-08-28 Thread Mark Lawrence
On 28/08/2014 13:08, Roy Smith wrote: In article <63bdccb4-9e34-4e40-b07d-14342e218...@googlegroups.com>, peter wrote: I used to struggle with the concept of ''.join(('hello ','world')) - it seemed so convoluted compared with the intuitive 'hello '+'world', and I could never remember the syn

Re: PyPI password rules

2014-08-28 Thread Skip Montanaro
On Thu, Aug 28, 2014 at 9:21 AM, Ethan Furman wrote: > What's the value in ruling out less common words? I would think the more > the merrier! I think less common "words" are likely to actually not be words, just misspellings of other words, and thus harder for the user to remember. More cruft

Re: PyPI password rules

2014-08-28 Thread Chris Angelico
On Fri, Aug 29, 2014 at 12:21 AM, Ethan Furman wrote: > On 08/27/2014 08:32 PM, Chris Angelico wrote: >> >> >> I'm not sure I understand how your 'common' value works, though. Does >> the default 0.6 mean you take the 60% most common words? Those above >> the 60th percentile of frequency? Somethin

Re: PyPI password rules

2014-08-28 Thread Ethan Furman
On 08/27/2014 08:32 PM, Chris Angelico wrote: I'm not sure I understand how your 'common' value works, though. Does the default 0.6 mean you take the 60% most common words? Those above the 60th percentile of frequency? Something else? What's the value in ruling out less common words? I would

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-28 Thread Chris Angelico
On Thu, Aug 28, 2014 at 11:44 PM, Frank Millman wrote: > I *think* I have created a project on GitHub and uploaded my software there. > It is called "AccInABox". https://github.com/FrankMillman/AccInABox Seems to be all there! You seem to have a default README.md as well as your README that has

Re: Thread terminate

2014-08-28 Thread Skip Montanaro
On Wed, Aug 27, 2014 at 1:55 PM, Ervin Hegedüs wrote: > what's the correct way to terminate a thread by itself? If this is something you need to do as a regular course of business, I'd share a Queue between the main thread and the target thread. When you want it to exit, shoot it a command to d

Re: What is acceptable as 'open-source'? [was Python vs C++]

2014-08-28 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmp_jfxth_l6us30gbotmbyhw_imu-pjdglevgj2nut...@mail.gmail.com... > On Wed, Aug 27, 2014 at 5:50 PM, Frank Millman wrote: >> >> This is quite a timely message for me. I am inching closer to releasing a >> version of my accounting software, and a lot of

Re: Py_SetProgramName() and prefixes

2014-08-28 Thread Chris Angelico
On Thu, Aug 28, 2014 at 10:42 PM, Marko Havu wrote: > Thanks for your kind help, Glad you got what you needed! I read your original post and had no idea what the issue was, so I skipped passed it and dealt with other posts instead. But sometimes the mere act of posting the question gives you what

Re: running a python program

2014-08-28 Thread ngangsia akumbo
thanks -- https://mail.python.org/mailman/listinfo/python-list

Re: Py_SetProgramName() and prefixes

2014-08-28 Thread Marko Havu
Marko Havu kirjoitti 28.8.2014 kello 12.58: > I have a problem with Py_Initialize() not being able to find python in the > path. Unless I use Py_SetProgramName() with the full path of the python > interpreter, I get the following error message: > Could not find platform independent libraries >

Re: python string, best way to concat

2014-08-28 Thread Mihamina Rakotomandimby
On 08/28/2014 03:08 PM, Roy Smith wrote: For places where performance doesn't matter, string addition is just fine. The computer works for you. If you're working for the computer, you're doing something wrong. I like this :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: python string, best way to concat

2014-08-28 Thread Roy Smith
In article <63bdccb4-9e34-4e40-b07d-14342e218...@googlegroups.com>, peter wrote: > I used to struggle with the concept of ''.join(('hello ','world')) - it > seemed so convoluted compared with the intuitive 'hello '+'world', and I > could never remember the syntax. Also, for the strings I was

Re: Py_SetProgramName() and prefixes

2014-08-28 Thread Marko Havu
I wrote earlier: > While doing some testing, I stumbled across some weird behavior on Python 3.3 > and 3.4: Py_GetPrefix(), Py_GetPath() and other functions that return paths > that are supposed to be set by Py_SetProgramName() all return just ”/”: > > main.c >

Re: PyPI password rules

2014-08-28 Thread Skip Montanaro
On Wed, Aug 27, 2014 at 11:28 PM, Skip Montanaro wrote: > Hmmm... I realize now that I'm not seeing all messages, at least I don't > think so. So much to learn about IMAP... I peeked at the code for the SpamBayes IMAP filter. Holy smokes! I think the IMAP RFC authors might have been sadists...

To modify IDLE source code

2014-08-28 Thread Abhiram R
Hi, I've got the IDLE source code from IDLElib online. Now I want to modify it so as to improve upon it i.e I have a feature in mind I want to add into it. Is there any documentation that will help me make sense (more easily) of each of the py files in said library? Thanks Abhiram -- https://mai

Py_SetProgramName() and prefixes

2014-08-28 Thread Marko Havu
Hi, I have a problem with Py_Initialize() not being able to find python in the path. Unless I use Py_SetProgramName() with the full path of the python interpreter, I get the following error message: Could not find platform independent libraries Could not find platform dependent libraries Consi

Re: running a python program

2014-08-28 Thread ngangsia akumbo
i have done so before posting here -- https://mail.python.org/mailman/listinfo/python-list

Re: running a python program

2014-08-28 Thread Chris Angelico
On Thu, Aug 28, 2014 at 7:10 PM, ngangsia akumbo wrote: > when i run python setup.py py2exe i get this error > > no module name py2exe any help please Any help? Sure. I'll offer three suggestions. 1) Don't top-post. 2) Don't use Google Groups, or edit your posts before sending. 3) Use a web sear

Re: Thread terminate

2014-08-28 Thread Ervin Hegedüs
Hi Marko, On Thu, Aug 28, 2014 at 12:02:29PM +0300, Marko Rauhamaa wrote: > Ervin Hegedüs : > > > at this time there is only one thread, as you wrote. I just try > > to prepare it to higher load, when one thread will not enough... > > Threads are a necessary evil when dealing with blocking funct

Re: running a python program

2014-08-28 Thread ngangsia akumbo
when i run python setup.py py2exe i get this error no module name py2exe any help please On Wednesday, August 27, 2014 8:39:28 AM UTC-7, Grant Edwards wrote: > On 2014-08-27, ngangsia akumbo wrote: > > > > > i have written a small scripts in python that inputs two values and > > > prints ou

Re: Thread terminate

2014-08-28 Thread Marko Rauhamaa
Ervin Hegedüs : > at this time there is only one thread, as you wrote. I just try > to prepare it to higher load, when one thread will not enough... Threads are a necessary evil when dealing with blocking function calls, but evil they remain. I would generally *not* associate a thread for each pa

Re: python string, best way to concat

2014-08-28 Thread Chris Angelico
On Thu, Aug 28, 2014 at 6:43 PM, Mark Lawrence wrote: > On 28/08/2014 09:30, peter wrote: >> >> I used to struggle with the concept of ''.join(('hello ','world')) - it >> seemed so convoluted compared with the intuitive 'hello '+'world', and I >> could never remember the syntax. Also, for the str

Re: Thread terminate

2014-08-28 Thread Ervin Hegedüs
Hi Chris, thanks for the reply, On Wed, Aug 27, 2014 at 12:26:48PM -0700, Chris Kaynor wrote: > On Wed, Aug 27, 2014 at 11:55 AM, Ervin Hegedüs wrote: > > > what's the correct way to terminate a thread by itself? > > > > To terminate the thread, the run function must exit. This can be either >

Re: python string, best way to concat

2014-08-28 Thread Mark Lawrence
On 28/08/2014 09:30, peter wrote: I used to struggle with the concept of ''.join(('hello ','world')) - it seemed so convoluted compared with the intuitive 'hello '+'world', and I could never remember the syntax. Also, for the strings I was generally using the performance penalty was infinites

Re: python string, best way to concat

2014-08-28 Thread peter
I used to struggle with the concept of ''.join(('hello ','world')) - it seemed so convoluted compared with the intuitive 'hello '+'world', and I could never remember the syntax. Also, for the strings I was generally using the performance penalty was infinitesimal, so I was just adding complexit

Re: python string, best way to concat

2014-08-28 Thread Marko Rauhamaa
peter : > Obviously this isn't going to change, but for concatenating short > strings a and b is there any practical reason to avoid a+b? Often, no. The biggest penalty is visual. For example, I would prefer this: "{}/{}".format(prefix, suffix) over prefix + "/" + suffix Really, I wo

Re: python string, best way to concat

2014-08-28 Thread MRAB
On 2014-08-27 23:59, Peter Otten wrote: Tim Chase wrote: On 2014-08-27 23:42, MRAB wrote: How many parameters are there? len(self.param) Make that many placeholders and then join them together with commas: ', '.join(['?'] * len(self.param)) I prefer the clarity of Peter Otten's suggestion