ANN: ActivePython 2.7.1.3 is now available
ActiveState is pleased to announce ActivePython 2.7.1.3, a complete, ready-to-install binary distribution of Python 2.7. http://www.activestate.com/activepython/downloads What's New in ActivePython-2.7.1.3 == *Release date: 6-Dec-2010* New Features Upgrades --- - Upgrade to Python 2.7.1 (`release notes http://svn.python.org/projects/python/tags/r271/Misc/NEWS`__) - Upgrade to Tcl/Tk 8.5.9 (`changes http://wiki.tcl.tk/26961`_) - Security upgrade to openssl-0.9.8q - [MacOSX] Tkinter now requires ActiveTcl 8.5 64-bit (not Apple's Tcl/Tk 8.5 on OSX) - Upgrade to PyPM 1.2.6; noteworthy changes: - New command 'pypm log' to view log entries for last operation - Faster startup (performance) especially on Windows. - Rewrite of an improved dependency algorithm (#88038) - install/uninstall now accepts the --nodeps option - 'pypm install url' to directly download and install a .pypm file - 'pypm show' improvements - 'pypm show' shows other installed packages depending on the shown package - 'pypm show' accepts --rdepends to show the list of dependents - 'pypm show' shows extra dependencies (for use in the 'install' cmd) - 'pypm show' lists all available versions in the repository - 'pypm freeze' to dump installed packages as requirements (like 'pip freeze') - Support for pip-stye requirements file ('pypm install -r requirements.txt') - Upgraded the following packages: - Distribute-0.6.14 - pip-0.8.2 - SQLAlchemy-0.6.5 - virtualenv-1.5.1 Noteworthy Changes Bug Fixes -- - Bug #87951: Exclude PyPM install db to prevent overwriting user's database. - Bug #87600: create a `idleX.Y` script on unix - [Windows] Installer upgrade: automatically uninstall previous versions - Bug #87783 - [Windows] Renamed python27.exe to python2.7.exe (Unix like) - [Windows] Include python2.exe - PyPM bug fixes: - Bug #2: Fix pickle incompatability (sqlite) on Python 3.x - Bug #87764: 'pypm upgrade' will not error out for missing packages - Bug #87902: fix infinite loops with cyclic package dependencies (eg: plone) - Bug #88370: Handle file-overwrite conflicts (implement --force) What is ActivePython? = ActivePython is ActiveState's binary distribution of Python. Builds for Windows, Mac OS X, Linux are made freely available. Solaris, HP-UX and AIX builds, and access to older versions are available in ActivePython Business, Enterprise and OEM editions: http://www.activestate.com/python ActivePython includes the Python core and the many core extensions: zlib and bzip2 for data compression, the Berkeley DB (bsddb) and SQLite (sqlite3) database libraries, OpenSSL bindings for HTTPS support, the Tix GUI widgets for Tkinter, ElementTree for XML processing, ctypes (on supported platforms) for low-level library access, and others. The Windows distribution ships with PyWin32 -- a suite of Windows tools developed by Mark Hammond, including bindings to the Win32 API and Windows COM. ActivePython 2.6, 2.7 and 3.1 also include a binary package manager for Python (PyPM) that can be used to install packages much easily. For example: C:\pypm install mysql-python [...] C:\python import MySQLdb See this page for full details: http://docs.activestate.com/activepython/2.7/whatsincluded.html As well, ActivePython ships with a wealth of documentation for both new and experienced Python programmers. In addition to the core Python docs, ActivePython includes the What's New in Python series, Dive into Python, the Python FAQs HOWTOs, and the Python Enhancement Proposals (PEPs). An online version of the docs can be found here: http://docs.activestate.com/activepython/2.7/ We would welcome any and all feedback to: activepython-feedb...@activestate.com Please file bugs against ActivePython at: http://bugs.activestate.com/enter_bug.cgi?product=ActivePython Supported Platforms === ActivePython is available for the following platforms: - Windows (x86 and x64) - Mac OS X (x86 and x86_64; 10.5+) - Linux (x86 and x86_64) - Solaris/SPARC (32-bit and 64-bit) (Business, Enterprise or OEM edition only) - Solaris/x86 (32-bit)(Business, Enterprise or OEM edition only) - HP-UX/PA-RISC (32-bit)(Business, Enterprise or OEM edition only) - HP-UX/IA-64 (32-bit and 64-bit) (Enterprise or OEM edition only) - AIX/PowerPC (32-bit and 64-bit) (Business, Enterprise or OEM edition only) More information about the Business Edition can be found here: http://www.activestate.com/business-edition Custom builds are available in the Enterprise Edition: http://www.activestate.com/enterprise-edition Thanks, and enjoy! The Python Team -- Sridhar Ratnakumar Python Developer ActiveState, The Dynamic Language Experts sridh...@activestate.com http://www.activestate.com Get insights on Open Source and
Sybase module 0.40pre1 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. ** This version is a pre-release not intended for production use ** The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.40pre1.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_40pre1/ChangeLog -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
Re: performance of tight loop
Thank you for the explanation, Ryan! Uli -- Domino Laser GmbH Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932 -- http://mail.python.org/mailman/listinfo/python-list
Fail import with SWIG generated imp.load_module ?
I'm trying to load a module GDAL into a Python script. The loader/binder that is then called, seems to be generated by SWIG, a project with which I'm unfortunately not familiar. The part of the SWIG generated code that fails on me is as follow: -- start code snip 1 - # This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.39 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info = (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_gdal', [dirname(__file__)]) except ImportError: import _gdal return _gdal if fp is not None: print fp:,fp # - My code ... print pn:,pathname # - My code ... print de:,description # - My code ... try: _mod = imp.load_module('_gdal', fp, pathname, description) finally: fp.close() return _mod _gdal = swig_import_helper() del swig_import_helper else: import _gdal del version_info ... shortened by me -- end code snip 1 - I had to redo the indents manually in this mail, I hope I didn't make any mistakes. When I run the script that activates this code, it returns the following: -- start code snip 2 - fp: open file 'C:\gdal\bin\gdal\python\osgeo\_gdal.pyd', mode 'rb' at 0x00B35D88 pn: C:\gdal\bin\gdal\python\osgeo\_gdal.pyd de: ('.pyd', 'rb', 3) Traceback (most recent call last): File C:\Martin\Work_Eclipse\Hilfe\src\check_GDAL.py, line 8, in module import gdal File C:\gdal\bin\gdal\python\osgeo\gdal.py, line 27, in module _gdal = swig_import_helper() File C:\gdal\bin\gdal\python\osgeo\gdal.py, line 26, in swig_import_helper return _mod UnboundLocalError: local variable '_mod' referenced before assignment -- end code snip 2 - It appears to me that the objects returned by imp.find_module, and printed out as fp:, pn: and de:, are valid. So why is mp.load_module returning what appears to be some flavour of NULL ? I'm using Python version 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] The GDAL lib is from http://download.osgeo.org/gdal/win32/1.6/gdalwin32exe160.zip All suggestions appreciated ... Best Regards Martin -- http://mail.python.org/mailman/listinfo/python-list
Re: performance of tight loop
gry georgeryo...@gmail.com writes: ... rest = ['%d' % randint(1, mx) for i in range(wd - 1)] for i in range(i,i+rows): ... One thing that immediately comes to mind is use xrange instead of range. Also, instead of first = ['%d' % i] rest = ['%d' % randint(1, mx) for i in range(wd - 1)] return first + rest you might save some copying with: rest = ['%d' % randint(1, mx) for i in xrange(wd)] rest[0] = '%d'%i return rest That's uglier than the old-fashioned rest = ['%d'%i] for i in xrange(wd-1): rest.append('%d' % randint(1, mx)) I think a generator would be cleanest, but maybe slowest: def row(i, wd, mx): yield '%d' % i for j in xrange(wd-1): yield ('%d' % randint(1, mx)) -- http://mail.python.org/mailman/listinfo/python-list
Re: while True or while 1
Steven D'Aprano wrote: while True: ... print Looping ... True = 0 Just remember that if you use that inside a function, you'll have to initialise True to True before... er, wait a moment, that won't work... ah, I know: def f(true = True): True = true while True: ... True = False -- Greg -- http://mail.python.org/mailman/listinfo/python-list
Re: while True or while 1
On Tuesday 14 December 2010, 10:19:04 Gregory Ewing wrote: Steven D'Aprano wrote: while True: ... print Looping ... True = 0 Just remember that if you use that inside a function, you'll have to initialise True to True before... er, wait a moment, that won't work... ah, I know: def f(true = True): True = true while True: ... True = False Thankfully, with Python 3 this code falls flat on its face. If I would have to _consume_ code like that more often, it would require me to also use a vomit resistant keyboard cover.. Pete -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse/argparse for cgi/wsgi?
Many people have. :-) In the context of WSGI you're basically talking about routing middleware, which solves the problem: given a request, which application should be called to construct a response? In my case, it turned out as simple as a list of (regex, resource) tuples, where regex is a regular expression that looks at the request URI and resource is an object that may or may not implement GET, POST, PUT, DELETE methods. In the regex I can capture any arguments that the resource needs. If the request method is GET and the method GET exists on the matched resource, it is called, else a 'Method Not Allowed' response code is returned. HTH Joost On 10 December 2010 17:36, samwyse samw...@gmail.com wrote: Has anyone ever built some sort of optparse/argparse module for cgi/ wsgi programs? I can see why a straight port wouldn't work, but a module that can organize parameter handling for web pages seems like a good idea, especially if it provided a standard collection of both client- and server-side validation processes, easy internationalization, and a way to create customizable help pages. -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse/argparse for cgi/wsgi?
To aid your googling, the problem is also commonly called 'Dispatching' instead of 'Routing'. Joost On 14 December 2010 12:19, Joost Molenaar j.j.molen...@gmail.com wrote: Many people have. :-) In the context of WSGI you're basically talking about routing middleware, which solves the problem: given a request, which application should be called to construct a response? In my case, it turned out as simple as a list of (regex, resource) tuples, where regex is a regular expression that looks at the request URI and resource is an object that may or may not implement GET, POST, PUT, DELETE methods. In the regex I can capture any arguments that the resource needs. If the request method is GET and the method GET exists on the matched resource, it is called, else a 'Method Not Allowed' response code is returned. HTH Joost On 10 December 2010 17:36, samwyse samw...@gmail.com wrote: Has anyone ever built some sort of optparse/argparse module for cgi/ wsgi programs? I can see why a straight port wouldn't work, but a module that can organize parameter handling for web pages seems like a good idea, especially if it provided a standard collection of both client- and server-side validation processes, easy internationalization, and a way to create customizable help pages. -- Joost Molenaar +31 644 015 510 -- http://mail.python.org/mailman/listinfo/python-list
International Workshop: DATICS-ISPA'11 (EI Indexed)
Dear authors, = International Workshop: DATICS-ISPA'11 CALL FOR PAPERS http://datics.nesea-conference.org/datics-ispa2011 Busan, Korea, 26-28 May, 2011. = Aims and Scope of DATICS-ISPA’11 Workshop: DATICS Workshops were initially created by a network of researchers and engineers both from academia and industry in the areas of Design, Analysis and Tools for Integrated Circuits and Systems. Recently, DATICS has been extended to the fields of Communication, Computer Science, Software Engineering and Information Technology. The main target of DATICS-ISPA’11 is to bring together software/hardware engineering researchers, computer scientists, practitioners and people from industry to exchange theories, ideas, techniques and experiences related to all aspects of DATICS. Topics of interest include, but are not limited to, the following: Circuits, Systems and Communications: digital, analog, mixed-signal, VLSI, asynchronous and RF design processor and memory DSP and FPGA/ASIC-based design synthesis and physical design embedded system hardware/software co-design CAD/EDA methodologies and tools statistical timing analysis and low power design methodologies network/system on-a-chip and applications hardware description languages, SystemC and SystemVerilog simulation, verification and test technology semiconductor devices and solid-state circuits fuzzy and neural networks communication signal processing mobile and wireless communications peer-to-peer video streaming and multimedia communications communication channel modeling antenna radio-wave propagation Computer Science, Software Engineering and Information Technology: equivalence checking, model checking, SAT-based methods, compositional methods and probabilistic methods graph theory, process algebras, petri-nets, automaton theory, BDDs and UML formal methods distributed, real-time and hybrid systems reversible computing and biocomputing software architecture and design software testing and analysis software dependability, safety and reliability programming languages, tools and environments face detection and recognition database and data mining image and video processing watermarking artificial intelligence average-case analysis and worst-case analysis design and programming methodologies for network protocols and applications coding, cryptography algorithms and security protocols evolutionary computation numerical algorithms e-commerce Please note that all accepted papers will be included in IEEE Xplore and indexed by EI Compendex. After workshop, several special issues of international journals such as IJDATICS and IJCECS will be arranged for selected papers. For more details about DATICS-ISPA'11, please visit http://datics.nesea-conference.org/datics-ispa2011 -- http://mail.python.org/mailman/listinfo/python-list
Re: while True or while 1
Am 14.12.2010 11:33, schrieb Hans-Peter Jansen: On Tuesday 14 December 2010, 10:19:04 Gregory Ewing wrote: Steven D'Aprano wrote: while True: ... print Looping ... True = 0 Just remember that if you use that inside a function, you'll have to initialise True to True before... er, wait a moment, that won't work... ah, I know: def f(true = True): True = true while True: ... True = False Thankfully, with Python 3 this code falls flat on its face. If I would have to _consume_ code like that more often, it would require me to also use a vomit resistant keyboard cover.. Pete True yesterday, today and in the future: Yesterday: Pilate said to him, True? what is true? Having said this he went out again to the Jews and said to them, I see no wrong in him. Today: We are so thankful that today we are free to define True ourselves using Python 2.x. Future: Be warned, the future gets darker! ;-) Grüessli -- Kurt Mueller -- http://mail.python.org/mailman/listinfo/python-list
Re: performance of tight loop
gry wrote: [python-2.4.3, rh CentOS release 5.5 linux, 24 xeon cpu's, 24GB ram] I have a little data generator that I'd like to go faster... any suggestions? maxint is usually 9223372036854775808(max 64bit int), but could occasionally be 99. width is usually 500 or 1600, rows ~ 5000. from random import randint def row(i, wd, mx): first = ['%d' % i] rest = ['%d' % randint(1, mx) for i in range(wd - 1)] return first + rest ... while True: print copy %s from stdin direct delimiter ','; % table_name for i in range(i,i+rows): print ','.join(row(i, width, maxint)) print '\.' I see the biggest potential in inlining randint. Unfortunately you did not provide an executable script and I had to make it up: $ cat gry.py from random import randint import sys def row(i, wd, mx): first = ['%d' % i] rest = ['%d' % randint(1, mx) for i in range(wd - 1)] return first + rest def main(): table_name = unknown maxint = sys.maxint width = 500 rows = 1000 offset = 0 print copy %s from stdin direct delimiter ','; % table_name for i in range(offset, offset+rows): print ','.join(row(i, width, maxint)) print '\.' if __name__ == __main__: main() $ time python gry.py /dev/null real0m5.280s user0m5.230s sys 0m0.050s $ $ cat gry_inline.py import random import math import sys def make_rand(n): if n 1 random.BPF: def rand(random=random.random): return int(n*random())+1 else: k = int(1.1 + math.log(n-1, 2.0)) def rand(getrandbits=random.getrandbits): r = getrandbits(k) while r = n: r = getrandbits(k) return r+1 return rand def row(i, wd, rand): first = ['%d' % i] rest = ['%d' % rand() for i in range(wd - 1)] return first + rest def main(): table_name = unknown maxint = sys.maxint width = 500 rows = 1000 offset = 0 rand = make_rand(maxint) print copy %s from stdin direct delimiter ','; % table_name for i in range(offset, offset+rows): print ','.join(row(i, width, rand)) print '\.' if __name__ == __main__: main() $ time python gry_inline.py /dev/null real0m2.004s user0m2.000s sys 0m0.000s $ Disclaimer: the code in random.py is complex enough that I cannot guarantee I snatched the right pieces. Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: performance of tight loop
Peter Otten wrote: gry wrote: [python-2.4.3, rh CentOS release 5.5 linux, 24 xeon cpu's, 24GB ram] I have a little data generator that I'd like to go faster... any suggestions? maxint is usually 9223372036854775808(max 64bit int), but could occasionally be 99. width is usually 500 or 1600, rows ~ 5000. from random import randint def row(i, wd, mx): first = ['%d' % i] rest = ['%d' % randint(1, mx) for i in range(wd - 1)] return first + rest ... while True: print copy %s from stdin direct delimiter ','; % table_name for i in range(i,i+rows): print ','.join(row(i, width, maxint)) print '\.' I see the biggest potential in inlining randint. Unfortunately you did not provide an executable script and I had to make it up: $ time python gry_inline.py /dev/null real0m2.004s user0m2.000s sys 0m0.000s On second thought, if you have numpy available: $ cat gry_numpy.py from numpy.random import randint import sys def row(i, wd, mx): first = ['%d' % i] rest = ['%d' % i for i in randint(1, mx, wd - 1)] return first + rest def main(): table_name = unknown maxint = sys.maxint width = 500 rows = 1000 offset = 0 print copy %s from stdin direct delimiter ','; % table_name for i in range(offset, offset+rows): print ','.join(row(i, width, maxint)) print '\.' if __name__ == __main__: main() $ time python gry_numpy.py /dev/null real0m1.024s user0m1.010s sys 0m0.010s $ Argh Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: packaging and installing
On Dec 13, 2010, at 12:30 PM, Godson Gera wrote: On Mon, Dec 13, 2010 at 10:46 PM, Brian Blais bbl...@bryant.edu wrote: Hello, I was wondering if there is any standard or suggested way of installing packages *without* going to the commandline. I often have students who, from there experience in Windows, have never looked at the commandline before and it is a bit of a challenge to get them to install something (i.e. go to the commandline, cd over to the proper folder, type python setup.py install, etc...). I've never seen a package with something like a compileme.bat, but was wondering if there is some suggested way of doing this or some reasons *not* to do this. I can always write my own (1-line) .bat file, but I didn't want to reinvent the wheel. Perhaps there is a better way for me to do this, ideally in a platform independent way. You don't even have to write a bat file. Python's distutils package allows you to build exe file which creates generic windows wizard window for installing packages. Take a look at distutils package http://docs.python.org/distutils/builtdist.html that's very interesting, and I didn't realize that. it may be useful, and solves part of my problem, but the other part is that I am not on a windows machine and have to distribute to windows users. Or perhaps I am on windows, and need to distribute to Mac. It's great that python itself is so cross-platform, but the installation process for packages seems a lot less so. thanks, bb -- Brian Blais bbl...@bryant.edu http://web.bryant.edu/~bblais http://bblais.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: packaging and installing
On Tue, Dec 14, 2010 at 6:59 PM, Brian Blais bbl...@bryant.edu wrote: On Dec 13, 2010, at 12:30 PM, Godson Gera wrote: On Mon, Dec 13, 2010 at 10:46 PM, Brian Blais bbl...@bryant.edu wrote: Hello, I was wondering if there is any standard or suggested way of installing packages *without* going to the commandline. I often have students who, from there experience in Windows, have never looked at the commandline before and it is a bit of a challenge to get them to install something (i.e. go to the commandline, cd over to the proper folder, type python setup.py install, etc...). I've never seen a package with something like a compileme.bat, but was wondering if there is some suggested way of doing this or some reasons *not* to do this. I can always write my own (1-line) .bat file, but I didn't want to reinvent the wheel. Perhaps there is a better way for me to do this, ideally in a platform independent way. You don't even have to write a bat file. Python's distutils package allows you to build exe file which creates generic windows wizard window for installing packages. Take a look at distutils package http://docs.python.org/distutils/builtdist.html that's very interesting, and I didn't realize that. it may be useful, and solves part of my problem, but the other part is that I am not on a windows machine and have to distribute to windows users. Or perhaps I am on windows, and need to distribute to Mac. It's great that python itself is so cross-platform, but the installation process for packages seems a lot less so. Don't blame python for that. command line is least command denominator across all platforms and you don't wanted your audience to visit command line. As of 2010 you have to be on specific platform to make distributions for that platform. This kind of asking for toomuch from a few MB sized python. You need to make your own python distro to support all platform specific(exe, msi, ELF, app, rpm, deb etc etc ) packaing in one installation whose size may swell over many MBs or resort back to wiriting batch file on windows and bash and sh scripts on *nix platforms. -- Thanks Regards, Godson Gera Asterisk Consultant India http://godson.in/ -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter polling example: file copy with progress bar
Unfortunately you use command('cp...') to copy the file instead of Pythons portable library methods. This choice effectively makes your program work on Unix only (not Windows). See http://modcopy.sourceforge.net for a more portable version. Regards, bal...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter polling example: file copy with progress bar
On Tue, 14 Dec 2010 07:35:45 -0800 (PST) baloan balo...@googlemail.com wrote: Unfortunately you use command('cp...') to copy the file instead of Pythons portable library methods. This choice effectively makes your program work on Unix only (not Windows). See http://modcopy.sourceforge.net for a more portable version. I guess I missed the beginning of this thread but can someone tell me why one needs to download a whole other program in order to do this? open(out_fn, 'w').write(open(in_fn).read()) -- D'Arcy J.M. Cain da...@druid.net | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD#0082)(eNTP) | what's for dinner. -- http://mail.python.org/mailman/listinfo/python-list
Sybase module 0.40pre1 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. ** This version is a pre-release not intended for production use ** The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.40pre1.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_40pre1/ChangeLog -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter polling example: file copy with progress bar
On Tue, 14 Dec 2010 10:57:40 -0500, D'Arcy J.M. Cain wrote: I guess I missed the beginning of this thread but can someone tell me why one needs to download a whole other program in order to do this? open(out_fn, 'w').write(open(in_fn).read()) Or what about shutil? Isn't that the higher level file operation module? -- Harishankar (http://harishankar.org http://lawstudentscommunity.com) -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter polling example: file copy with progress bar
On Tue, 14 Dec 2010 16:25:54 + (UTC) Harishankar v.harishan...@gmail.com wrote: On Tue, 14 Dec 2010 10:57:40 -0500, D'Arcy J.M. Cain wrote: open(out_fn, 'w').write(open(in_fn).read()) Or what about shutil? Isn't that the higher level file operation module? At least that's in the standard library but even then it can be overkill for a simple copy. It does do some error checking that the above doesn't do if you need that. -- D'Arcy J.M. Cain da...@druid.net | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD#0082)(eNTP) | what's for dinner. -- http://mail.python.org/mailman/listinfo/python-list
Re: while True or while 1
Gregory Ewing greg.ew...@canterbury.ac.nz writes: Steven D'Aprano wrote: while True: ... print Looping ... True = 0 Just remember that if you use that inside a function, you'll have to initialise True to True before... er, wait a moment, that won't work... ah, I know: def f(true = True): True = true while True: ... True = False You also need to initialise False to False for it to be really robust. So something like this will do. True = not 0 False = not True while True: ... True = False :) -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list
Re: Fail import with SWIG generated imp.load_module ?
On 14/12/2010 08:43, Hvidberg, Martin wrote: I'm trying to load a module GDAL into a Python script. The loader/binderthat is then called, seems to be generated by SWIG, a project with which I'm unfortunately not familiar. The part of the SWIG generated code that fails on me is as follow: [snip] It _might_ be that imp.load_module(...) is raising an exception, so it doesn't assign to '_mod', and then it tries to run the 'finally' block and return _mod. This raises the exception you see and hides the original cause. -- http://mail.python.org/mailman/listinfo/python-list
Re: Sage's Python
On Dec 13, 4:33 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Fri, 10 Dec 2010 17:11:55 -, Akand Islam sohel...@gmail.com wrote: In my system (Ubuntu 10.04) there are sage-4.6, python 2.6.5, tk8.5- dev installed. When I give command from terminal sage -f python-2.6.5.p8 to get sage's python it shows following message: No command 'sage' found, did you mean: Command 'save' from package 'atfs' (universe) Command 'page' from package 'tcllib' (universe) sage: command not found How can I get Sage's python to be worked so that I can import sage.all in python shell? The fact that you have no executable called sage suggests that you haven't actually installed it yet. Check the Sage website, which has plenty of documentation, and try to figure out where you left the path on whichever method you used. -- Rhodri James *-* Wildebeest Herder to the Masses Dear Rhodri James, Thanks for your response. But I have installed sage-4.6 as per instructions. Sage-4.6 folder is in my ~/Desktop, therefore, from ~/ Desktop/sage-4.6 I can initiate ./sage and can work with sage. -- Akand -- http://mail.python.org/mailman/listinfo/python-list
Re: while True or while 1
Am 14.12.2010 17:52, schrieb Arnaud Delobelle: You also need to initialise False to False for it to be really robust. So something like this will do. True = not 0 False = not True while True: ... True = False Tres Seavers once told me a joke like this: True = not not Who's at the door? # say it out loud! This was back in the old days of Zope 2.5 and Python 2.1, which didn't have True and False. Christian -- http://mail.python.org/mailman/listinfo/python-list
Re: ctypes question
On Dec 11, 12:59 pm, MrJean1 mrje...@gmail.com wrote: In general, for shared libraries, you need to define those first as prototype using ctypes.CFUNCTYPE() and then instantiate each prototype once supplying the necessary parameter flags using prototype(func_spec, tuple_of_param_flags). See sections 15.16.2.3 and 4 of the ctypes docs*. I tried the cfuntype and proto steps, and it's not crashing now (that's good), but now i'm just left with null pointers as a return object. I'm still working through all of the examples you sent. They were extremely helpful. Here's where I'm at now... What is strange is I can actually get smiGetNode to work if I don't cfunctype/proto it. If i do, nada. however, the smiGetNextNode fails no matter what, usually with a segfault, but depending on how i construct it, sometimes a null pointer. constants.py: http://pastebin.com/f3b4Wbf0 libsmi.py: http://pastebin.com/XgtpG6gr smi.c (the actual function): http://pastebin.com/Pu2vabWM -- http://mail.python.org/mailman/listinfo/python-list
Map Linux locale codes to Windows locale codes?
Is there a way to map Linux locale codes to Windows locale codes? Windows has locale codes like 'Spanish_Mexico'. We would like to use the more ISO compliant 'es_MX' locale format under Windows. Is there a resource or API that might help us with this mapping? Babel is not an option for us since we're using Python 2.7. Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list
Concatenate a string as binary bytes
Hi To build a binary packet (for SMPP protocol), we have to concatenate different types of data: integers, floats, strings. We are using struct.pack to generate the binary representation of each integer and float of the packet, and then they are concatenated with the + operand. However, for strings we directly concatenate the string with +, without using struct. Everything works with python 2 except when string encoding is introduced. Whenever, a non ASCII char appears in the string, an exception is launched. In python 3, it's not possible to do this trick because all the strings are unicode. What would be the best approach to: - Support non-ascii chars (we just want to concatenate the binary representation of the string without any modification) - Compatibility between python 2 and python 3. Thanks, Jaime -- http://mail.python.org/mailman/listinfo/python-list
Re: Sage's Python
On 12/14/2010 10:27 AM Akand Islam said... On Dec 13, 4:33 pm, Rhodri Jamesrho...@wildebst.demon.co.uk wrote: On Fri, 10 Dec 2010 17:11:55 -, Akand Islamsohel...@gmail.com wrote: In my system (Ubuntu 10.04) there are sage-4.6, python 2.6.5, tk8.5- dev installed. When I give command from terminal sage -f python-2.6.5.p8 to get sage's python it shows following message: No command 'sage' found, did you mean: This means that no sage command was found on your path. Check to be sure that ~/Desktop is in your path. Emile Command 'save' from package 'atfs' (universe) Command 'page' from package 'tcllib' (universe) sage: command not found How can I get Sage's python to be worked so that I can import sage.all in python shell? The fact that you have no executable called sage suggests that you haven't actually installed it yet. Check the Sage website, which has plenty of documentation, and try to figure out where you left the path on whichever method you used. -- Rhodri James *-* Wildebeest Herder to the Masses Dear Rhodri James, Thanks for your response. But I have installed sage-4.6 as per instructions. Sage-4.6 folder is in my ~/Desktop, therefore, from ~/ Desktop/sage-4.6 I can initiate ./sage and can work with sage. -- Akand -- http://mail.python.org/mailman/listinfo/python-list
Re: Concatenate a string as binary bytes
On 14/12/2010 19:50, Jaime Fernández wrote: Hi To build a binary packet (for SMPP protocol), we have to concatenate different types of data: integers, floats, strings. We are using struct.pack to generate the binary representation of each integer and float of the packet, and then they are concatenated with the + operand. However, for strings we directly concatenate the string with +, without using struct. Everything works with python 2 except when string encoding is introduced. Whenever, a non ASCII char appears in the string, an exception is launched. In python 3, it's not possible to do this trick because all the strings are unicode. What would be the best approach to: - Support non-ascii chars (we just want to concatenate the binary representation of the string without any modification) - Compatibility between python 2 and python 3. I'd say encode to UTF-8. -- http://mail.python.org/mailman/listinfo/python-list
Re: Concatenate a string as binary bytes
2010/12/14 Jaime Fernández jjja...@gmail.com: Hi To build a binary packet (for SMPP protocol), we have to concatenate different types of data: integers, floats, strings. We are using struct.pack to generate the binary representation of each integer and float of the packet, and then they are concatenated with the + operand. However, for strings we directly concatenate the string with +, without using struct. Everything works with python 2 except when string encoding is introduced. Whenever, a non ASCII char appears in the string, an exception is launched. In python 3, it's not possible to do this trick because all the strings are unicode. What would be the best approach to: - Support non-ascii chars (we just want to concatenate the binary representation of the string without any modification) - Compatibility between python 2 and python 3. Thanks, Jaime -- I don't think you quite understand how encodings and unicode work.You have two similar, but distinct data types involved: a byte string ( in python 2.x, b in Python 3.x) which is a sequence of bytes, and a unicode String (u in Python 2.x and in Python 3.x) which is a sequence of characters. Neither type of strings has an encoding associated with it- an encoding is just a function for converting between these two data types. You only get those non-ascii character problems when you try concatenating Unicode strings with byte strings, because Python defaults to using ASCII as the encoding when you don't specify the encoding yourself. If you want to avoid those errors (in both Python 2.x and Python 3.x), use the unicode string's encode method to turn the characters into a sequence of bytes before you concat them. -- http://mail.python.org/mailman/listinfo/python-list
Re: while True or while 1
Christian Heimes li...@cheimes.de writes: [...] Tres Seavers once told me a joke like this: True = not not Who's at the door? # say it out loud! This was back in the old days of Zope 2.5 and Python 2.1, which didn't have True and False. I almost used: True = to be or not to be # that is the question but didn't dare! -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list
Re: PyArg_ParseTuple question
Mark Crispin nos...@panda.com writes: In a C module, I want to pick up the arguments for a Python call like: module.call(string1,[string2a, string2b, string2c], string3) and stash these into: char *arg1; char *arg2[]; char *arg3; All arguments are required, and we can assume that the arg2 vector is terminated with a null pointer. It doesn't look like PyArg_ParseTuple will do this easily; and that instead I have to use either the O! format with a PyList prototype, or use O and write a converter. I think the latter is probably your best bet. If I use O!, at what level does it check? In particular, does it just check that the argument is a list, so I can get away with something like: It does the equivalent of `isinstance', so you'll accept a `list' or an instance of any subclass of `list'. The `O' converter is pretty straightforward. Something like this ought to do. static int convertlist(PyObject *o, void *p) { PyObject **v; Py_ssize_t i, n; /* Could allow general sequences using PySequence_Fast */ if (!PyList_Check(o)) return (0); /* Copy stuff */ n = PyList_GET_SIZE(o); if ((v = PyMem_New(PyObject *, n + 1)) == 0) return (0); for (i = 0; i n; i++) { v[i] = PyList_GET_ITEM(o, n); Py_INCREF(v[i]); } v[n] = 0; return (1); } If you want to do a more complex conversion (e.g., to the individual items) there's more work to be done. I could have used PySequence_* functions to read the size and items, but that makes error handling more complicated. One could also borrow the references from the underlying list, which would leave the underlying storage for the vector as the only thing to free. I ended up writing a lot of conversion functions when I was doing Python library bindings (for a crypto library); they're generally a good thing. I found that the trickiest thing about PyArg_ParseTuple is in making sure that you can clean everything up even if it goes wrong half way through. -- [mdw] -- http://mail.python.org/mailman/listinfo/python-list
Re: Map Linux locale codes to Windows locale codes?
You could look into the windows registry, the key HKLM\SYSTEM\CurrentControlSet\Control\Nls has all the supported LCID's listed. If not, you could simply get the codepage provided by locale.setlocale(), e.g.: import locale print(locale.setlocale(locale.LC_ALL, )) prints Portuguese_Brazil.1252 for me. That codepage part is actually a LCID, that you can then cross-reference with any LCID list on the net. I guess there may be a way to look that up entirely from the registry, including getting a short reference or ANSI codepage from the LCID, but i doubt it'd be portable at all. Maybe what you should do is to make up a dict with known LCID's and their corresponding language codes. I don't know of any way to do this automatically in python... Take a look at http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx 2010/12/14 pyt...@bdurham.com Is there a way to map Linux locale codes to Windows locale codes? Windows has locale codes like 'Spanish_Mexico'. We would like to use the more ISO compliant 'es_MX' locale format under Windows. Is there a resource or API that might help us with this mapping? Babel is not an option for us since we're using Python 2.7. Thank you, Malcolm -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
How to pop the interpreter's stack?
Consider this code: def spam(*args, **kwargs): args, kwargs = __pre_spam(*args, **kwargs) # args kwargs are OK: proceed # ... def __pre_spam(*args, **kwargs): # validate args kwargs; # return canonicalized versions of args kwargs; # on failure, raise some *informative* exception # ... return canonicalized_args, canonicalized_kwargs I write functions like __pre_spam for one reason only: to remove clutter from a corresponding spam function that has a particularly complex argument-validation/canonicalization stage. In effect, spam outsources to __pre_spam the messy business of checking and conditioning its arguments. The one thing I don't like about this strategy is that the tracebacks of exceptions raised during the execution of __pre_spam include one unwanted stack level (namely, the one corresponding to __pre_spam itself). __pre_spam should be completely invisible and unobtrusive, as if it had been textually inlined into spam prior to the code's interpretation. And I want to achieve this without in any way cluttering spam with try/catches, decorators, and whatnot. (After all, the whole point of introducing __pre_spam is to declutter spam.) It occurs to me, in my innocence (since I don't know the first thing about the Python internals), that one way to achieve this would be to have __pre_spam trap any exceptions (with a try/catch around its entire body), and somehow pop its frame from the interpreter stack before re-raising the exception. (Or some clueful/non-oxymoronic version of this.) How feasible is this? And, if it is quite unfeasible, is there some other way to achieve the same overall design goals described above? TIA! ~kj -- http://mail.python.org/mailman/listinfo/python-list
Alternative to PIL in Python 3.1
Hi. I wonder if anyone knows any alternative to PIL library, as this does not work with Python 3.1. Thanks in advance Regards. Cristian -- http://mail.python.org/mailman/listinfo/python-list
How to experience python on a handheld, tablet, etc on linux?
Without buying first? I'd like to run the front end of all these new devices, on my PC and program in python, to assess which is the best on for me. pre-test python scripts before cross loading onto the device I finally buy. Is that possible? It would also be nice to have some of the look and feel on a PC of these devices anyway, with python of course. Has that be done yet? Any hints? Cheers in advance. -- http://mail.python.org/mailman/listinfo/python-list
Combing Medusa's Hair... (Design Pattern)
This is an idea I got thinking about COM objects, and getting some support from Mark Hammond, Python's Win32 wizard. The goal is to have a host language (not Python) instantiate an object that runs against the Python interpreter, which lives as its own process. The VMs have various ways of implementing this. Mono isn't that different right? In this design pattern, you have something like a dry cleaner's, where people submit jobs at the counter, and go away right away with a ticket (Python returns -- but keeps running). When they come back is more up to them. Work has been done in the meantime (or not, if the queue is backed up). So Python needs a queue in the front, to accept these job orders, a facility for issuing tickets, and a way to catalog what tasks are completed in some urn or receptacle (given this is Python, we might call it a holy grail). The host process has a method from querying the Python object as to whether such-and-such a job is complete or not. More primitively, it could just check an output bin (folder) for the expected file (perhaps each hair creates a PDF in roughly 1 to 4 seconds). The reason Medusa is useful wordplay is it reminds us of the asynchronous server embedded in early Zope. How Medusa relates to Twisted is lore for others to recount. However, given we're spawning strands, hairs or threads each time a host process calls into our object, we're looking at a multi-snaked environment, so the image could hardly be more apt. The act of combing suggests some synchronization / communication between threads, but that's not a requirement. More on tap here: http://mail.python.org/pipermail/edu-sig/2010-December/010141.html Kirby -- http://mail.python.org/mailman/listinfo/python-list
Re: Alternative to PIL in Python 3.1
On 12/14/2010 3:17 PM craf said... Hi. I wonder if anyone knows any alternative to PIL library, as this does not work with Python 3.1. Thanks in advance Regards. Cristian You might try the 1.1.6 port referenced here: http://www.mail-archive.com/image-sig@python.org/msg02404.html Emile -- http://mail.python.org/mailman/listinfo/python-list
Re: ctypes question
Try again after changing line 16 to sn = SmiGetNode(None, 1.3.6.1.2.1.2.2) Because, SmiGetNode is a Python function which accepts Python objects as arguments. Passing is a ctypes object oid is incorrect. /Jean On Dec 14, 10:36 am, News Wombat newswom...@gmail.com wrote: On Dec 11, 12:59 pm, MrJean1 mrje...@gmail.com wrote: In general, for shared libraries, you need to define those first as prototype using ctypes.CFUNCTYPE() and then instantiate each prototype once supplying the necessary parameter flags using prototype(func_spec, tuple_of_param_flags). See sections 15.16.2.3 and 4 of the ctypes docs*. I tried the cfuntype and proto steps, and it's not crashing now (that's good), but now i'm just left with null pointers as a return object. I'm still working through all of the examples you sent. They were extremely helpful. Here's where I'm at now... What is strange is I can actually get smiGetNode to work if I don't cfunctype/proto it. If i do, nada. however, the smiGetNextNode fails no matter what, usually with a segfault, but depending on how i construct it, sometimes a null pointer. constants.py:http://pastebin.com/f3b4Wbf0 libsmi.py:http://pastebin.com/XgtpG6gr smi.c (the actual function):http://pastebin.com/Pu2vabWM -- http://mail.python.org/mailman/listinfo/python-list
[Fwd: Re: Alternative to PIL in Python 3.1]
- Mensaje reenviado De: Emile van Sebille em...@fenx.com Para: python-list@python.org Asunto: Re: Alternative to PIL in Python 3.1 Fecha: Tue, 14 Dec 2010 16:39:19 -0800 On 12/14/2010 3:17 PM craf said... Hi. I wonder if anyone knows any alternative to PIL library, as this does not work with Python 3.1. Thanks in advance Regards. Cristian You might try the 1.1.6 port referenced here: http://www.mail-archive.com/image-sig@python.org/msg02404.html Emile Hi Emile. Thanks for the info. I'll try it. Regards. Cristian -- http://mail.python.org/mailman/listinfo/python-list
Re: How to experience python on a handheld, tablet, etc on linux?
On Tue, Dec 14, 2010 at 6:30 PM, stateslave stonesn...@kol.co.nz wrote: Without buying first? I'd like to run the front end of all these new devices, on my PC and program in python, to assess which is the best on for me. pre-test python scripts before cross loading onto the device I finally buy. Is that possible? It would also be nice to have some of the look and feel on a PC of these devices anyway, with python of course. Has that be done yet? Any hints? Cheers in advance. -- Python on Linux is Python on Linux. Whether you have Ubuntu running on a tablet or on a desktop, it's going to behave the same. There are going to be two important things different between running Linux on your PC and running it on a tablet: the processor and the UI. And there's really no good way to simulate either one of those. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to pop the interpreter's stack?
kj wrote: The one thing I don't like about this strategy is that the tracebacks of exceptions raised during the execution of __pre_spam include one unwanted stack level (namely, the one corresponding to __pre_spam itself). __pre_spam should be completely invisible and unobtrusive I am unaware of any way to accomplish what you desire. I also think this is one of those things that's not worth fighting -- how often are you going to see such a traceback? When somebody makes a coding mistake? I would say change the name (assuming yours was a real example) to something more meaningful like _spam_arg_verifier and call it good. Alternatively, perhaps you could make a more general arg_verifier that could be used for all such needs, and then your traceback would have: caller spam arg_verifier and that seems useful to me (it is, in fact, how I have mine set up). Hope this helps! ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list
Re: Proposed changes to logging defaults
On Dec 9, 6:12 pm, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: Some changes are being proposed to how logging works in default configurations. Briefly - when a logging event occurs which needs to be output to some log, the behaviour of the logging package when no explicit logging configuration is provided will change, most likely to log those events to sys.stderr with a default format. I'm in favor of this change. I've long wished that I could just add lots of warning/error/info logging to a script and have it just work without having to spend time configuring the logging system. -- http://mail.python.org/mailman/listinfo/python-list
Re: Combing Medusa's Hair... (Design Pattern)
On Wed, Dec 15, 2010 at 5:04 AM, kirby.ur...@gmail.com kirby.ur...@gmail.com wrote: This is an idea I got thinking about COM objects, and getting some support from Mark Hammond, Python's Win32 wizard. The goal is to have a host language (not Python) instantiate an object that runs against the Python interpreter, which lives as its own process. The VMs have various ways of implementing this. Mono isn't that different right? In this design pattern, you have something like a dry cleaner's, where people submit jobs at the counter, and go away right away with a ticket (Python returns -- but keeps running). When they come back is more up to them. Work has been done in the meantime (or not, if the queue is backed up). Isn't this the way people use queuing systems (ActiveMQ and the like)? Or simply multiprocessing + Queue. -- regards, kushal -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter polling example: file copy with progress bar
On Dec 14, 8:57 am, D'Arcy J.M. Cain da...@druid.net wrote: On Tue, 14 Dec 2010 07:35:45 -0800 (PST) baloan balo...@googlemail.com wrote: Unfortunately you use command('cp...') to copy the file instead of Pythons portable library methods. This choice effectively makes your program work on Unix only (not Windows). Seehttp://modcopy.sourceforge.netfor a more portable version. I guess I missed the beginning of this thread but can someone tell me why one needs to download a whole other program in order to do this? open(out_fn, 'w').write(open(in_fn).read()) I posted this example because I got several queries on how to do polling in Tkinter, specifically how to use the .after() universal widget method. The points about using the portable library methods are all well taken. I used file copy as the example long-running process because a reader wanted to know how to do that specifically. Please forgive me for not thinking about portability and stuff; you know how us ancient Unix weenies are. -- http://mail.python.org/mailman/listinfo/python-list
Re: Tkinter polling example: file copy with progress bar
On Dec 14, 8:57 am, D'Arcy J.M. Cain da...@druid.net wrote: On Tue, 14 Dec 2010 07:35:45 -0800 (PST) baloan balo...@googlemail.com wrote: Unfortunately you use command('cp...') to copy the file instead of Pythons portable library methods. This choice effectively makes your program work on Unix only (not Windows). Seehttp://modcopy.sourceforge.netfor a more portable version. I guess I missed the beginning of this thread but can someone tell me why one needs to download a whole other program in order to do this? open(out_fn, 'w').write(open(in_fn).read()) I posted this example because I got several queries on how to do polling in Tkinter, specifically how to use the .after() universal widget method. The points about using the portable library methods are all well taken. I used file copy as the example long-running process because a reader wanted to know how to do that specifically. Please forgive me for not thinking about portability and stuff; you know how us ancient Unix weenies are. -- http://mail.python.org/mailman/listinfo/python-list
Re: Combing Medusa's Hair... (Design Pattern)
On Tue, Dec 14, 2010 at 8:10 PM, Kushal Kumaran kushal.kumaran+pyt...@gmail.com wrote: snip In this design pattern, you have something like a dry cleaner's, where people submit jobs at the counter, and go away right away with a ticket (Python returns -- but keeps running). When they come back is more up to them. Work has been done in the meantime (or not, if the queue is backed up). Isn't this the way people use queuing systems (ActiveMQ and the like)? Or simply multiprocessing + Queue. -- regards, kushal Yeah, that's probably right. This is more like a pedagogical metaphor, a mnemonic. As the name for a design pattern, it should probably be confined to Python examples, as that's where the wordplay on Medusa makes some sense, and not just because her hair was all snakes. http://bytes.com/topic/python/answers/26771-twisted-medusa-zope Kirby -- http://mail.python.org/mailman/listinfo/python-list
Re: ctypes question
News Wombat newswom...@gmail.com wrote in message news:413f5a8f-69a0-4351-acc2-18d7edda8...@j3g2000vbp.googlegroups.com... On Dec 11, 12:59 pm, MrJean1 mrje...@gmail.com wrote: In general, for shared libraries, you need to define those first as prototype using ctypes.CFUNCTYPE() and then instantiate each prototype once supplying the necessary parameter flags using prototype(func_spec, tuple_of_param_flags). See sections 15.16.2.3 and 4 of the ctypes docs*. I tried the cfuntype and proto steps, and it's not crashing now (that's good), but now i'm just left with null pointers as a return object. I'm still working through all of the examples you sent. They were extremely helpful. Here's where I'm at now... What is strange is I can actually get smiGetNode to work if I don't cfunctype/proto it. If i do, nada. however, the smiGetNextNode fails no matter what, usually with a segfault, but depending on how i construct it, sometimes a null pointer. constants.py: http://pastebin.com/f3b4Wbf0 libsmi.py: http://pastebin.com/XgtpG6gr smi.c (the actual function): http://pastebin.com/Pu2vabWM -- http://mail.python.org/mailman/listinfo/python-list constants.py, in SmiNode and SmiModule definitions: - Any field defined char* in C should be c_char_p not POINTER(c_char_p) (which is char**). The function definition can be simplified, and 2nd argument corrected (c_char_p not POINTER(c_char_p)). Python strings can be passed directly to c_char_p arguments. SmiGetNode = clibsmi.smiGetNode SmiGetNode.argtypes = [POINTER(SmiModule),c_char_p] SmiGetNode.restype = POINTER(SmiNode) oid = 1.3.6.1.2.1.2.2 sn=SmiGetNode(None,oid) Give these fixes a try... -Mark -- http://mail.python.org/mailman/listinfo/python-list
how tohandling output generated after execution of command/script on host unix machine?
Hi Experts, I am still struggling with handling output generated after execution of command/script on host unix machine using windows client machine ssh code : import sys import datetime import time # setup logging paramiko.util.log_to_file('darshak_simple.log') ssh=paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(*,username=,password=) try: stdin,stdout,stderr=ssh.exec_command(BsPlSMProbe -f node -d /var/log/Darshak/3.txt ) // output of this command will be store in /var/log/Darshak/ in remote machine except: {Issue is files are generating but remaining blank pls pls help me out of this} print check time.sleep(10) print stdout.readlines() a=stdout.readlines() print 1 ssh.close() #print stdout.readlines() Issue is files are generating but remaining blank pls pls help me out of this -- BR Darshak Bavishi -- http://mail.python.org/mailman/listinfo/python-list
[issue10670] Provide search scope limits
anatoly techtonik techto...@gmail.com added the comment: label:interop -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10670 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5863] bz2.BZ2File should accept other file-like objects.
Xuanji Li xua...@gmail.com added the comment: Sorry, I'm giving up. The copyright notice for bz2module.c lists Gustavo Niemeyer as one of the holders, is he the maintainer? Maybe he should be notified of this bug. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
Xuanji Li xua...@gmail.com added the comment: Alternatively, I think we can do a conversion to int in Telnet.__init__ (see patch) -- keywords: +patch nosy: +xuanji Added file: http://bugs.python.org/file20035/issue10695.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
Christian S. Perone christian.per...@gmail.com added the comment: I don't know, by doing this on __init__ we can break a lot of legacy codes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10694] zipfile.py end of central directory detection not robust
Xuanji Li xua...@gmail.com added the comment: Hi, I would like to take a look at whether your code works, can you provide an zip file that is currently not read by zipfile but should be? Also, I suggest you submit the code changes as a patch (http://www.python.org/dev/patches/) thanks! -- nosy: +xuanji ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
Xuanji Li xua...@gmail.com added the comment: Hi, is there any legacy code that would rely on port being stored as a string rather than an integer? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
Christian S. Perone christian.per...@gmail.com added the comment: Not from Python itself I think, but external, from users. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
R. David Murray rdmur...@bitdance.com added the comment: Yes, for backward compatibility reasons it is better to make the change that fixes the thing that doesn't work and leave the rest alone. Probably the change wouldn't break *much* existing user code, but why break anything when there doesn't seem to be any particular advantage to doing so? -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
Christian S. Perone christian.per...@gmail.com added the comment: Agree. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5863] bz2.BZ2File should accept other file-like objects.
Antoine Pitrou pit...@free.fr added the comment: Sorry, I'm giving up. Indeed, I think only an extensive rewrite could fulfill the feature request here. The copyright notice for bz2module.c lists Gustavo Niemeyer as one of the holders, is he the maintainer? Maybe he should be notified of this bug. He hasn't been active for years, so I don't think he can still be considered the maintainer. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5863 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6559] add pass_fds paramter to subprocess.Popen()
Gregory P. Smith g...@krypto.org added the comment: Bug fix, unittest and documentation added in r87229. Thanks! -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10692] imap lib server compabilities
R. David Murray rdmur...@bitdance.com added the comment: Starttls support was only added in Python 3.2. Apparently your server is set to disallow non-SSL connections. Have you confirmed that the same server is listening on port 993 as is listening on port 143? The debug info from imaplib makes it look like different capability information is being returned, though the banner does look the same. Please run the regular IMAP4 test with debug on, I think it may be getting past the capabilities query before it produces the starttls error, and if so it would be interesting to compare the two debug traces. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10692 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10692] imap lib server compabilities
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 2.7 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10692 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs
Gregory P. Smith g...@krypto.org added the comment: I updated the documentation and changed the close_fds default on Windows to be True when possible per Giovanni's suggestion in r87229. That keeps the API and defaults as consistent as possible across all platforms. -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7213] subprocess leaks open file descriptors between Popen instances causing hangs
Gregory P. Smith g...@krypto.org added the comment: P.S. Yes I will be backporting all of this to subprocess32. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7213 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10262] Add --soabi option to `configure`
Matthias Klose d...@debian.org added the comment: shouldn't that option work on platforms too, which currently default to not using the soabi? It would make sense for all posix, and macos, maybe not for Windows. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10262 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10262] Add --soabi option to `configure`
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: The soabi tag could be useful on Windows as well, for example if some package maintainer chooses another version of the compiler, or a custom version of MSVCRT. And FWIW, PyPy currently uses --soabi=pypy-1.4 on all platforms: import foo will load foo.pypy-14.so (foo.pypy-14.pyd on Windows). There are also some specific abiflags. A difference is that PyPy will also ignore the default foo.so, because extension modules built for CPython will likely crash with PyPy. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10262 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
R. David Murray rdmur...@bitdance.com added the comment: Fixed in py3k in r87230, with test. Backported to 3.1 in r87231 and 2.7 in r87232. The 2.7 backport doesn't include the test since the test infrastructure for it doesn't exist in the 2.7 test_telnetlib. -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10695] telnetlib.Telnet port number int/str inconsistency
Changes by R. David Murray rdmur...@bitdance.com: -- versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10695 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10262] Add --soabi option to `configure`
Barry A. Warsaw ba...@python.org added the comment: Amaury, did you see my suggestion re $SOBASE and $SOEXTRA? Also, do you think you can write some tests, even if they only run on a single platform? I suspect the Makefile.pre.in part of the patch will have to be updated now. Please be sure to test your changes with --enable-shared as well to make sure everything gets installed correctly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10262 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1731717] race condition in subprocess module
Gregory P. Smith g...@krypto.org added the comment: r87233 fixes the OSError escaping from wait() issue when SIGCLD is set to be ignored. (to appear in 3.2beta1; it is a candidate for backporting to 3.1 and 2.7) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1731717 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10700] python pickle.dumps AssertionError
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: This is a known problem. See issues #1062277 and #9269. You can work around the issue by using a dict. I am attaching two test files. First, set-graph.py, reproduces the issue in 3.x and the second, dict-graph.py, contains a workaround. -- resolution: - duplicate stage: - committed/rejected status: open - closed superseder: - Cannot pickle self-referencing sets type: crash - behavior Added file: http://bugs.python.org/file20036/set-graph.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10700 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10700] python pickle.dumps AssertionError
Changes by Alexander Belopolsky belopol...@users.sourceforge.net: Added file: http://bugs.python.org/file20037/dict-graph.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10700 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10701] Error pickling a dict
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: The work-around that I proposed for issue10700 does not work with Python 2.x: $ python2.7 dict-graph.py Vertex 0 - 2, 1 Vertex 1 - Vertex 2 - Traceback (most recent call last): File dict-graph.py, line 74, in module p = pickle.dumps(g) ... File .../Lib/pickle.py, line 661, in _batch_setitems for k, v in items: RuntimeError: dictionary changed size during iteration -- files: dict-graph.py messages: 123948 nosy: Leo.Na, belopolsky priority: normal severity: normal stage: needs patch status: open title: Error pickling a dict type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file20038/dict-graph.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10701 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10515] csv sniffer does not recognize quotes at the end of line
Martin Budaj m.bu...@gmail.com added the comment: What do you mean by there is a test for this case in csv.py? I meant test in regex on line 217 in python 2.7 and the following code (line 258ff): # there is *no* delimiter, it's a single column of quoted data delim = '' skipinitialspace = 0 However, it is intended to detect just lines starting and ending with quotes. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10515 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10700] python pickle.dumps AssertionError
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: It turns out that dict-graph.py does not work with python2.x, but that is a different problem, so I opened a separate issue for it. See issue10701. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10700 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1731717] race condition in subprocess module
Gregory P. Smith g...@krypto.org added the comment: sorry, i meant 3.2beta2 above. release27-maint: r87234 targeting 2.7.2 release31-maint: r87235 targeting 3.1.4 -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1731717 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10541] regrtest.py -T broken
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Here is a simpler invocation that produces a similar error: $ ./python.exe -m test.regrtest -T test_trace test_pkg ... IOError: [Errno 2] No such file or directory: '/var/folders/qs/qsqFUI2xFUKG+9CTf4z7pU+++TI/-Tmp-/tmpy1iyp7/t4/sub/__init__.py' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10541 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10694] zipfile.py end of central directory detection not robust
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: If you read the bug report it explains how to generate a testcase (i.e. append any data to the end of a zip archive) Here it is as a step by step process 1. simply take any working zip and call it testcase.zip 2. do the following: echo \r\n testcase.zip If you run unzip -t on testcase.zip it will pass with flying colors and will properly unzip on every piece of zip software I have tried. However if you try to use python to copy the zip archive to another zip archive python ./zipfix.py testcase.zip junk.zip Error Occurred File is not a zip file All because of the appended carriage return / linefeed at the end. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10694] zipfile.py end of central directory detection not robust
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: Here is one potential patch. It simply incorporates and non-comment extraneous data into a final comment so that nothing is lost. Another solution that might be safer, would be to truncate the zip archive immediately after the endrec is found if the extraneous data is not a properly formatted comment. The right solution is obviously up to the developers of zipfile.py --- zipfile_orig.py 2010-12-14 10:23:58.0 -0500 +++ zipfile.py 2010-12-14 10:30:21.0 -0500 @@ -228,6 +228,13 @@ # structure present, so go look for it return _EndRecData64(fpin, start - filesize, endrec) return endrec +else : +# be robust to non-comment extaneous data after endrec +# by making it a comment so that nothing is ever lost +endrec[_ECD_COMMENT_SIZE] = len(comment) +endrec.append(comment) +endrec.append(maxCommentStart + start) +return endrec # Unable to find a valid end of central directory structure return -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10587] Document the meaning of str methods
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: I am attaching a patch that expands the documentation of isalnum, isalpha, isdecimal, isdigit, isnumeric, islower, isupper, and isspace. I did not change isidentifier or isprintable because their docs were already complete. I also left out istitle because I could not figure out how to deal with the confusion between Python and Unicode notions of titlecase. I would also like to note that it appears that isdigit and isdecimal imply isnumeric, so s.isalnum() is equivalent to all(c.isalpha() or c.isnumeric() for c in s). However the actual code does have redundant checks for isdecimal() and isdigit(). I think the documentation should reflect what the code does for an off-chance that someone would replace unicodedata with their own database with which these checks are not redundant. -- assignee: d...@python - belopolsky keywords: +patch stage: - commit review Added file: http://bugs.python.org/file20039/issue10587.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7183] did 2.6.3 regress for some uses of the __doc__ property?
R. David Murray rdmur...@bitdance.com added the comment: Since boost has changed their code and no one else has reported a problem and 2.6 is now in bug fix only mode, I'm going to close this as out of date (sorry I overlooked it for 2.6.5). If anyone disagrees, let me know what we should change and why in 2.7. -- resolution: - out of date stage: unit test needed - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7183 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1731717] race condition in subprocess module
Antoine Pitrou pit...@free.fr added the comment: It seems the canonical spelling is SIGCHLD. SIGCLD doesn't exist everywhere and it produces test failures under OS X: http://www.python.org/dev/buildbot/all/builders/AMD64%20Leopard%203.x http://www.python.org/dev/buildbot/all/builders/AMD64%20Snow%20Leopard%203.x FWIW, this is what POSIX says: “Some implementations, including System V, have a signal named SIGCLD, which is similar to SIGCHLD in 4.2 BSD. POSIX.1 permits implementations to have a single signal with both names. POSIX.1 carefully specifies ways in which conforming applications can avoid the semantic differences between the two different implementations. The name SIGCHLD was chosen for POSIX.1 because most current application usages of it can remain unchanged in conforming applications. SIGCLD in System V has more cases of semantics that POSIX.1 does not specify, and thus applications using it are more likely to require changes in addition to the name change.” http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xsh_chap02.html -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1731717 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6559] add pass_fds paramter to subprocess.Popen()
Antoine Pitrou pit...@free.fr added the comment: It seems there are (intermittent?) test failures: == FAIL: test_pass_fds (test.test_subprocess.POSIXProcessTestCase) -- Traceback (most recent call last): File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py, line 1067, in test_pass_fds fd to be closed passed) AssertionError: {5} is not False : fd to be closed passed == FAIL: test_pass_fds (test.test_subprocess.ProcessTestCasePOSIXPurePython) -- Traceback (most recent call last): File /home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_subprocess.py, line 1067, in test_pass_fds fd to be closed passed) AssertionError: {5} is not False : fd to be closed passed (from http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.x/builds/2337/steps/test/logs/stdio ) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6559 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue775964] fix test_grp failing when NIS entries present
R. David Murray rdmur...@bitdance.com added the comment: Committed to py3k in r87238, 3.1 in r87239, and 2.7 in r87240. Thanks, Bobby. -- nosy: +r.david.murray resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue775964 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10694] zipfile.py end of central directory detection not robust
Changes by Kevin Hendricks kevin.hendri...@sympatico.ca: -- keywords: +patch versions: +Python 2.5, Python 2.6 Added file: http://bugs.python.org/file20040/more_robust.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10702] bytes and bytearray methods are not documented
New submission from Alexander Belopolsky belopol...@users.sourceforge.net: Library reference manual has a section dedicated to string methods [1], but similar methods of bytes and bytearray types are not documented. Adding two new sections would probably be too repetitious, so I wonder if it would make sense to add notes about byte/bytearray methods to the matching string methods' entries. See also issue10587. [1] http://docs.python.org/dev/py3k/library/stdtypes.html#string-methods -- assignee: d...@python components: Documentation messages: 123960 nosy: belopolsky, d...@python priority: normal severity: normal status: open title: bytes and bytearray methods are not documented versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10702 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10703] Regex 0.1.20101210
New submission from Steve Moran s...@uw.edu: The regex package doesn't seem to correctly implement the single grapheme match \X (\P{M}\p{M}*) for pre-Python 3. I'm using the string íi-te (i, U+0301, i, -, t, e -- where U+0301 is Unicode COMBINING ACUTE ACCENT), reading it in from a file to bypass Unicode cp issues in the older IDLEs). s...@x$ python3.1 Python 3.1.2 (r312:79147, May 19 2010, 11:50:28) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2 Type help, copyright, credits or license for more information. import regex file = open(test_data, rt, encoding=utf-8) s = file.readline() print (s) íi-te print (g.findall(s)) ['í', 'i', '-', 't', 'e'] * Correct in 3.1 - i+U+0301 considered one grapheme. s...@x$ python2.7 Python 2.7 (r27:82500, Oct 4 2010, 14:49:53) [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2 Type help, copyright, credits or license for more information. import codecs import regex file = codecs.open(test_data, r, utf-8) g = regex.compile(\X) s = file.readline() s u'i\u0301i-te' print s.encode(utf-8) íi-te print g.findall(s) [u'i', u'\u0301', u'i', u'-', u't', u'e'] *Not correct -- accent is treated as a separate character. Thanks. -- components: Regular Expressions messages: 123961 nosy: stiv priority: normal severity: normal status: open title: Regex 0.1.20101210 type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4236] Crash when importing builtin module during interpreter shutdown
R. David Murray rdmur...@bitdance.com added the comment: Brett applied his doc patch in r69092. Attached is a patch that combines Simon's patch with Martin's test program turned into a unit test. I confirm that the test suite passes with the patch applied (and fails with just the test applied). From the text of the original error message, I wonder if there is some way to trigger this error at interpreter startup, and if so whether or not that is tested by the test suite. Otherwise, is there any reason not to apply this patch? -- nosy: +r.david.murray stage: needs patch - patch review Added file: http://bugs.python.org/file20041/check-import-machinery-only-with-test.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4236 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3080] Full unicode import system
R. David Murray rdmur...@bitdance.com added the comment: With #1342 fixed, it seems that this issue is no longer critical (Haypo describes his complicated patch as useful on Windows, but not critical. So I'm downgrading it to 'high'. Perhaps it is even 'normal'. It also seems as though it is currently languishing unless someone wants to pick it up. -- nosy: +r.david.murray priority: critical - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3080 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8040] It would be nice if documentation pages linked to other versions of the same document
Changes by Daniel Stutzbach stutzb...@google.com: -- versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8040 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10704] Regex 0.1.20101210 Python 3.1 install problem Mac OS X 10.6.5
New submission from Steve Moran s...@uw.edu: Package doesn't want to install on Mac OS X 10.6.5 with Python 3.1 using instructions python3.1 setup.py install (or sudo python3.1 setup.py install). Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/MacOSX10.4u.sdk Extended error log attached. NB: I realize this package is in dev and it's got less than 50 current downloads. Thought I'd post anyway. I appreciate any input. Xcode is installed v 3.2.2. 64-bit. -- components: Installation files: regex-0.1.20101210-python31-install-error messages: 123964 nosy: stiv priority: normal severity: normal status: open title: Regex 0.1.20101210 Python 3.1 install problem Mac OS X 10.6.5 versions: Python 3.1 Added file: http://bugs.python.org/file20042/regex-0.1.20101210-python31-install-error ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10703] Regex 0.1.20101210
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Regex 0.1.20101210 is not part of the standard Python distribution, so this bug report is invalid. -- nosy: +belopolsky resolution: - invalid status: open - closed superseder: - Regexp 2.7 (modifications to current re 2.2.2) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10704] Regex 0.1.20101210 Python 3.1 install problem Mac OS X 10.6.5
Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Regex 0.1.20101210 is not part of the standard Python distribution, so this bug report is invalid. See issue2636 for the development status of regex. -- nosy: +belopolsky resolution: - invalid status: open - closed superseder: - Regexp 2.7 (modifications to current re 2.2.2) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10704] Regex 0.1.20101210 Python 3.1 install problem Mac OS X 10.6.5
Steve Moran s...@uw.edu added the comment: Yeah, it's not immediately clear how to bring this up at http://bugs.python.org/issue2636 On Tue, 14 Dec 2010, Alexander Belopolsky wrote: Alexander Belopolsky belopol...@users.sourceforge.net added the comment: Regex 0.1.20101210 is not part of the standard Python distribution, so this bug report is invalid. See issue2636 for the development status of regex. -- nosy: +belopolsky resolution: - invalid status: open - closed superseder: - Regexp 2.7 (modifications to current re 2.2.2) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10704 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10667] collections.Counter object in C
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Attaching a new patch for high-speed update() and __init__(). I also tried a C version of __missing__() but the speed-up was too small to be worth it. -- resolution: later - stage: - patch review versions: +Python 3.2 -Python 3.3 Added file: http://bugs.python.org/file20043/fastcount.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10667 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10703] Regex 0.1.20101210
Changes by R. David Murray rdmur...@bitdance.com: -- assignee: - mark.dickinson nosy: +mark.dickinson, mrabarnett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10703 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10704] Regex 0.1.20101210 Python 3.1 install problem Mac OS X 10.6.5
Changes by R. David Murray rdmur...@bitdance.com: -- nosy: +mrabarnett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10704 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5368] curses patch add color_set and wcolor_set , and addchstr family of functions
Changes by R. David Murray rdmur...@bitdance.com: -- stage: - patch review type: - feature request ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5368 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8769] Straightforward usage of email package fails to round-trip
Changes by R. David Murray rdmur...@bitdance.com: -- type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8769 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4402] os.getenv('PATH') return different result between 2.5 and 3.0rc3
R. David Murray rdmur...@bitdance.com added the comment: Looks like it is won't fix, since it hasn't been. It doesn't seem as though it is our responsibility to clean up crud in the windows registry introduced by other distributions. -- assignee: loewis - nosy: +r.david.murray resolution: - wont fix stage: - committed/rejected status: open - closed type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4402 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com