[ANN] Leipzig Python User Group - Meeting, June 12 2012, 08:00 p.m.
=== Leipzig Python User Group === We will meet on Tuesday, June 12 at 8:00 p.m. at the training center of Python Academy in Leipzig, Germany ( http://www.python-academy.com/center/find.html ). Everybody who uses Python, plans to do so or is interested in learning more about the language is encouraged to participate. While the meeting language will be mainly German, we will provide English translation if needed. Food and soft drinks are provided. Please send a short confirmation mail to i...@python-academy.de, so we can prepare appropriately. Current information about the meetings are at http://www.python-academy.com/user-group . Mike == Leipzig Python User Group === Wir treffen uns am Dienstag, 12.06.2012 um 20:00 Uhr im Schulungszentrum der Python Academy in Leipzig ( http://www.python-academy.de/Schulungszentrum/anfahrt.html ). Willkommen ist jeder, der Interesse an Python hat, die Sprache bereits nutzt oder nutzen möchte. Für das leibliche Wohl wird gesorgt. Eine Anmeldung unter i...@python-academy.de wäre nett, damit wir genug Essen besorgen können. Aktuelle Informationen zu den Treffen sind unter http://www.python-academy.de/User-Group zu finden. Viele Grüße Mike -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
PyCon Finland 2012 - Call for Proposals
PyCon Finland 2012 Call For Proposals PyCon Finland will take place October 22-23 in Espoo. The first day will feature presentations and the second is reserved for sprints and hands-on. We are currently accepting proposals for both talks and sprints. If you would like to give a presentation, organize a sprint or see presentations on a particular topic, please see instructions at http://fi.pycon.org. The deadline for proposals is the first of August. The organizers will notify accepted presenters and sprint coordinators by the 14th of August.. The presentation slots will be 20/40 minutes + 10 minutes of discussion at the end. Shared sessions are also possible. The language for the presentations should be English to encourage international participation. We are also trying to find a keynote speaker. If you know a good speaker who might be persuaded to come please let us know. Pycon Finland is not possible without corporate sponsorship. If you are interested in sponsoring this year’s event, please contact Python Finland at halli...@python.fi for details about sponsorship packages. -- Jyrki Pulliainen Chairman, Python Finland -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Decorator Pattern with Iterator
Greetings, I have a class that implements the iterator protocol, and tokenises a string into a series of tokens. As well as the token, it keeps track of some information such as line number, source file, etc. for tokens in Tokeniser(): do_stuff(token) What I want is to be able to wrap the tokeniser to add functionality to the base parser without subclassing, e.g. for tokens in processor(Tokeniser()): do_stuff(token) Sort of Decorator pattern, so that I can chain more processors, but I cannot think how to implement it. Any clues for me? Thanks TomH -- http://mail.python.org/mailman/listinfo/python-list
Re: Why does this leak memory?
Am 08.06.2012 18:02, schrieb Steve: Well, I guess I was confused by the terminology. I thought there were leaked objects _after_ a garbage collection had been run (as it said collecting generation 2). Also, unreachable actually appears to mean unreferenced. You live n learn... Actually I understand that differently. If you have circular references between two objects they are both referenced. If neither is referenced (directly or indirectly) by the current context, they are unreachable and can be garbage-collected. Being unreferenced implies that it is unreachable, but not vice-versa. Uli -- http://mail.python.org/mailman/listinfo/python-list
Re: which one do you prefer? python with C# or java?
Yesterday Paid於 2012年6月10日星期日UTC+8上午6時44分44秒寫道: I'm planning to learn one more language with my python. Someone recommended to do Lisp or Clojure, but I don't think it's a good idea(do you?) So, I consider C# with ironpython or Java with Jython. It's a hard choice...I like Visual studio(because my first lang is VB6 so I'm familiar with that) but maybe java would be more useful out of windows. what do you think? If the goal is to write programs to be cross-platform, then I suggest some utilities like p2c (pascal to c), and f2c (fortran to c), and etc. to be available. Also source programs which are structured well with unit tests do help a lot in translations to other computer languages. -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
What GUI designer would come the closest to the way that Cocoa's Interface Builder works? I.e. is there any one (cross-platform) that allows to actually connect the GUI created directly to the code and make it available live in an IDE? This whole cycle of design GUI-generate code-add own code to generated code-run application with GUI has always seemed very un-pythonic to me. A dynamic, interpreted language should allow to work in a more lively, direct way to build a GUI. I'm curious about your point but I don't really understand it. Could you try again without using any scare-quoted words? myidea.explanation.retry() Python has this insanely great thing that e.g. Delphi, Java, C#, Visual Basic, etc. lack and that's called an interactive commandline interpreter, which allows you to build GUIs while exploring/trying out the API of a GUI framework step by step. You simply type the code for the GUI at the python prompt and your GUI comes directly to life. Here's an example by someone else: http://pysnippet.blogspot.de/2010/11/getting-interactive-with-pyqt.html Now just (sorry for those quotes again) imagine a GUI builder that generates _and_ _runs_ the code (pyqt, wxpython, pygtk, whatever) for the GUI you edit _while_ you do so. And now imagine that this GUI builder would be integrated with the IDE you use (I use one), so that the GUI code is run in the same interpreter instance as the other code of your application. So that you can directly interact with your application through the GUI you build while you do so. The advantage of using a GUI builder over typing the code into the interpreter window would be that users who rarely implement a GUI(*) would not need to re-dig into the details of the API every time. This is especially tedious since those APIs are essentially C++ APIs wrapped in Python and thus they are honestly simply §$%@# to use for a certain type of Python user(*). And the lack of Python-specific documentation, tutorials etc. doesn't really help. Did I mention yet that just having to read C++ example code in documentation makes me spill my last meal over keyboard, screen etc.? Of course there's PyGUI, but that's unfortunately far from being as complete as PyQt or wxPython and unless someone creates something like an equivalent of Apache Software Foundation for Python, declares PyGUI as the canonical Python GUI framework and funds the work needed to complete it... And then you still need a GUI builder for it. *sigh* Maybe given an example of creating a small text editor application with a GUI builder/ IDE in this Pythonic way you are hoping for. I'm not into text editors as example applications since I don't develop text editors, I rarely even use one. And besides, I don't think any typical user(*) of such a GUI builder would ever implement a text editor in his whole life. Personally, my typical use of such a GUI builder would be for database applications. Which make up, according to my experience, for at least 90% of all custom-built applications in companies. Today, these applications have to be made by external, paid developers who have typically no clue of the application domain in question. Consequently, the applications, no matter how many pages of detailed specifications you as the domain expert write, never do what you wanted them to do. Although just writing the specification takes more time than it would take to implement it myself if only the (GUI) tools and (GUI) frameworks(**) for Python would be at the level required to make them useful for such developers as me(*). And did I mention that the cost of external developers (plus the overhead cost for interaction with them) makes them prohibitive anyway? And did I mention that the time required such external development (plus the overhead time for interaction with the external developers) takes doesn't help either? * Such as casual Python scripting dilettants who are not full-time software developers but domain experts who just use Python to help get their main work done. ** In my case of database applications, something like this: http://www.nakedobjects.org/book/ http://www.nakedobjects.org/downloads/Pawson%20thesis.pdf Sincerely, Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
What GUI designer would come the closest to the way that Cocoa's Interface Builder works? I.e. is there any one (cross-platform) that allows to actually connect the GUI created directly to the code and make it available live in an IDE? If you're developing on the Mac, PyObjC allows you to use Interface Builder for developing Python apps. I know that. And no, I haven't used Interface Builder yet myself, just because I would need those GUIs also to run elsewhere than on my private Mac. However, there are those of us who are deeply uncomfortable with IB and related tools, such as RealBasic and LiveCode/Runtime Revolution. I haven't used any of these either, just because I don't like those languages. Their syntax is ugly, static type declarations are imho perfectly redundant for interpreted languages and besides they don't offer me an interactive interpreter, which is an absolute must-have for my day-to-day use of Python - office automation, ad-hoc information logistics etc. (errr, sorry for those quotation marks again... ;-). These tools make code organization very hard by reducing the amount of code written to the point of the UI working by magic, Any modern GUI framework has quite a lot of magic going on behind the curtains without that the user needs to know or understand how it works. And this is the way it _should_ be. As long as it is well documented how to use that magic. The current GUI frameworks which are available for Python require way too much glue code that needs to be written by hand, imho simply because they are primitive wrappers around frameworks for C++ developers who are used to such bulkloads of slave labour. Python as a language is way ahead of C++, Java, C# etc. in terms of functionality that you can implement per coding effort required , but it simply lacks GUI frameworks and corresponding development tools that are equally efficient. and/or by breaking up your code into little snippets that you can only view by clicking on the widget in the UI tool. I remember reading about RAD IDEs/frameworks out there that managed to integrate/seperate their generated code with/from user-written code quite well. And which could even use external revision control systems etc.. Back in the good old days of software diversity, before MS/Java took over the whole world... A related issue is that using a tool such as this makes you heavily dependent on that particular tool, and subject to its developers' priorities, release schedule, and bugs. This is true with _any_ language, library, framework or software. Heck, it's even true with hardware! If this was such a show-stopper, we would still write computer programs like this: 0100011100101010101 Well, certainly not me, in that case. The pace of Xcode development--with Apple making frequent changes to project formats in a backwards-incompatible way--is an example of this. Wxwidgets/python has a reputation for frequent incompatible API changes, too... And Apple's product politics, oh, well, errr, uhm, don't get me into that... *sigh*. If only all those third-party applications for MacOS X were available on Linux, I would happily forget about Apple's very existence. One reason I prefer to code UI's by hand is because a) in Tkinter it's very easy to do, Tkinter is imho honestly the very best argument if you want to make potential new users turn their backs away from Python for good. Just show them one GUI implemented with it and, hey, wait, where are you running to... I think these issues are a reason that the slick drag-and-drop UI builders tend to be developed by commercial software shops to support their language and/or IDE, but find little traction among open-source developers and languages. The point is that loads of potential developers(*) simply don't ever get to use Python due to the very lack of such tools (and corresponding frameworks). * Domain experts in fact who would need to implement loads of software to help them get their work done but can't. And since there's no budget for external developers, nothing get's ever done about this. Sincerely, Wolfgang -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
On 6/11/12 8:01 AM, Wolfgang Keller wrote: Tkinter is imho honestly the very best argument if you want to make potential new users turn their backs away from Python for good. Just show them one GUI implemented with it and, hey, wait, where are you running to... Yes, Tkinter GUI's are very ugly. http://www.codebykevin.com/phynchronicity-running.png http://www.codebykevin.com/quickwho-main.png -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
On 11/06/2012 13:47, Kevin Walzer wrote: Yes, Tkinter GUI's are very ugly. http://www.codebykevin.com/phynchronicity-running.png http://www.codebykevin.com/quickwho-main.png At last we're getting to the crux of the matter. Provided that the GUI is pretty who cares about picking appropriate algorithms for the code, or a sensible database design or whatever. And heaven forbid that anyone suggest using a command line even if this was the better solution for the problem that the user wants solved. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list
Decorator Pattern with Iterator
On 11 June 2012 08:51, Tom Harris celephi...@gmail.com wrote: Greetings, I have a class that implements the iterator protocol, and tokenises a string into a series of tokens. As well as the token, it keeps track of some information such as line number, source file, etc. for tokens in Tokeniser(): do_stuff(token) What I want is to be able to wrap the tokeniser to add functionality to the base parser without subclassing, e.g. for tokens in processor(Tokeniser()): do_stuff(token) Sort of Decorator pattern, so that I can chain more processors, but I cannot think how to implement it. Any clues for me? Maybe I've misunderstood. Is this what you're looking for? def processer(tokens): for token in tokens: yield func(token) Thanks TomH -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers � la Interface Builder (Re: what gui designer is everyone using)
Dietmar Schwertberger n...@schwertberger.de wrote: But the fact that Tkinter is still the standard GUI toolkit tells a lot about the situation... ... Sure, I know how to code GUIs. But the learning curve is too steep for new users wanting to implement simple GUIs. As is obvious to everybody, the massive interest in web-based applications in recent years has certainly not helped advance the state of the art in desktop GUI's, nor enlarged the developer population actively engaged in maintaining and improving desktop GUI toolkits. Given that, we're likely stuck with more or less what we have now, so let's make the best of it. On the Tkinter front, I just want to reiterate two important points that are not nearly as well known as they should be. First, it is possible and in fact easy to do decent looking GUI's in Tkinter, with the caveat that you do in fact have to do things very slightly differently than you would have 15 years ago. Shocking, I know. Second, there does exist at least one fairly good source of documentation for new users wishing to do exactly this (according to many, many comments I have received), though that documentation is admittedly buried in a sea of out-of-date information that is still all too easy to find. Please see http://www.tkdocs.com and in particular the tutorial there. Mark -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Wolfgang Keller felip...@gmx.net writes: This whole cycle of design GUI-generate code-add own code to generated code-run application with GUI has always seemed very un-pythonic to me. A dynamic, interpreted language should allow to work in a more lively, direct way to build a GUI. What about Qt Quick? I have used it very little, but it does allow dynamic modification of the GUI elements so that the application changes on the fly. I don't know how pythonic it is, since the GUI is described in QML, which combines CSS and javascript. -- http://mail.python.org/mailman/listinfo/python-list
python with xl
Hi, How to append the list of data in individual column of XL file, every time from python script . -- http://mail.python.org/mailman/listinfo/python-list
Re: python with xl
Le 11/06/2012 16:12, chebrian a écrit : Hi, How to append the list of data in individual column of XL file, every time from python script . In standard lib = module csv (ascii comma separated values) In non standard = binary xl = module xlrd for reading and module xlwt for writing (http://www.python-excel.org/) Cheers Karim -- http://mail.python.org/mailman/listinfo/python-list
Re: Decorator Pattern with Iterator
On Mon, Jun 11, 2012 at 1:51 AM, Tom Harris celephi...@gmail.com wrote: Greetings, I have a class that implements the iterator protocol, and tokenises a string into a series of tokens. As well as the token, it keeps track of some information such as line number, source file, etc. So each processor needs to be able to access that information? A decorator pattern for the processors to propagate that information down might look like this: class TokenProcessor(object): def __init__(self, processor): self._processor = processor def __call__(self, tokens): self._tokens = tokens return self._processor(tokens) @property def line_number(self): return self._tokens.line_number @property def source_file(self): return self._tokens.source_file @TokenProcessor def processor(tokens): for token in tokens: line_number = tokens.line_number do_stuff(token, line_number) yield token for token in processor_1(processor_2(tokeniser)): do_more_stuff(token) -- http://mail.python.org/mailman/listinfo/python-list
Ann: New Stackless Website
I'm very happy to announce == Stackless Python has a New Website == Due to a great effort of the Nagare people: http://www.nagare.org/ and namely by the tremendous work of Alain Pourier, Stackless Python has now a new website! This is no longer Plone based, but a nicely configured Trac site. The switch to it has happened right now, the old website will be around for a few days under http://zope.stackless.com while the new site is accessible as http://www.stackless.com stackless.com now allows the source to be browsed (an hourly updated clone from hg.python.org) and includes a new issue tracker. Please let me know if you encounter any problems. cheers -- Chris -- Christian Tismer :^)mailto:tis...@stackless.com tismerysoft GmbH : Have a break! Take a ride on Python's Karl-Liebknecht-Str. 121 :*Starship* http://starship.python.net/ 14482 Potsdam: PGP key - http://pgp.uni-mainz.de work +49 173 24 18 776 mobile +49 173 24 18 776 fax n.a. PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04 whom do you want to sponsor today? http://www.stackless.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: which one do you prefer? python with C# or java?
On 10.06.2012 23:27, Paul Rubin wrote: Here is an exercise from the book that you might like to try in Python: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-24.html#%_idx_3894 It's not easy ;-) I liked this exercize. At first I wrote my own merger. def merge(*iterables): iterables = list(iterables) current = [i.next() for i in iterables] last = None while True: m = min(current) while last == m: p = current.index(m) try: current[p] = iterables[p].next() except StopIteration: del current[p] del iterables[p] if len(current) == 0: raise StopIteration m = min(current) yield m last = m But then I realised the vast library of python already contained (a faster) one (propably based upon http://code.activestate.com/recipes/491285-iterator-merge/), which just needed to be enhanced a little bit to allow duplicate items to be removed: import heapq def skipdups(m): l = k = m.next() yield k while True: while l == k: k = m.next() yield k l = k def gen_s(): s = [1] m = skipdups(heapq.merge(*[(lambda j: (k*j for k in s))(n) for n in [2,3,5]])) yield s[0] while True: k = m.next() s.append(k) yield k Now gen_s() generates the wanted sequence. Greetings -- http://mail.python.org/mailman/listinfo/python-list
Where to set default data - where received, or where used
I'm programming a project which will use a file to save parameters needed by the program. There are already two previous file formats, each of which can only be run by the version of the program which created them. I'm trying to avoid that problem in the future. To do that, I intend to use a dictionary, and default data. I believe that most new versions will add parameters. Each version of the program will have reasonable default values for each key in the dictionary handled by that version. If an older file is used, the data values in that file replace the keys that exist. The program then can operate on the values supplied by the older data file and the default values. Conversely, if a newer file is used, the data in the file replaces the keys in the dictionary. The program then simply doesn't access the newer data values. I'm hoping that this will make the file backward and forward compatible. Here's my question. I could do this by creating the dictionary with the default values, then read the file into it. Or I could use a 'get' with default values at the location in the program where those values are used. From what I can see, creating the dictionary with default values puts everything in one place. While, supplying the default values at the place where they're used places the default values nearest the place where actually used. I can't decide on one way over the other. Can anyone give me some ideas if one is a preferred method, or other criteria I've overlooked? Thanks, Den -- http://mail.python.org/mailman/listinfo/python-list
RE: Where to set default data - where received, or where used
This is really up to your programming style, but I'm of the opinion that defining all of the default values in one place keeps maintenance easier. Of course, if it's done differently elsewhere in your code base, I would aim for consistency instead. Thanks, Nick Cash -Original Message- From: python-list-bounces+nick.cash=npcinternational@python.org [mailto:python-list-bounces+nick.cash=npcinternational@python.org] On Behalf Of Dennis Carachiola Sent: Monday, June 11, 2012 13:38 To: python-list@python.org Subject: Where to set default data - where received, or where used I'm programming a project which will use a file to save parameters needed by the program. There are already two previous file formats, each of which can only be run by the version of the program which created them. I'm trying to avoid that problem in the future. To do that, I intend to use a dictionary, and default data. I believe that most new versions will add parameters. Each version of the program will have reasonable default values for each key in the dictionary handled by that version. If an older file is used, the data values in that file replace the keys that exist. The program then can operate on the values supplied by the older data file and the default values. Conversely, if a newer file is used, the data in the file replaces the keys in the dictionary. The program then simply doesn't access the newer data values. I'm hoping that this will make the file backward and forward compatible. Here's my question. I could do this by creating the dictionary with the default values, then read the file into it. Or I could use a 'get' with default values at the location in the program where those values are used. From what I can see, creating the dictionary with default values puts everything in one place. While, supplying the default values at the place where they're used places the default values nearest the place where actually used. I can't decide on one way over the other. Can anyone give me some ideas if one is a preferred method, or other criteria I've overlooked? Thanks, Den -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: which one do you prefer? python with C# or java?
On Sat, 9 Jun 2012, Yesterday Paid wrote: I'm planning to learn one more language with my python. Someone recommended to do Lisp or Clojure, but I don't think it's a good idea(do you?) So, I consider C# with ironpython or Java with Jython. It's a hard choice...I like Visual studio(because my first lang is VB6 so I'm familiar with that) but maybe java would be more useful out of windows. what do you think? If you don't know C yet, I second recommendation to learn it. It is a very 70-tish and 80-tish language, but it is still very relevant if you want to call yourself a programmer (rather than a hobbyist, with all credits due to clever genius hobbyists out there). There are things I would rather do in C than in any other language (like, writing a Python interpreter or Linux kernel - wait, what you say they have been written already?). Also, it gives one a way to handtune the code quite a lot (at expense of time, but this is sometimes acceptable), to the point where next choice is assembly (and results not necessarily better)... Later on, since C and C++ share quite a bit, you can gradually include C++ elements into your code, thus writing in a kinda bettered C (compiled with C++ compiler), using constructs like const to make your programs more correct. And you will learn to not use new for variables, which is good thing. However, some C++ constructs include performance penalty, so it is good to not better it too much. Later on, you could choose from the list: - Common Lisp - nice industrial standard (depends on one's preferred definition of nice, of course, as well as industrial and standard) - Racket - Scheme on steroids, with IDE, JIT and crossplatform-ity (I can think of somebody writing Python/Racket to be used in this environment but it is hard to imagine someone doing the other direction, so go figure ;-) http://www.reddit.com/r/programming/comments/i1slm/amazing_tutorial_demonstrating_the_power_of/ http://hashcollision.org/brainfudge/ ) - Haskell or Ocaml - but I have a feeling Ocaml is developing at slower pace now, with many people choosing Haskell (I guess they sometimes curse themselves for this, because behaviour of code in Haskell is a bit hard to predict, sometimes). If you want to delve into Java world, well, I consider Java an unbearably ugly hog. When I was younger and fearless I programmed a bit in Java, but nowadays, the only way I myself could swallow this would be to use some other language on top of it (Scala, Clojure or Kaffe). C# as a - kind of - Java clone from MS, is not really so attractive to me. (Yes, both Java and C# have some merits in some situations, so do COBOL, VB and Fortran but I tend to avoid such situations and thus life gets much simpler). If you would like to bend your mind a little, Racket or Forth or Smalltalk (in a form of SqueakVM) could do the job. Every time I read about Smalltalk and think how Java took over, I mentally weep. Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did rm -rif on the programmer's home** ** directory. And then the C programmer became enlightened... ** ** ** ** Tomasz Rola mailto:tomasz_r...@bigfoot.com ** -- http://mail.python.org/mailman/listinfo/python-list
Re: which one do you prefer? python with C# or java?
On Mon, 11 Jun 2012, Tomasz Rola wrote: If you want to delve into Java world, well, I consider Java an unbearably ugly hog. When I was younger and fearless I programmed a bit in Java, but nowadays, the only way I myself could swallow this would be to use some other language on top of it (Scala, Clojure or Kaffe). Uhuh, I meant Kawa, not Kaffe: http://en.wikipedia.org/wiki/Kawa_(Scheme_implementation) Regards, Tomasz Rola -- ** A C programmer asked whether computer had Buddha's nature. ** ** As the answer, master did rm -rif on the programmer's home** ** directory. And then the C programmer became enlightened... ** ** ** ** Tomasz Rola mailto:tomasz_r...@bigfoot.com ** -- http://mail.python.org/mailman/listinfo/python-list
Sybase module 0.40 released
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.40.tar.gz The module home page is here: http://python-sybase.sourceforge.net/ MAJOR CHANGES SINCE 0.39: Modify the DateTimeAsPython output conversion to return None when NULL is output support for Python without threads Ignore additional non-error codes from Sybase (1918 and 11932) Use outputmap in bulkcopy mode (thanks to patch by Cyrille Froehlich) Raise exception when opening a cursor on a closed connection Added unit tests Added new exception DeadLockError when Sybase is in a deadlock situation Add command properties CS_STICKY_BINDS and CS_HAVE_BINDS Added support for inputmap in bulkcopy reuse command and cursor when calling cursor.execute with same request Use ct_setparam to define ct_cursor parameters types instead of ct_param implicit conversion for CS_DATE_TYPE in CS_DATETIME_TYPE DataBuf Adding ct_cmd_props wrapper Increase DataBuf maxlength for params of a request when using CS_CHAR_TYPE params so that the buf can be reused BUGS CORRECTED SINCE 0.39: Corrected money type when using CS_MONEY4 (close bug 2615821) Corrected thread locking in ct_cmd_props (thanks to patch by Cyrille Froehlich) Corrected bug in type mapping in callproc (thanks to report by Skip Montanaro) Correct passing None in a DataBuf (thanks to patch by Bram Kuijvenhoven) The full ChangeLog is here: https://python-sybase.svn.sourceforge.net/svnroot/python-sybase/tags/r0_40/ChangeLog -- http://mail.python.org/mailman/listinfo/python-list
Re: Where to set default data - where received, or where used
On 06/11/2012 02:37 PM, Dennis Carachiola wrote: I'm programming a project which will use a file to save parameters needed by the program. There are already two previous file formats, each of which can only be run by the version of the program which created them. I'm trying to avoid that problem in the future. To do that, I intend to use a dictionary, and default data. I believe that most new versions will add parameters. Each version of the program will have reasonable default values for each key in the dictionary handled by that version. If an older file is used, the data values in that file replace the keys that exist. The program then can operate on the values supplied by the older data file and the default values. Conversely, if a newer file is used, the data in the file replaces the keys in the dictionary. The program then simply doesn't access the newer data values. I'm hoping that this will make the file backward and forward compatible. Here's my question. I could do this by creating the dictionary with the default values, then read the file into it. Or I could use a 'get' with default values at the location in the program where those values are used. From what I can see, creating the dictionary with default values puts everything in one place. While, supplying the default values at the place where they're used places the default values nearest the place where actually used. I can't decide on one way over the other. Can anyone give me some ideas if one is a preferred method, or other criteria I've overlooked? Thanks, Den i would do it at the point of input. In fact, one option might be to save an updated version of the file, with the missing fields filled in. By doing it all in one place, you can test whether the code works with each external variant you intend to support, and gives you one place to fix whatever incompatibilities you find. You very well might discover you need a fancier algorithm than just having default values. For example, you might fill in missing values with a computation based on the values you do have. Further, if it gets really messy, you might end up with multiple input funcitons, keyed on the type (version) of the file. The point is, none of the other code should care one iota. I certainly hope the version information for those existing files is unambiguously stored. -- DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: which one do you prefer? python with C# or java?
On 11/06/12 06:20, rusi wrote: Hi Matěj! If this question is politically incorrect please forgive me. Do you speak only one (natural) language -- English? And if this set is plural is your power of expression identical in each language? I have written about that later ... no, I am a native Czech, but I have passive Russian, and active English. But there is a difference ... I can read and enjoy beautiful texts in Russian or English (couple of months read Eugen Onegin in Russian and that's just a beauty! or C.S.Lewis ... oh my!) but I will never be able to write professionally in these languages. I can write (as evidenced by this message) somehow in English, but I cannot imagine that I would be ever professional art writer or (even worse) poet. I could imagine (if spent couple of thousands of days working on it) that I would be a Czech professional writer though. Matěj -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Am 11.06.2012 06:05, schrieb rusi: If python is really a language maven's language then it does not do very well: - its not as object-oriented as Ruby (or other arcana like Eiffel) - its not as functional as Haskell - its not as integrable as Lua - its not as close-to-bare-metal as C - etc Depends on the definition. Maybe, that Python is not a perfect language from an academic point of view, but it's a good choice for anyone looking for a pragmatic programming language. Then why is it up-there among our most popular languages? Because of the 'batteries included.' It's not only the batteries, but also the language itself. As someone wrote a long time ago Python fits my brain. And not having a good gui-builder is a battery (cell?) that is lacking. It's a cell that would make it much easier to compete with other languages/environments. These environments need not necessarily be classical programming language, but could also be Labview, Matlab etc. And regarding popularity, I see very much potential. I have been working for two high-tech companies and I have never met anyone else using Python there. Focus is not classical databases, but data acquisition and processing. Many are still using VB, some are even using HT/HP-BASIC. Quite a lot moved to Labview, some are using Matlab or thinking about moving to it. The ones who actually see the point the advantages of a general purpose language moved to C#. (Nobody is using Java in this context as it obviously would not make any sense.) Anyway, I don't see how people could be persuaded to use a console-only environment, which - realistically - Python is at the moment for most people. From what I see, Python is recognized as a language for scripting and maybe for web servers, but not as a general purpose language to implement GUI software. (To make it clear: I have been using Python as a general purpose language for many years.) Regards, Dietmar -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Am 11.06.2012 14:01, schrieb Wolfgang Keller: * Domain experts in fact who would need to implement loads of software to help them get their work done but can't. And since there's no budget for external developers, nothing get's ever done about this. Well, typically or at least very often sooner or later something gets done about this as someone finds out that all could be solved using MS Excel and some macros / VBA programming. I would prefer people to invest the same time into a Python based solution. But then we're back to the initial point: As long as there's no GUI builder for Python, most people will stick to Excel / VBA / VB. Regards, Dietmar -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Am 11.06.2012 16:14, schrieb Anssi Saari: Wolfgang Kellerfelip...@gmx.net writes: This whole cycle of design GUI-generate code-add own code to generated code-run application with GUI has always seemed very un-pythonic to me. A dynamic, interpreted language should allow to work in a more lively, direct way to build a GUI. What about Qt Quick? I have used it very little, but it does allow dynamic modification of the GUI elements so that the application changes on the fly. I don't know how pythonic it is, since the GUI is described in QML, which combines CSS and javascript. I have been following the Qt development as I have been using PySide for some small projects on the Maemo platform. Qt Quick / QML seems to enable the implementation of so-called modern UIs. It's more for people who think that HTML5/CSS/Javascript is the future for UIs. Well, maybe they are right for certain advanced requirements. But for the beginner I don't see how it would help as it's even more difficult to link the GUI to the backend code and also I don't see how having to deal with multiple environments would make things easier. I think that for beginners some basic controls are fine enough and there's no need to care for fancy effects for the most non-consumer applications. For getting an impression about Qt Quick, have a look at http://qt.nokia.com/qtquick/ (The slide show 1,2,3,...) Regards, Dietmar -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Am 11.06.2012 16:09, schrieb Mark Roseman: On the Tkinter front, I just want to reiterate two important points that are not nearly as well known as they should be. First, it is possible and in fact easy to do decent looking GUI's in Tkinter, with the caveat that you do in fact have to do things very slightly differently than you would have 15 years ago. Shocking, I know. Yes, but when I have the choice between Tkinter, Qt and wx, I still would go for wx or Qt (or stick to wx which I chose 12 years ago). I don't see the point of chosing Tkinter over the other toolkits. Second, there does exist at least one fairly good source of documentation for new users wishing to do exactly this (according to many, many comments I have received), though that documentation is admittedly buried in a sea of out-of-date information that is still all too easy to find. Please see http://www.tkdocs.com and in particular the tutorial there. The point of this thread is that Python is not attractive to casual users who want to implement some GUI programs. I don't see how that would change without an easy-to-use GUI builder, no matter how good the documentation is. Of course, it's possible to split up the documentation into many small building blocks which the user could copy paste together. But then we have a poor-man's GUI builder. I doubt that it would attract new users. (For more straightforward tasks like hardware control / data acquisition I made good experiences with a Wiki-based approach of providing snippets. But *simple* GUIs are mainly visual and there should be a way to create them visually without consulting much documentation.) Regards, Dietmar -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
Am 11.06.2012 01:15, schrieb Chris Angelico: If you're a complete non-programmer, then of course that's an opaque block of text. But to a programmer, it ought to be fairly readable - Well, I can read the code. But still I would not be able (or interested) to write C++/GTK code. With my rusty C++ knowledge and a simple GUI builder, I might be able to create the GUI, though. Whether I could then connect the events to actions is a different question and depends on the GUI builder. If it does not support this, then I would just not write the software. That's the starting point of this thread: for Python we could not identify such a GUI editor. it says what it does. I'm confident that anyone who's built a GUI should be able to figure out what that's going to create, even if you've never used GTK before. (And yes, it's not Python. Sorry. I don't have a Python example handy.) All the discussion about casual users being able to implement GUIs by manually coding it is somehow based on the assumption that suitable examples for any purpose are available. So to me the above example seems to be the proof that suitable examples are not available easily. Modern UI toolkits are generally not that difficult to use. Add just a few convenience functions (you'll see a call to a button function in the above code - it creates a GTK2.Button, sets it up, and returns it), and make a nice, well-commented configuration file that just happens to be executed as Python, and you've made it pretty possible for a non-programmer to knock together a GUI. They'll have learned to write code without, perhaps, even realizing it. Right, they are not too difficult to use for full-time programmers or for people who want to invest a lot of time (as hobbyist). But there are many people who just need to get things done and who don't want to invest too many time on a simple GUI. No matter how cool it may seem to create simple GUIs manually or to write business letters using LaTeX: just try to persuade people to move from Word to LaTeX for business letters... Regards, Dietmar -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
On Jun 10, 11:05 pm, rusi rustompm...@gmail.com wrote: If python is really a language maven's language then it does not do very well: - its not as object-oriented as Ruby (or other arcana like Eiffel) if it were object-oreiented as Ruby, then why not use Ruby? - its not as functional as Haskell if it were as functional as Haskell, then why not use Haskell? - its not as integrable as Lua if it were as integrable as Lua, then why not use Lua? - its not as close-to-bare-metal as C if it were as asinine as C, then why not use C? - etc exactly! Then why is it up-there among our most popular languages? Because of the 'batteries included.' No. It's up there because it does not FORCE you to program in a single paradigm. Look. I love OOP. It works well for so many problems -- but not for ALL problems! I like the freedom i have when using Python. I don't get that feeling anywhere else. And not having a good gui-builder is a battery (cell?) that is lacking. Nonsense. I'm not saying we should NEVER have a visual gui builder, no, but i am saying that we don't need one to be a great language. -- http://mail.python.org/mailman/listinfo/python-list
Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)
On Jun 11, 9:09 am, Mark Roseman m...@markroseman.com wrote: Second, there does exist at least one fairly good source of documentation for new users wishing to do exactly this (according to many, many comments I have received), though that documentation is admittedly buried in a sea of out-of-date information that is still all too easy to find. Well you Mark you have really hit it this time. * Outdated tuts are contributing to the slow adoption of Python3000 * Outdated tuts are contributing the animosity towards Tkinter. * Poorly written tuts are doing even more damage. I have pointed this out before with very little feedback from our community members. So you know what i did... about two years ago i start a quest to rid the WWW of old and outdated tutorials. I send out email after email; begging; pleading, and yes even brown-nosing!... and you know how many reposes i got? Three! Yes three! And one of the three told me to eef-off. The other two chaps not only updated their tutorials, they even sent me a nice Thank you letter. Oh. And the one who told me to eff-off, he re-read my email and decided he took it out of context and then he updated his tut also. You see. If I, or me rather, the despised and hated rantingrick can inspire three people to contribute positively to this community, well, just imagine what you or *gasps* GvR could do! Is any heavy weight willing to step forward and be heard? What say you? The silence is deafening. -- http://mail.python.org/mailman/listinfo/python-list
[issue15040] stdlib compatability with pypy: mailbox.py
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: I'm not sure about the __del__: if pypy's deferred garbage collection is not enough to close self._file, how can a __del__ method help? -- nosy: +amaury.forgeotdarc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15040 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13691] pydoc help (or help('help')) should show the doc for help
Petr Kubat killm...@gmail.com added the comment: I see. So calling help('help') should produce the documentation on the help() function and typing help at the help prompt should print the help for the prompt. Tricky indeed. I think I'll look at it during the day after tomorrow and post some results (if any). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13691 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()
Changes by Nick Coghlan ncogh...@gmail.com: -- assignee: - ncoghlan stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7300] Unicode arguments in str.format()
Changes by Gökçen Eraslan gok...@pardus.org.tr: -- nosy: +Gökçen.Eraslan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4489] shutil.rmtree is vulnerable to a symlink attack
Hynek Schlawack h...@ox.cx added the comment: Fair enough, I'm not going to question your obviously superior judgement here. :) However, your patch currently breaks the test suite on any platform that uses the fallback rmtree: You forgot the ignore_errors=False in the _rmtree_unsafe signature (and obviously also the argument when calling it as a fallback). You also didn't seem to have touched the tests? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4489 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15043] test_gdb is disallowed by default security settings in Fedora 17
New submission from Nick Coghlan ncogh...@gmail.com: Running test_gdb on Fedora 17 produces a litany of the following error: - warning: File /home/ncoghlan/devel/py3k/python-gdb.py auto-loading has been declined by your `auto-load safe-path' set to /usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py. Presumably some security features in gdb have either been added, or enabled by default, with the F17 update. The devguide needs to be updated with a reference to the relevant gdb security settings so contributors can get it running again. -- components: Devguide messages: 162610 nosy: dmalcolm, ezio.melotti, ncoghlan priority: normal severity: normal status: open title: test_gdb is disallowed by default security settings in Fedora 17 type: enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15043 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15043] test_gdb is disallowed by default security settings in Fedora 17
Nick Coghlan ncogh...@gmail.com added the comment: In addition, we should probably report this as a test skip rather than as a litany of test failures. -- components: +Tests ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15043 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15044] _dbm not building on Fedora 17
New submission from Nick Coghlan ncogh...@gmail.com: After upgrading from Fedora 16 - 17, my previously working trunk build is getting the following error: Building '_dbm' extension gcc -pthread -fPIC -Wno-unused-result -g -O0 -Wall -Wstrict-prototypes -DHAVE_NDBM_H -IInclude -I. -I./Include -I/usr/local/include -I/home/ncoghlan/devel/py3k -c /home/ncoghlan/devel/py3k/Modules/_dbmmodule.c -o build/temp.linux-x86_64-3.3-pydebug/home/ncoghlan/devel/py3k/Modules/_dbmmodule.o gcc -pthread -shared build/temp.linux-x86_64-3.3-pydebug/home/ncoghlan/devel/py3k/Modules/_dbmmodule.o -L/usr/local/lib -o build/lib.linux-x86_64-3.3-pydebug/_dbm.cpython-33dm.so *** WARNING: renaming _dbm since importing it failed: build/lib.linux-x86_64-3.3-pydebug/_dbm.cpython-33dm.so: undefined symbol: dbm_nextkey Failed to build these modules: _dbm -- components: Extension Modules messages: 162612 nosy: dmalcolm, ncoghlan priority: normal severity: normal status: open title: _dbm not building on Fedora 17 type: compile error versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15044 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 6f7afe25d681 by Nick Coghlan in branch 'default': Close #13857: Added textwrap.indent() function (initial patch by Ezra http://hg.python.org/cpython/rev/6f7afe25d681 -- nosy: +python-dev resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10469] test_socket fails using Visual Studio 2010
Kristján Valur Jónsson krist...@ccpgames.com added the comment: This has been fixed with the proper 2010 support -- resolution: - fixed status: open - closed superseder: - Support Visual Studio 2010 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10469 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()
Nick Coghlan ncogh...@gmail.com added the comment: Ezra (and anyone interested) may want to take a look at the checked in version to see some of the changes I made while preparing the patch for commit. - name changes and slight restructure as discussed on the review - splitlines() invocation changed as discussed above - doc examples changed to doctest style - tests reworked to use a parameterised style (taking the easy way out of just failing on the first broken case, since there aren't that many cases and the test is quick to run) - default predicate reworked to round trip with textwrap.dedent -- resolution: fixed - stage: committed/rejected - patch review status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10854] Output .pyd name in error message of ImportError when DLL load fails
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Brian, reopening this since the original issue isn't addressed: The path and module attributes aren't part of the error repr -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10854 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15045] Make textwrap.dedent() consistent with str.splitlines(True) and str.strip()
New submission from Nick Coghlan ncogh...@gmail.com: In working on #13857, I noticed that the current regex based implementation of textwrap.dedent() is limited specifically to ASCII whitespace (tabs and spaces) with Unix line endings (a line containing solely a Windows \r\n line ending will be deemed to contain a non-whitespace character, since \r isn't recognised by the regex) The new textwrap.indent() function added in #13857 takes a much simpler approach to whitespace handling: its definition of a line is exactly that of text.splitlines(True), while its definition of a line that does not consist solely of whitespace is bool(line.strip()) As a simple example of how that can make a difference, consider: \N{NO-BREAK SPACE}.strip() '' One way to remedy this would be to replace the regex based implementation of textwrap.dedent with a simpler one written in terms of text.splitlines(True) and line.strip(). -- components: Library (Lib) messages: 162617 nosy: ncoghlan priority: normal severity: normal stage: needs patch status: open title: Make textwrap.dedent() consistent with str.splitlines(True) and str.strip() type: enhancement versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15045 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13857] Add textwrap.indent() as counterpart to textwrap.dedent()
Changes by Nick Coghlan ncogh...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13857 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11445] python.exe on OS X shared-llbrary build erroneously linked to MacPorts python library
Changes by Samuel John pyt...@samueljohn.de: -- nosy: +samueljohn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11445 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10133] multiprocessing: conn_recv_string() broken error handling
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 60a7b704de5c by Richard Oudkerk in branch '2.7': Issue #10133: Make multiprocessing deallocate buffer if socket read fails. http://hg.python.org/cpython/rev/60a7b704de5c New changeset 5643697070c0 by Richard Oudkerk in branch '3.2': Issue #10133: Make multiprocessing deallocate buffer if socket read fails. http://hg.python.org/cpython/rev/5643697070c0 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10133 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13756] Python3.2.2 make fail on cygwin
Jason Tishler ja...@tishler.net added the comment: I offer the attached patch for consideration. AFAICT, only the Makefile.pre.in and build_ext.py changes are required. I included the makesetup change for completeness and to be consistent with the other changes. -- keywords: +patch nosy: +jlt63, yselkowitz Added file: http://bugs.python.org/file25936/3.2.3-libpython-abi.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13756 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15046] Missing cast to Py_ssize_t in socket_connection.c
New submission from Marco den Otter marco.den.ot...@nspyre.nl: In the file socket_connection.c on line 139 a cast to Py_ssize_t is missing for the return value. Is: return res 0 ? res : ulength; Should be return res 0 ? (Py_ssize_t)res : (Py_ssize_t)ulength; Now it can be possible that a close of the socket is not detected. Found the bug by creating a server client that only sends the length of a data package and then closing the socket. Without the cast the calling function (connection_recvbytes in connection.h) will try to return an object because of not detecting the result was smaller then 0. -- components: Library (Lib) messages: 162620 nosy: MOtter priority: normal severity: normal status: open title: Missing cast to Py_ssize_t in socket_connection.c type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15046 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14599] Windows test_import failure thanks to ImportError.path
Brett Cannon br...@python.org added the comment: If you look at line 127 in importlib/_bootstrap.py you will see that it is an os.open() call to open the bytecode file for exclusive writing. I'm willing to bet the buildbot didn't have the directory writable or something and that triggered the issue. Regardless, this has nothing to do with the finder's cache. Antoine might have a little more insight since he wrote the atomic code initially. If not then this issue should be closed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14599 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10133] multiprocessing: conn_recv_string() broken error handling
Richard Oudkerk shibt...@gmail.com added the comment: Thanks for the patch, I have applied it. (I don't think there was a problem with the promotion rules because res was a never converted to UINT32.) -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10133 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8028] self.terminate() from a multiprocessing.Process raises AttributeError exception
Richard Oudkerk shibt...@gmail.com added the comment: The docs were patched in changeset 9fa52478b32b, so I will close. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8028 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10037] multiprocessing.pool processes started by worker handler stops working
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - later stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10037 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8289] multiprocessing.Process.__init__ pickles all arguments
Richard Oudkerk shibt...@gmail.com added the comment: I don't think there is any problem here since you have control over which arguments you pass to __init__. Without a reason why that is not a solution I will eventually close the issue as rejected. -- resolution: - rejected stage: - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8289 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12897] Support for iterators in multiprocessing map
Richard Oudkerk shibt...@gmail.com added the comment: Unless you have a reason why imap() does not solve the problem I will eventually close the issue as rejected. -- resolution: - rejected stage: - committed/rejected status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14499] Extension module builds fail with Xcode 4.3 on OS X 10.7 due to SDK move
Changes by Samuel John pyt...@samueljohn.de: -- nosy: +samueljohn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14499 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12897] Support for iterators in multiprocessing map
andrew cooke and...@acooke.org added the comment: hi - i'm the original author (may be using a different account). as far as i remember, i raised this because it seemed relevant given the link i gave. if you've looked at the issue and think your approach would work, or that this should be closed, or whatever, that's fine by me. i'm not going to check myself - i can't remember anything about this now (nearly a year later) and it's not my place to worry about your code (no offence - just trying to clarify that i have no skin in this game). -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8289] multiprocessing.Process.__init__ pickles all arguments
Ram Rachum r...@rachum.com added the comment: I opened this issue 2 years ago, and I don't remember it being easily solvable back then. But I've long forgotten what the problems were, and I've lost personal interest in it, so I guess we'll just let it go. -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8289 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3518] multiprocessing: BaseManager.from_address documented but doesn't exist
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset c2910971eb86 by Richard Oudkerk in branch 'default': Issue #3518: Remove references to non-existent BaseManager.from_address() http://hg.python.org/cpython/rev/c2910971eb86 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8289] multiprocessing.Process.__init__ pickles all arguments
Richard Oudkerk shibt...@gmail.com added the comment: OK, I'll close. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8289 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12897] Support for iterators in multiprocessing map
Richard Oudkerk shibt...@gmail.com added the comment: I'll close then. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12897 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3518] multiprocessing: BaseManager.from_address documented but doesn't exist
Changes by Richard Oudkerk shibt...@gmail.com: -- stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3518 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9527] Add aware local time support to datetime module
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: This was originally posted on python-dev, but I hope reposting it here will make this issue easier to navigate. With addition of fixed offset timezone class and the timezone.utc instance [0], it is easy to get UTC time as an aware datetime instance: datetime.now(timezone.utc) datetime.datetime(2010, 8, 3, 14, 16, 10, 670308, tzinfo=datetime.timezone.utc) However, if you want to keep time in your local timezone, getting an aware datetime is almost a catch 22. If you know your timezone UTC offset, you can do EDT = timezone(timedelta(hours=-4)) datetime.now(EDT) datetime.datetime(2010, 8, 3, 10, 20, 23, 769537, tzinfo=datetime.timezone(datetime.timedelta(-1, 72000))) but the problem is that there is no obvious or even correct way to find local timezone UTC offset. [1] In a comment on issue #5094 (datetime lacks concrete tzinfo implementation for UTC), I proposed to address this problem in a localtime([t]) function that would return current time (or time corresponding to the optional datetime argument) as an aware datetime object carrying local timezone information in a tzinfo set to an appropriate timezone instance. This solution is attractive by its simplicity, but there are several problems: 1. An aware datetime cannot carry all information that system localtime() supplies in a time tuple. Specifically, the is_dst flag is lost. This is not a problem for most applications as long as timezone UTC offset and timezone name are available, but may be an issue when interoperability with the time module is required. 2. Datetime's tzinfo interface was designed with the idea that 2010-11-06 12:00 EDT + 1 day = 2010-11-07 12:00 EST, not 2010-11-07 12:00 EDT. It other words, if I have lunch with someone at noon (12:00 EDT) on Saturday the day before first Sunday in November, and want to meet again at the same time tomorrow, I mean 12:00 EST, not 24 hours later. With localtime() returning datetime with tzinfo set to fixed offset timezone, however, localtime() + timedelta(1) will mean exactly 24 hours later and the result will be expressed in an unusual for the given location timezone. An alternative approach is the one recommended in the python manual. [3] One could implement a LocalTimezone class with utcoffset(), tzname() and dst() extracting information from system mktime and localtime calls. This approach has its own shortcomings: 1. While adding integral number of days to datetimes in business setting, it is natural to expect automatic timezone adjustments, it is not as clearcut when adding hours or minutes. 2. The tzinfo.utcoffset() interface that expects *standard* local time as an argument is confusing to many users. Even the official example in the python manual gets it wrong. [4] 3. datetime(..., tzinfo=LocalTimezone()) is ambiguous during the repeated hour when local clock is set back in DST to standard time transition. As far as I can tell, the only way to resolve the last problem is to add is_dst flag to the datetime object, which would also be the only way to achieve full interoperability between datetime objects and time tuples. [5] The traditional answer to a call for improvement of timezone support in datetime module has been: this is up to 3rd parties to implement. Unfortunately, stdlib is asking 3rd parties to implement an impossible interface without giving access to the necessary data. The impossibility comes from the requirement that dst() method should find out whether local time represents DST or standard time while there is an hour each year when the same local time can be either. The missing data is the system UTC offset when it changes historically. The time module only gives access to the current UTC offset. My preference is to implement the first alternative - localtime([t]) returning aware datetime with fixed offset timezone. This will solve the problem of python's lack of access to the universally available system facilities that are necessary to implement any kind of aware local time support. [0] http://docs.python.org/dev/library/datetime.html#timezone-objects [1] http://bugs.python.org/issue1647654 [2] http://bugs.python.org/issue5094#msg106997 [3] http://docs.python.org/library/datetime.html#tzinfo-objects [4] http://bugs.python.org/issue9063 [5] http://bugs.python.org/issue9004 -- http://mail.python.org/pipermail/python-dev/2010-August/102842.html -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9527 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15046] Missing cast to Py_ssize_t in socket_connection.c
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This was fixed 3 hours ago, with issue10133 :) -- nosy: +amaury.forgeotdarc resolution: - out of date status: open - closed superseder: - multiprocessing: conn_recv_string() broken error handling ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15046 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9004] datetime.utctimetuple() should not set tm_isdst flag to 0
Éric Araujo mer...@netwok.org added the comment: Just recommend the astimezone use in the docs and recommend creating tz-aware instances in the first time (i.e. calling now(utc) instead of utcnow()), +1. -- nosy: +eric.araujo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9004 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15047] Cygwin install (regen) problem
New submission from Jason Tishler ja...@tishler.net: The Cygwin build is failing during make install -- specifically, during the regen step: [snip] mkdir /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-cygwin cp /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-generic/regen /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-cygwin/regen export PATH; PATH=`pwd`:$PATH; \ export PYTHONPATH; PYTHONPATH=`pwd`/Lib; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH=`pwd`; \ export EXE; EXE=.exe; \ cd /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-cygwin; ./regen python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h Could not find platform independent libraries prefix Could not find platform dependent libraries exec_prefix Consider setting $PYTHONHOME to prefix[:exec_prefix] Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named encodings ./regen: line 3: 2976 Aborted (core dumped) python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h [snip] Note that I seem to be running into the same or similar problem as the following: http://bugs.python.org/issue3626#msg72415 I was able to workaround the core dump problem with the following patch: diff -u Python-2.6.5.orig/Makefile.pre.in Python-2.6.5/Makefile.pre.in --- Python-2.6.5.orig/Makefile.pre.in 2009-12-24 09:19:38.0 -0500 +++ Python-2.6.5/Makefile.pre.in2010-04-13 17:05:04.368555900 -0400 @@ -910,7 +910,7 @@ mkdir $(srcdir)/Lib/$(PLATDIR) cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen export PATH; PATH=`pwd`:$$PATH; \ - export PYTHONPATH; PYTHONPATH=`pwd`/Lib; \ + export PYTHONPATH; PYTHONPATH=$(srcdir)/Lib; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH=`pwd`; \ export EXE; EXE=$(BUILDEXE); \ cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen Note that I'm building outside of the source tree, so when the original version sets PYTHONPATH to the following: `pwd`/Lib it was guaranteed to point to a nonexistent directory. Unfortunately, now the build fails as follows: [snip] mkdir /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-cygwin cp /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-generic/regen /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-cygwin/regen export PATH; PATH=`pwd`:$PATH; \ export PYTHONPATH; PYTHONPATH=/home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib; \ export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH=`pwd`; \ export EXE; EXE=.exe; \ cd /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/plat-cygwin; ./regen python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h Could not find platform independent libraries prefix Could not find platform dependent libraries exec_prefix Consider setting $PYTHONHOME to prefix[:exec_prefix] Traceback (most recent call last): File /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/sysconfig.py, line 334, in _init_posix _parse_makefile(makefile, vars) File /home/jt/src/cygwin/cygwin-packages/1.7/python3-test/python-3.2.3-1/src/Python-3.2.3/Lib/sysconfig.py, line 220, in _parse_makefile with open(filename, errors=surrogateescape) as f: IOError: [Errno 2] No such file or directory: '/usr/lib/python3.2/config-3.2m/Makefile' [snip] AFAICT, the problem is when regen runs, python thinks it is running out of an installation directory and not a build directory. Does anyone know how to convince python to think it is running out its build directory even though it is being found in the PATH. If not, does anyone have any other suggestions on how to resolve this problem? -- components: Build messages: 162634 nosy: jlt63, yselkowitz priority: normal severity: normal status: open title: Cygwin install (regen) problem versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15047 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15040] stdlib compatability with pypy: mailbox.py
mattip matti.pi...@gmail.com added the comment: Revised patch: changes to mailbox.py were not needed for pypy. Someone did a good job with mailbox.py in stdlib 2.7.3 Now the patch only changes tests. The tests in 3.3 are very different, it seems to me there is little that can be reused there. -- Added file: http://bugs.python.org/file25937/mailbox.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15040 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15040] stdlib compatability with pypy: mailbox.py
R. David Murray rdmur...@bitdance.com added the comment: Ah, good. I thought we'd fixed the open/close issues, but I could easily believe we had missed something (especially in Python2). Since the fp stuff is gone in 3, I'd be OK with just applying this. -- versions: -Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15040 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14446] Remove deprecated tkinter functions
Michael Driscoll m...@pythonlibrary.org added the comment: Do I need to do anything else to those patches I submitted? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14446 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14927] add Do not supply 'int' argument to random.shuffle docstring
Michael Driscoll m...@pythonlibrary.org added the comment: I added the extra information to the docstring for the shuffle method and attached a patch. -- keywords: +patch nosy: +michael.driscoll Added file: http://bugs.python.org/file25938/shuffle.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14927 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14927] add Do not supply 'int' argument to random.shuffle docstring
Christopher Smith smi...@users.sourceforge.net added the comment: On Tue, Jun 12, 2012 at 1:34 AM, Michael Driscoll rep...@bugs.python.org wrote: Michael Driscoll m...@pythonlibrary.org added the comment: I added the extra information to the docstring for the shuffle method and attached a patch. Thanks Michael (and Python team)! Chris -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14927 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14906] rotatingHandler WindowsError
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: It could be a number of things which are keeping the file open, e.g. * Windows indexing the volume for search * Child process keeping files open (e.g. while copying log files - I can't tell what you're actually copying) You may need to use a tool like FileMon or PSMon to see what's happening, but I don't see any evidence that it's a logging bug. Is there a specific logging statement which is being called which leads to the error? There are several in your snippet. -- assignee: - vinay.sajip nosy: +vinay.sajip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14906 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13756] Python3.2.2 make fail on cygwin
Roumen Petrov bugtr...@roumenpetrov.info added the comment: Hi Jason, if you look in default rule you will see the same, so this relict specific else case could be removed. Also in Lib/packaging/command/build_ext.py. -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13756 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14599] Windows test_import failure thanks to ImportError.path
Roumen Petrov bugtr...@roumenpetrov.info added the comment: There is one long standing issue with length of the build path ... -- nosy: +rpetrov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14599 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14966] Fully document subprocess.CalledProcessError
Michael Driscoll m...@pythonlibrary.org added the comment: I don't see the error, TimeoutExpired, documented either. At least the doc page mentions CalledProcessError a couple times. Do we want to use the docstring for CalledProcessError for the documentation page? Where on the page would it go? I assume we'd want an example showing how to use it? -- nosy: +michael.driscoll ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14966 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15041] tkinter documentation: update see also list
Michael Driscoll m...@pythonlibrary.org added the comment: I thought the ebook, Modern Tkinter for Busy Python Developers by Mark Roseman was pretty good too: http://www.amazon.com/Modern-Tkinter-Python-Developers-ebook/dp/B0071QDNLO/ref=sr_1_1?ie=UTF8qid=1339446684sr=8-1 -- nosy: +michael.driscoll ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15041 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13532] In IDLE, sys.stdout.write and sys.stderr can write any pickleable object
Roger Serwy roger.se...@gmail.com added the comment: @Ramchandra: __name__ does not exist for many objects. This issue with the sys.stdout.write encompasses a lot of other issues involving the shortcomings of the RPCProxy object. The following code prevents another prompt from appearing: class A: pass import sys sys.stdout.write(A) Even though A is pickleable, IDLE gets stuck trying to write to stdout. In run.py, Executive.runcode gets stuck on exec(code, self.locals), and is not interruptable. Restarting the shell makes the IDLE shell responsive again to commands. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13532 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14599] Windows test_import failure thanks to ImportError.path
Brett Cannon br...@python.org added the comment: Roumen, what issue is that? Do you have an issue # you can share? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14599 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14446] Remove deprecated tkinter functions
Andrew Svetlov andrew.svet...@gmail.com added the comment: Michael Driscoll, thank you for patch. Let's go on after Python 3.3 release — those patches should be applied for 3.4. For now we need to wait. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14446 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
New submission from James Kyle b...@jameskyle.org: This behavior is present on OS X 10.7 and framework builds. In this case, the /Library/Python/version paths are included in every install. I would consider this behavior non-standard as in most manual python installs only that installations library paths are included. This can lead to surprising and inconsistent behavior if multiple installs are present (very common on osx, e.g. macports + system install). This originated as a macports bug ticket: https://trac.macports.org/ticket/34763 -- assignee: ronaldoussoren components: Macintosh messages: 162648 nosy: James.Kyle, ronaldoussoren priority: normal severity: normal status: open title: Manually Installed Python Includes System Wide Paths type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
Ronald Oussoren ronaldousso...@mac.com added the comment: This is intentional behavior, you can install packages you want to share between python installations in /Library/Python instead of the regular site-packages directory. Macports could always patch their site.py file to avoid this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
Ronald Oussoren ronaldousso...@mac.com added the comment: This was added in issue4865. (The same behavior is present in 3.2 and 3.3) -- resolution: - rejected versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
Changes by Ronald Oussoren ronaldousso...@mac.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
James Kyle b...@jameskyle.org added the comment: Am I missing something or were the problems delineated in issue #4865 solvable by simply sys.path.append(/Library/Python/2.7/site-packages)? What would the process be for reopening this issue for discussion? I'm not sure this is the right way to address this. For example, what if other *nix distros started adding their own custom common paths, would Python begin implemented these distro specific deviations from standard behavior? In my honest opinion, there's an expectation of package isolation in independent python installs. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
Ronald Oussoren ronaldousso...@mac.com added the comment: Python installation are already not isolated: there is a per-user site-packages directory on all platforms that is shared between all installations of a particular python release. This directory is located in a subdirectory of ~/.local on POSIX systems (including OSX). Anyway, this cannot be changed for a released version of python because that would break backward compatibility. At best this could be disabled in python 3.3 and even there I'm far from convinced that disabling this feature would be worthwhile. -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
James Kyle b...@jameskyle.org added the comment: Fair enough. Thanks! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14599] Windows test_import failure thanks to ImportError.path
Stefan Krah stefan-use...@bytereef.org added the comment: Brett, I reopened this because you said earlier that the test_reprlib failure is due to a race condition where an invalidate_caches() call is needed. You're quite right of course that the new occurrence could be caused by something unrelated. I can't reproduce the failure on Windows 7, so it might be limited to XP. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14599 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1667546] Time zone-capable variant of time.localtime
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: Reopening. given the uncertainty with #9527, this issue may result in getting the TZ-aware local time support in stdlib sooner. -- resolution: duplicate - stage: committed/rejected - patch review status: closed - open versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1667546 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14927] add Do not supply 'int' argument to random.shuffle docstring
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14927 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14927] add Do not supply 'int' argument to random.shuffle docstring
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14927 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15049] line buffering isn't always
New submission from R. David Murray rdmur...@bitdance.com: rdmurray@hey:~/python/p32cat bad.py This line is just ascii A second line for good measure. This comment contains undecodable stuff: � or \\xe9 in pass� cannot be decoded. The last line above is in latin-1, with an é inside those quotes. rdmurray@hey:~/python/p32cat bug.py import sys with open('./bad.py', buffering=int(sys.argv[1])) as f: for line in f: print(line, end='') rdmurray@hey:~/python/p32python3 bug.py -1 Traceback (most recent call last): File bug.py, line 3, in module for line in f: File /usr/lib/python3.2/codecs.py, line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 99: invalid continuation byte rdmurray@hey:~/python/p32python3 bug.py 1 Traceback (most recent call last): File bug.py, line 3, in module for line in f: File /usr/lib/python3.2/codecs.py, line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 99: invalid continuation byte rdmurray@hey:~/python/p32python3 bug.py 2 This line is just ascii A second line for good measure. Traceback (most recent call last): File bug.py, line 3, in module for line in f: File /usr/lib/python3.2/codecs.py, line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 0: invalid continuation byte So, line buffering does not appear to buffer line by line. I ran into this problem because I had a much larger file that I thought was in utf-8. When I got the encoding error, I was annoyed that the error message didn't really tell me which line the error was on, but I figured, OK, I'll just set line buffering and then I'll be able to tell. But that didn't work. Fortunately using '2' did workbut at a minimum the docs need to be updated to indicate when line buffering really is line buffering and when it isn't. -- messages: 162656 nosy: pitrou, r.david.murray priority: normal severity: normal stage: needs patch status: open title: line buffering isn't always type: behavior versions: Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15049 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
Ned Deily n...@acm.org added the comment: I have to admit that I'm not keen on this feature for the reasons James cited. And I think the example of the shared user site directory is not a good analogy. In that case, you, as a user, have more control over the presence and contents of the directory since it is located within your home directory. You would normally need administrator privilege to manipulate /Library/Python. And, in any case, it would be better if there *were* separate user site directories per Python instance, IMO. Yes, you can play with sys.path after the fact but that's not very friendly. It certainly can lead to confusion. An uncontrived example: $ sudo easy_install-2.7 appscript [...] Installed /Library/Python/2.7/site-packages/appscript-1.0.0-py2.7-macosx-10.7-intel.egg $ /usr/bin/python2.7 -c import appscript $ /usr/local/bin/python2.7 -c import appscript Traceback (most recent call last): File string, line 1, in module File build/bdist.macosx-10.7-intel/egg/appscript/__init__.py, line 8, in module File build/bdist.macosx-10.7-intel/egg/aem/__init__.py, line 5, in module File build/bdist.macosx-10.7-intel/egg/aem/ae.py, line 7, in module File build/bdist.macosx-10.7-intel/egg/aem/ae.py, line 3, in __bootstrap__ ImportError: No module named pkg_resources ... because the non-system Python did not have Distribute or setuptools installed, whereas Apple supplies it with the system Python. It's not the only package to fail in a similar way. I expect there are other cases where differences in extension module builds could cause problems. To me, the feature seems to go against explicit is better than implicit. As far as I know, the only place where this behavior is documented is in the What's New documents for 2.7. I wouldn't object to removing it in 3.3. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9527] Add aware local time support to datetime module
Alexander Belopolsky alexander.belopol...@gmail.com added the comment: Two objections have been raised to the proposed datetime.localtime() function: 1. It offers the third subtly different way to obtain current time in datetime module. The first two being provided by datetime.now() and datetime.today(). 2. C library localtime function takes POSIX timestamp as an argument, so datetime.localtime() should follow suit. I attach a prototype patch for a different approach: make datetime.astimezone() method supply local timezone information if no argument is given. This patch also demonstrates that extracting all TZ information that platform may have knowledge of is not trivial. -- Added file: http://bugs.python.org/file25939/datetime-astimezone-proto.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9527 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9527] Add aware local time support to datetime module
Changes by Alexander Belopolsky alexander.belopol...@gmail.com: Added file: http://bugs.python.org/file25940/testtz.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9527 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15048] Manually Installed Python Includes System Wide Paths
Ned Deily n...@acm.org added the comment: A few more thoughts. The original impetus for this feature was Issue4865. The use case there seem to be from users of Google App Engine back when it was released using Python 2.5. It seems to me that the use of dmg installers for Python packages has diminished; certainly the unofficial packages at pythonmac.org haven't been updated for more recent releases. The issues with installing some packages (like PIL) with 3rd-party C library dependencies notwithstanding, I wonder if part of the original call for this feature was the fact that Apple does provide setuptools easy_install's with system Pythons and there is confusion that a setuptools/Distribute instance, with its own easy_install command, is needed for each Python. Some of that confusion should diminish over time with the availability of pip -E and, starting with 3.3, a batteries-included installer command, pysetup. Also, with regard to backward compatibility, I speculate that there hasn't been much notice of this feature since it only affects users of Python 2.7 on OS X 10.7+. For Python 3, the presence or absence of the feature doesn't affect anyone because Apple has yet to ship a system Python 3 so removing it from 3.3 would have no backward compatibility impacts, unless an administrator manually created a /Library/Python/3.x for some reason and manually installed things there. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15048 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9527] Add aware local time support to datetime module
James Henstridge ja...@jamesh.id.au added the comment: One problem I can see with using a fixed offset tzinfo for localtime is that it might confuse people when doing date arithmetic. For example: d = datetime.localtime() + timedelta(days=7) While it will give a correct answer as a point in time it will have the wrong time zone offset if run just before a daylight saving transition, which could be just as confusing. I'm not sure how you'd solve this without e.g. importing pytz into the standard library though. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9527 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15003] make PyNamespace_New() public
Eric Snow ericsnowcurren...@gmail.com added the comment: Is this documented in whatsnew? I'm not sure what has been (none of my patches have done so). Also, I remember a discussion about making it public or not, but don’t recall a decision. Amaury brought it up in msg162127. His point was that the type is public in Python, so why not the C API? That's about the extent of the discussion. :) Do you see any harm in making PyNamespace_New() public? I personally find it bad that we have structseqs for most things, dicts in PEP 418 get_clock_info return values, and now simplenamespace for sys.implementation. The use cases are different for the different types. StructSequence/namedtuple provides fixed data structures for structured records. A dict is essentially the opposite: an un-fixed data structure for dynamic namespaces, making no firm promises as to what the future holds. SimpleNamespace fills a similar role to dicts, but offers a higher appearance of stability by virtue of using attributes vs. keys. The problem is that moving from item-access to attribute-access is not a backward-compatible change. That's the big reason why PEP 421 specified the use of an attr-based object. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15003 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com