Wing IDE 5.0.9 released

2014-09-11 Thread Wingware

Hi,

Wingware has released version 5.0.9 of Wing IDE, our cross-platform 
integrated development environment for the Python programming language.


Wing IDE includes a professional quality code editor with vi, emacs, 
visual studio, and other key bindings, auto-completion, call tips, 
goto-definition, find uses, refactoring, context-aware auto-editing, a 
powerful graphical debugger, version control, unit testing, search, and 
many other features.  For details see http://wingware.com/


Changes in this minor release include:

Ability to mark a range of code in the editor for easy reevaluation 
in the Python Shell or Debug Probe

Optimized multi-file searching
Improved goto-definition in the Python Shell and Debug Probe
Preliminary support for OS X 10.10 (Yosemite)
Several VI mode fixes
Improved visit history
Fixed crashing on some mako files
Recursively copy directories dragged and dropped in the Project tool
Fix problems with typing into block selections
About 24 other improvements; see the change log for details

For details see http://wingware.com/pub/wingide/5.0.9/CHANGELOG.txt

A summary of new features in Wing 5:

Native GUI on OS X and better overall OS-native look and feel
Draggable tools and editors
Configurable toolbar and editor  project context menus
Lockable editor splits and mode to open different files in each split
Sharable color palettes and syntax highlighting configurations
Auto-editing is on by default (except some operations that have a 
learning curve)
Optional Python Turbo completion (context-appropriate completion on 
all non-symbol keys)
Improved Source Assistant with PEP 287 docstring rendering and 
return types

Move debug program counter
Named file sets
New Project dialog
Sharable launch configurations and named entry points
Asynchronous I/O in Debug Probe and Python Shell
More control over unit testing environment
Initial preferences dialog for new users
Support for Python 3.4 and Stackless Python 2.7 and 3.3
Support for Django 1.6
Support for matplotlib on Anaconda and with MacOSX backend
Support for Maya 2015, MotionBuilder 2015, Nuke 8, and Source Filmmaker
Improved integrated and PDF documentation
Expanded and rewritten tutorial
Multiple selections
Debug stepping by physical line, statement, and block
Mark active range in editor for Python Shell and Debug Probe

For more information on what's new in Wing 5, see 
http://wingware.com/wingide/whatsnew


Free trial: http://wingware.com/wingide/trial
Downloads: http://wingware.com/downloads
Feature list: http://wingware.com/wingide/features
Sales: http://wingware.com/store/purchase
Upgrades: https://wingware.com/store/upgrade

Questions?  Don't hesitate to email us at supp...@wingware.com.

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com


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

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


Enterprise Data Warehouse Business Analyst in Banking domain Required for Qatar

2014-09-11 Thread vinirma2008
VAM SYSTEMS is a Business Consulting, IT Technology Solutions and Services 
company with operations in UAE, Qatar, Bahrain, USA, Australia, Singapore 
India.

VAM SYSTEMS is currently looking for Enterprise Data Warehouse Business Analyst 
for our Qatar operations with the following skill set and terms and conditions:

Skill Set required:

*   3-8 years in data warehousing environment 
*   Should have experience in Business Analyst.
*   Banking experience is mandatory. 
*   Knowledge of the design and implementation of the data warehouse life 
cycle
*   Experience in ETL design and Implementation
*   Good knowledge of data quality and data analysis
*   Exposed to IBM datastage tool
*   Used Data Modeller tool
*   Exposed to Oracle, MS SQL, ERWIN
*   Exposed to BI tools (Cognos BI 8.4 or 10.2)
Tasks
*   Design or Works with IBM data modeler representative on developing the 
Banking Data warehouse System of Record (SoR) and Data Marts (Analysis area).
*   Analyzes operational source systems, business processes, data files and 
data files structure to determine source systems and source files to be 
extracted and map accordingly source to target
*   Analyzes data gaps and impact on deliverables
*   Team player
*   Excellent communication skills
*   Handle all the documentation related to EDW from mapping to design 
documents.
Responsibility:
*   Issues and assess Risk, Error and Change requests in respective Forms
*   Develops deliverables; Business requirements documents, Mapping 
documents, business transformations rules documents, Data mart dimensions and 
facts, Reports dimensions and measures matrixes documents
*   Develops test strategy, plan, and test phases

Domain: Bank
Terms and conditions: 

Joining time frame: 2 weeks (maximum 1 month).

The selected candidates shall join VAM SYSTEMS - Qatar and shall be deputed to 
one of the leading Banks in Qatar.

Should you be interested in this opportunity, please send your latest resume in 
MS Word format at the earliest at ambili.krish...@vamsystems.com or call us +91 
476 2681150.







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


Re: recursive closure

2014-09-11 Thread Ian Kelly
On Wed, Sep 10, 2014 at 10:00 PM, Li Tianqing jaze...@163.com wrote:
 gc.set_debug(gc.DEBUG_LEAK)

The DEBUG_LEAK flag implies the DEBUG_SAVEALL flag, which causes all
unreachable objects to be appended to gc.garbage rather than freed.

https://docs.python.org/3/library/gc.html#gc.DEBUG_SAVEALL

Try not setting the flag, and I think you will find that gc.garbage no
longer accumulates.
-- 
https://mail.python.org/mailman/listinfo/python-list


ANN: Wing IDE 5.0.9 released

2014-09-11 Thread Wingware

Hi,

Wingware has released version 5.0.9 of Wing IDE, our cross-platform 
integrated development environment for the Python programming language.


Wing IDE includes a professional quality code editor with vi, emacs, 
visual studio, and other key bindings, auto-completion, call tips, 
goto-definition, find uses, refactoring, context-aware auto-editing, a 
powerful graphical debugger, version control, unit testing, search, and 
many other features.  For details see http://wingware.com/


Changes in this minor release include:

Ability to mark a range of code in the editor for easy reevaluation 
in the Python Shell or Debug Probe

Optimized multi-file searching
Improved goto-definition in the Python Shell and Debug Probe
Preliminary support for OS X 10.10 (Yosemite)
Several VI mode fixes
Improved visit history
Fixed crashing on some mako files
Recursively copy directories dragged and dropped in the Project tool
Fix problems with typing into block selections
About 24 other improvements; see the change log for details

For details see http://wingware.com/pub/wingide/5.0.9/CHANGELOG.txt

A summary of new features in Wing 5:

Native GUI on OS X and better overall OS-native look and feel
Draggable tools and editors
Configurable toolbar and editor  project context menus
Lockable editor splits and mode to open different files in each split
Sharable color palettes and syntax highlighting configurations
Auto-editing is on by default (except some operations that have a 
learning curve)
Optional Python Turbo completion (context-appropriate completion on 
all non-symbol keys)
Improved Source Assistant with PEP 287 docstring rendering and 
return types

Move debug program counter
Named file sets
New Project dialog
Sharable launch configurations and named entry points
Asynchronous I/O in Debug Probe and Python Shell
More control over unit testing environment
Initial preferences dialog for new users
Support for Python 3.4 and Stackless Python 2.7 and 3.3
Support for Django 1.6
Support for matplotlib on Anaconda and with MacOSX backend
Support for Maya 2015, MotionBuilder 2015, Nuke 8, and Source Filmmaker
Improved integrated and PDF documentation
Expanded and rewritten tutorial
Multiple selections
Debug stepping by physical line, statement, and block
Mark active range in editor for Python Shell and Debug Probe

For more information on what's new in Wing 5, see 
http://wingware.com/wingide/whatsnew


Free trial: http://wingware.com/wingide/trial
Downloads: http://wingware.com/downloads
Feature list: http://wingware.com/wingide/features
Sales: http://wingware.com/store/purchase
Upgrades: https://wingware.com/store/upgrade

Questions?  Don't hesitate to email us at supp...@wingware.com.

Thanks,

--

Stephan Deibel
Wingware | Python IDE

The Intelligent Development Environment for Python Programmers

wingware.com


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


Re: Newer Debian versions of python on older Debian distros?

2014-09-11 Thread Travis Griggs
On Sep 8, 2014, at 5:06 PM, Chris Angelico ros...@gmail.com wrote:

 Alternatively, you could just run Debian Jessie. I have a few Jessie
 systems on the network, with a Python 3.4 IIRC, and there've been no
 stability problems lately. Both options are pretty easy.

In the end, we were able to get jessie running on this little board (it’s an 
Atmel Xplained SAMA5D3 which boasts one of the lowest linux power 
consumptions). And that solved our problems.
-- 
https://mail.python.org/mailman/listinfo/python-list


Example of python service running under systemd?

2014-09-11 Thread Travis Griggs
I’ve been reading lots of systemd docs. And blogs. Etc. At this point, I think 
I would benefit from learning by example…

Does anyone have an example .service file that they use to launch a long 
running service written as a python program?

If there is any example of what you changed to your python program itself, that 
to would be really instructional for me.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Example of python service running under systemd?

2014-09-11 Thread Chris “Kwpolska” Warrick
On Thu, Sep 11, 2014 at 7:48 PM, Travis Griggs travisgri...@gmail.com wrote:
 I’ve been reading lots of systemd docs. And blogs. Etc. At this point, I 
 think I would benefit from learning by example…

 Does anyone have an example .service file that they use to launch a long 
 running service written as a python program?

 If there is any example of what you changed to your python program itself, 
 that to would be really instructional for me.
 --
 https://mail.python.org/mailman/listinfo/python-list

Depends what you want.  If you are running a Python web app, you can
use uWSGI Emperor, which plugs into systemd nicely and provides a
.service file in the docs (which also ships with the Arch Linux
package).  Otherwise, there are various ways, and this all depends on
how you structure this and your needs.  Use Type=simple and you won’t
need any changes to your program, or use one of the more magical
methods and implement them.  Describe your needs to get more details.
-- 
Chris “Kwpolska” Warrick http://chriswarrick.com/
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to create python web framework for ERP

2014-09-11 Thread Vimal Rughani
On Tuesday, 9 September 2014 13:55:24 UTC+5:30, Vimal Rughani  wrote:
 Hi All,
 
 
 
 Greetings !
 
 
 
 I am bit familiar with Django and Python. I want to create ERP on python. 
 Initially I feel Django will be good option for My Own ERP, but after working 
 bit on that I feel it doesn't fit with my requirement. So I decided to create 
 my own python based web framework for ERP. Can you please suggest me better 
 book / video / resources / content which help me to build proper web 
 framework for ERP.
 
 
 
 Thanks

Thanks to all for your kind support. I looking into different suggestions given 
by you. Thanks again for your time
-- 
https://mail.python.org/mailman/listinfo/python-list


Thread-ID - how much could be?

2014-09-11 Thread Ervin Hegedüs
Hello,

I've made a long-time running daemon, which uses threads. Looks
like that works perfectly, now I'm looking at the exceptions :).

In the log, I found an interesting message:

Exception in thread Thread-82:
...

The main function allows 2 thread to run simultaniously, and if
the thread finished, then it joined with th.join(), where the
th is the thread item, derived from threading.Thread class.

My question is: how much thread ID could be totally? Is there any
maximum number? And if the thread reached that, what will be
done? Overlflowed? Couting from 0 again?


Thanks,


a.


-- 
I � UTF-8
-- 
https://mail.python.org/mailman/listinfo/python-list


Problem Installing Python

2014-09-11 Thread osemen tosin
Hi there,

I tried installing Python and I could not continue without getting this error. 

There is a problem with this installer package. A DLL required for this 
install to complete could not be run. Contact your support personnel or vendor 
package.

Please I need your help.-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Thread-ID - how much could be?

2014-09-11 Thread Peter Otten
Ervin Hegedüs wrote:

 I've made a long-time running daemon, which uses threads. Looks
 like that works perfectly, now I'm looking at the exceptions :).
 
 In the log, I found an interesting message:
 
 Exception in thread Thread-82:
 ...
 
 The main function allows 2 thread to run simultaniously, and if
 the thread finished, then it joined with th.join(), where the
 th is the thread item, derived from threading.Thread class.
 
 My question is: how much thread ID could be totally? Is there any
 maximum number? And if the thread reached that, what will be
 done? Overlflowed? Couting from 0 again?

A quick peak into threading.py reveals

# Helper to generate new thread names
_counter = 0
def _newname(template=Thread-%d):
global _counter
_counter += 1
return template % _counter

class Thread:
...
def __init__(self, group=None, target=None, name=None,
 args=(), kwargs=None, *, daemon=None):
...
self._name = str(name or _newname())


There is no upper limit to the thread name other than that you will 
eventually run out of memory ;)


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


Re: Example of python service running under systemd?

2014-09-11 Thread Travis Griggs

On Sep 11, 2014, at 11:18 AM, Chris “Kwpolska” Warrick kwpol...@gmail.com 
wrote:

 Depends what you want. 

Mine is not a web service. My main.py looks like this:

#!/usr/bin/env python3

import cycle
import pushTelemetry
from threading import Thread

def main():
Thread(target=pushTelemetry.udpLoop).start()
Thread(target=cycle.cycleLoop).start()

if __name__ == '__main__':
main()

It basically creates two threads, one which does some local processing and 
control, the other which periodically does reporting via udp packets. I use the 
dual threads because they both work with a shared serial port at times, so I 
have to synchronize access through that.

What I want is to have this startup, after my board has it’s networking layer 
up and running (and hopefully a valid ip address by then), and to just keep 
running forever
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Example of python service running under systemd?

2014-09-11 Thread Ervin Hegedüs
Hi Travis,

On Thu, Sep 11, 2014 at 02:06:48PM -0700, Travis Griggs wrote:
 
 On Sep 11, 2014, at 11:18 AM, Chris “Kwpolska” Warrick kwpol...@gmail.com 
 wrote:
 
  Depends what you want. 
 
 Mine is not a web service. My main.py looks like this:
 
 #!/usr/bin/env python3
 
 import cycle
 import pushTelemetry
 from threading import Thread
 
 def main():
 Thread(target=pushTelemetry.udpLoop).start()
 Thread(target=cycle.cycleLoop).start()
 
 if __name__ == '__main__':
 main()
 
 It basically creates two threads, one which does some local processing and 
 control, the other which periodically does reporting via udp packets. I use 
 the dual threads because they both work with a shared serial port at times, 
 so I have to synchronize access through that.
 
 What I want is to have this startup, after my board has it’s networking layer 
 up and running (and hopefully a valid ip address by then), and to just keep 
 running forever

may be you think about the fork(), eg:

if __name__ == __main__:
...other codes, eg. drop root privileges, ...
...check arguments...
try:
  pid = os.fork()
  if pid  0:
  #print Daemon started (pid: %d) % (pid)
  sys.exit(0)
except OSError, e:
  print sys.stderr, fork #1 failed: %d (%s) % (e.errno, e.strerror)
  sys.exit(1)

os.chdir(/)
os.setsid()
os.umask(0)

# do second fork
try:
  pid = os.fork()
  if pid  0:
  #print Daemon started (pid: %d) % (pid)
  sys.exit(0)
except OSError, e:
  print sys.stderr, fork #2 failed: %d (%s) % (e.errno, e.strerror)
  sys.exit(1)

main()




regards,


a.

-- 
I � UTF-8
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Thread-ID - how much could be?

2014-09-11 Thread Ervin Hegedüs
Hi Peter,

thanks for the reply,

On Thu, Sep 11, 2014 at 09:48:18PM +0200, Peter Otten wrote:
 Ervin Hegedüs wrote:
 
  Exception in thread Thread-82:
  ...
  My question is: how much thread ID could be totally? Is there any
  maximum number? And if the thread reached that, what will be
  done? Overlflowed? Couting from 0 again?
 
 A quick peak into threading.py reveals
 
 # Helper to generate new thread names
 _counter = 0
 def _newname(template=Thread-%d):
 global _counter
 _counter += 1
 return template % _counter
 
 class Thread:
 ...
 def __init__(self, group=None, target=None, name=None,
  args=(), kwargs=None, *, daemon=None):
 ...
 self._name = str(name or _newname())
 
 
 There is no upper limit to the thread name other than that you will 
 eventually run out of memory ;)

thanks - I hope that the memory will not run out by these
threads... :)

Anyway, that means, on my system:

 import sys
 print sys.maxint
9223372036854775807

the couter could be 9223372036854775807?

And after? :)


Thanks,


a.



 

-- 
I � UTF-8
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Thread-ID - how much could be?

2014-09-11 Thread Peter Otten
Ervin Hegedüs wrote:

 Hi Peter,
 
 thanks for the reply,
 
 On Thu, Sep 11, 2014 at 09:48:18PM +0200, Peter Otten wrote:
 Ervin Hegedüs wrote:
 
  Exception in thread Thread-82:
  ...
  My question is: how much thread ID could be totally? Is there any
  maximum number? And if the thread reached that, what will be
  done? Overlflowed? Couting from 0 again?
 
 A quick peak into threading.py reveals
 
 # Helper to generate new thread names
 _counter = 0
 def _newname(template=Thread-%d):
 global _counter
 _counter += 1
 return template % _counter
 
 class Thread:
 ...
 def __init__(self, group=None, target=None, name=None,
  args=(), kwargs=None, *, daemon=None):
 ...
 self._name = str(name or _newname())
 
 
 There is no upper limit to the thread name other than that you will
 eventually run out of memory ;)
 
 thanks - I hope that the memory will not run out by these
 threads... :)
 
 Anyway, that means, on my system:
 
 import sys
 print sys.maxint
 9223372036854775807
 
 the couter could be 9223372036854775807?
 
 And after? :)

Try it!

 print sys.maxint + 1
9223372036854775808

When you start one thread per second

 sys.maxint / (60*60 * 24 * 365.25)
292271023045.3132

after less than 300 billion years the only thing that will change is the 
type:

 type(sys.maxint)
type 'int'
 type(sys.maxint + 1)
type 'long'


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


Re: Problem Installing Python

2014-09-11 Thread Emile van Sebille

On 9/11/2014 12:31 PM, osemen tosin wrote:

Hi there,

I tried installing Python and I could not continue without getting this
error.

There is a problem with this installer package. A DLL required for this
install to complete could not be run. Contact your support personnel or
vendor package.

Please I need your help.


Well, I suspect you're on windows, so I'd recommend you download and 
install the appropriate activestate distribution of python.  See


http://www.activestate.com/activepython/downloads

Emile


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


Re: Problem Installing Python

2014-09-11 Thread Terry Reedy

On 9/11/2014 3:31 PM, osemen tosin wrote:

Hi there,

I tried installing Python and I could not continue without getting this
error.

There is a problem with this installer package. A DLL required for this
install to complete could not be run. Contact your support personnel or
vendor package.


Which version of Windows?
Which version of Python?
Did you try re-downloading?
Are any versions already installed?
Do they run?
What *exactly* did you do?
What happened before the error occurred?
Did you run as admin or get the permission box?

--
Terry Jan Reedy

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


Re: Example of python service running under systemd?

2014-09-11 Thread Travis Griggs

On Sep 11, 2014, at 2:29 PM, Ervin Hegedüs airw...@gmail.com wrote:

 Hi Travis,
 
 On Thu, Sep 11, 2014 at 02:06:48PM -0700, Travis Griggs wrote:
 
 On Sep 11, 2014, at 11:18 AM, Chris “Kwpolska” Warrick kwpol...@gmail.com 
 wrote:
 
 Depends what you want. 
 
 Mine is not a web service. My main.py looks like this:
 
 #!/usr/bin/env python3
 
 import cycle
 import pushTelemetry
 from threading import Thread
 
 def main():
Thread(target=pushTelemetry.udpLoop).start()
Thread(target=cycle.cycleLoop).start()
 
 if __name__ == '__main__':
main()
 
 It basically creates two threads, one which does some local processing and 
 control, the other which periodically does reporting via udp packets. I use 
 the dual threads because they both work with a shared serial port at times, 
 so I have to synchronize access through that.
 
 What I want is to have this startup, after my board has it’s networking 
 layer up and running (and hopefully a valid ip address by then), and to just 
 keep running forever
 
 may be you think about the fork(), eg:
 
 if __name__ == __main__:
...other codes, eg. drop root privileges, ...
...check arguments...
try:
  pid = os.fork()
  if pid  0:
  #print Daemon started (pid: %d) % (pid)
  sys.exit(0)
except OSError, e:
  print sys.stderr, fork #1 failed: %d (%s) % (e.errno, e.strerror)
  sys.exit(1)
 
os.chdir(/)
os.setsid()
os.umask(0)
 
# do second fork
try:
  pid = os.fork()
  if pid  0:
  #print Daemon started (pid: %d) % (pid)
  sys.exit(0)
except OSError, e:
  print sys.stderr, fork #2 failed: %d (%s) % (e.errno, e.strerror)
  sys.exit(1)
 
main()

OK, I’m probably going to show my naivety about something simple here…

I thought a “fork” essentially created a memory copy of the original process 
and let it go off running. The problem is, in the bowels of the code executing 
in those loops, I access a single instance of a threading.RLock, so that I can 
avoid both threads trying to do transactions with a single serial port at the 
same time. If I end up with two copies of the base process, unhooked from their 
parent, does that RLock still remain valid between the two? I thought since 
they were complete different copies of the same memory, they would no longer be 
coordinated.

Is this a day where I discover something new?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Example of python service running under systemd?

2014-09-11 Thread Chris Angelico
On Fri, Sep 12, 2014 at 3:48 AM, Travis Griggs travisgri...@gmail.com wrote:
 I’ve been reading lots of systemd docs. And blogs. Etc. At this point, I 
 think I would benefit from learning by example…

 Does anyone have an example .service file that they use to launch a long 
 running service written as a python program?

 If there is any example of what you changed to your python program itself, 
 that to would be really instructional for me.

Yeah, I did that for the Yosemite Project:

https://github.com/Rosuav/Yosemite

The main program is Python, but all the systemd code comes from a Pike
script that creates a bash script that creates the systemd file. Yes,
that's a little convoluted... Here's the relevant shell script part,
in case you don't want to dig it out of auth.pike:


#!/bin/bash
[ $1 = install ]  [ -d /etc/systemd/system ]  {
echo [Unit]
Description=Yosemite Project

[Service]
# The user, path, and X display are derived at installation time
# from the attributes of the yos script. Reinstall to reset them.
Environment=DISPLAY=$DISPLAY
User=`stat -c %u $0`
ExecStart=`readlink -e $0`
# If the network isn't available yet, restart until it is.
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
 /etc/systemd/system/yos.service
# Note that some of this will fail if systemd is installed
# but isn't the default init system. In that case, well, you
# can't use this method of autostarting. TODO: Provide some
# other ways to autostart (eg for Upstart and/or sysvinit).
systemctl --system daemon-reload
systemctl enable yos.service
echo Installed as yos.service.
systemctl start yos.service
exit
}
# ... blah blah various setup
python Yosemite.py


This has some complications that you probably don't need, like that
the owner of the script should become the user that runs it (chances
are you can hard-code this, or run it as root and have it drop
privileges itself, or something), and it needs to restart on failure,
as it has to establish an sshfs mount before starting the main
program. But it's a start.

Note the three commands just before the script exits. Unlike sysvinit
and upstart, systemd needs to be told to reload service files, and
then you need to enable the service before it'll run on startup (and I
like to start it immediately, to see that it's working properly). Took
me a few hang-ups to figure that part out. Fortunately systemd can
notice and give a warning if you change files and don't daemon-reload
it; I'm not sure why it can't simply reload automatically (AIUI
Upstart uses inotify on /etc/init - no idea why systemd can't do the
same).

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


Re: Thread-ID - how much could be?

2014-09-11 Thread Steven D'Aprano
Ervin Hegedüs wrote:

[...]
  My question is: how much thread ID could be totally? Is there any
  maximum number? And if the thread reached that, what will be
  done? Overlflowed? Couting from 0 again?
[...]
 There is no upper limit to the thread name other than that you will
 eventually run out of memory ;)
 
 thanks - I hope that the memory will not run out by these
 threads... :)
 
 Anyway, that means, on my system:
 
 import sys
 print sys.maxint
 9223372036854775807
 
 the couter could be 9223372036854775807?
 
 And after? :)

Suppose you somehow managed to create 9223372036854775807 threads. If your
computer has 16 GB of RAM available, that means that at most each thread
can use:

py 16*1024*1024*1024/9223372036854775807
1.862645149230957e-09

bytes. That's not allowing any memory for the rest of your program, the
Python interpreter, other processes, or the operating system. That is less
than a single bit and clearly is impossible. You will run out of memory
*long* before reaching 9223372036854775807 threads running at once.

Suppose you don't have all the threads running at once, but you create and
destroy the threads as quickly as possible, so there is never more than one
thread alive at a time (plus the main interpreter thread). Suppose you have
an extremely fast computer that can create and destroy a billion threads
per second, one thread per nanosecond. Then your program would need to run
for:

py 9223372036854775807*1e-9/60/60/24/365
292.471208677536

years non-stop before reaching a count of sys.maxint. I know that some Linux
systems can have an uptime over a year, perhaps even two years, but I think
that nearly 300 years is asking a bit much. Your hardware probably won't
keep working that long.


-- 
Steven

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


Re: Thread-ID - how much could be?

2014-09-11 Thread Skip Montanaro
On Thu, Sep 11, 2014 at 8:29 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 Suppose you somehow managed to create 9223372036854775807 threads. If your
 computer has 16 GB of RAM available, that means that at most each thread
 can use:

 py 16*1024*1024*1024/9223372036854775807
 1.862645149230957e-09

 bytes.

Doesn't that calculation assume that they all have to be alive at the
same time? (Maybe I missed it in earlier posts, but I don't think the
OP indicated they'd have to all be active.)

That said, I think the OP should probably be worrying about other ways
his program could fail besides overflowing some nonexistent max thread
id. :-)

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


Re: Thread-ID - how much could be?

2014-09-11 Thread Chris Angelico
On Fri, Sep 12, 2014 at 11:29 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 I know that some Linux
 systems can have an uptime over a year, perhaps even two years, but I think
 that nearly 300 years is asking a bit much. Your hardware probably won't
 keep working that long.

I've had over two years of uptime. Currently looking at 85 wk 4d
02:11:28 since the UPS and power failed simultaneously, but before
that, over two years.

But what about a 32-bit build? You could blow 131 in about a month
of milliseconds, and I just tried, and on this 32-bit Windows box I
have here, I can start 10K threads in under a second:

 def test(n):
def f(): pass
start=time.time()
for i in range(n):
t=threading.Thread(target=f)
return (time.time()-start)/n
 test(1)
6.562459468841553e-05
 test(10)
6.906198978424073e-05

So if it's 7e-5 seconds per thread (65-69 microseconds), that'd be
less than two days to blow a 32-bit maxint. You could probably keep
even a Win 98 computer running that long!

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


Re: Example of python service running under systemd?

2014-09-11 Thread Michael Torrie
On 09/11/2014 03:29 PM, Ervin Hegedüs wrote:
 It basically creates two threads, one which does some local processing and 
 control, the other which periodically does reporting via udp packets. I use 
 the dual threads because they both work with a shared serial port at times, 
 so I have to synchronize access through that.

 What I want is to have this startup, after my board has it’s networking 
 layer up and running (and hopefully a valid ip address by then), and to just 
 keep running forever
 
 may be you think about the fork(), eg:

No, you you don't need to do this.  Systemd can handle all of that for
you.  Read up on the docs on creating systemd services.  Here's a little
blog post that has some good examples, both a non-daemonizing service
and a daemonizing service:

http://patrakov.blogspot.com/2011/01/writing-systemd-service-files.html

Any executable file can be turned into a daemon service with systemd
(whether or not it forks itself into the background).  Thus any python
script can easily be run from systemd.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Example of python service running under systemd?

2014-09-11 Thread Chris Angelico
On Fri, Sep 12, 2014 at 12:03 PM, Michael Torrie torr...@gmail.com wrote:
 No, you you don't need to do this.  Systemd can handle all of that for
 you.  Read up on the docs on creating systemd services.  Here's a little
 blog post that has some good examples, both a non-daemonizing service
 and a daemonizing service:

 http://patrakov.blogspot.com/2011/01/writing-systemd-service-files.html

 Any executable file can be turned into a daemon service with systemd
 (whether or not it forks itself into the background).  Thus any python
 script can easily be run from systemd.

I strongly recommend making a non-daemonizing service. It's so much
easier to debug - there's one mode of operation, the script just runs.
You can then run that directly in a terminal, or via tmux, or via
systemd - and I've done all three with Yosemite. In fact, I think I
have instances here on the LAN that are doing all three, right now!

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


Re: Example of python service running under systemd?

2014-09-11 Thread Michael Torrie
On 09/11/2014 08:29 PM, Chris Angelico wrote:
 On Fri, Sep 12, 2014 at 12:03 PM, Michael Torrie torr...@gmail.com wrote:
 No, you you don't need to do this.  Systemd can handle all of that for
 you.  Read up on the docs on creating systemd services.  Here's a little
 blog post that has some good examples, both a non-daemonizing service
 and a daemonizing service:

 http://patrakov.blogspot.com/2011/01/writing-systemd-service-files.html

 Any executable file can be turned into a daemon service with systemd
 (whether or not it forks itself into the background).  Thus any python
 script can easily be run from systemd.
 
 I strongly recommend making a non-daemonizing service. It's so much
 easier to debug - there's one mode of operation, the script just runs.
 You can then run that directly in a terminal, or via tmux, or via
 systemd - and I've done all three with Yosemite. In fact, I think I
 have instances here on the LAN that are doing all three, right now!

Agreed 100%.  If you want to run on a system without systemd, I
recommend using supervisord[1] for turning your program into a daemon.
It also does not require the app to fork.

[1] http://supervisord.org/
-- 
https://mail.python.org/mailman/listinfo/python-list


Why command os.popen works in python interactive mode but not in script debugger mode?

2014-09-11 Thread Viet Nguyen
Can anyone give me hint or reason why same command behaves differently in 
debugger mode from interactive mode:

From interactive mode:

 import os
 p = os.popen('date')
 p.read()
'Thu Sep 11 11:18:07 PDT 2014\n'

But from debugger mode in a script:
 import os
(Pdb) p = os.popen('date')
*** SyntaxError: SyntaxError('invalid syntax', ('string', 1, 1, = 
os.popen('date')))


Can anyone help me why there is syntax here?

Thanks,
Viet



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


Re: Why command os.popen works in python interactive mode but not in script debugger mode?

2014-09-11 Thread Chris Angelico
On Fri, Sep 12, 2014 at 3:15 PM, Viet Nguyen
vhnguy...@yahoo.com.dmarc.invalid wrote:
 But from debugger mode in a script:
 import os
 (Pdb) p = os.popen('date')
 *** SyntaxError: SyntaxError('invalid syntax', ('string', 1, 1, = 
 os.popen('date')))


 Can anyone help me why there is syntax here?


This is actually a command to the debugger. You say p
some_expression and it prints out the value of some_expression.

https://docs.python.org/2/library/pdb.html#debugger-commands

Commands that the debugger doesn’t recognize are assumed to be Python
statements and are executed in the context of the program being
debugged. Python statements can also be prefixed with an exclamation
point (!).


So try this:

!p = os.popen('date')

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


Re: Thread-ID - how much could be?

2014-09-11 Thread Cameron Simpson

On 12Sep2014 11:29, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 
wrote:

[...]maxint. I know that some Linux
systems can have an uptime over a year, perhaps even two years, but I think
that nearly 300 years is asking a bit much.


2 years is nothing. Unless they have a particularly buggy kernel, most UNIX 
systems, Linux included, will stay up almost indefinitely. We've definitely had 
systems up for well over 2 years.



Your hardware probably won't
keep working that long.


300 years? Probably not. Regrettably.

Cheers,
Cameron Simpson c...@zip.com.au

We need a taxonomy for 'printing-that-is-no-longer-printing.'
- overhead by WIRED at the Intelligent Printing conference Oct2006
--
https://mail.python.org/mailman/listinfo/python-list


Re: Thread-ID - how much could be?

2014-09-11 Thread Chris Angelico
On Fri, Sep 12, 2014 at 1:41 PM, Cameron Simpson c...@zip.com.au wrote:
 On 12Sep2014 11:29, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info
 wrote:

 [...]maxint. I know that some Linux
 systems can have an uptime over a year, perhaps even two years, but I
 think
 that nearly 300 years is asking a bit much.


 2 years is nothing. Unless they have a particularly buggy kernel, most UNIX
 systems, Linux included, will stay up almost indefinitely. We've definitely
 had systems up for well over 2 years.

 Your hardware probably won't
 keep working that long.


 300 years? Probably not. Regrettably.

Once you get into the counting of years (rather than days), it's all
down to hardware. How long before that hardware needs an upgrade? Does
your incoming power have fail-overs? I don't currently have any
servers with multiple power supplies, so if anything like that goes
bung, my server's down. Doesn't matter how quickly I can bring up an
equivalent on a different hunk of hardware, the uptime's gone.

But yeah. 300 years? Good luck. I don't think anyone's ever going to hit that.

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


pythonw.exe has stopped working

2014-09-11 Thread rahuldbhagat


Hello Folks,

I'm using RIDE -- Robot Framework Test Data Editor
RIDE 1.3 running on Python 2.7.6. 

When I click on some of my test case the RIDE GUI hangs and gives bellow error 
message.


[Window Title]
pythonw.exe

[Main Instruction]
pythonw.exe has stopped working

[Content]
A problem caused the program to stop working correctly. Windows will close the 
program and notify you if a solution is available.

[Close program]


It's strange that while it's able to open other test cases but fails on one 
particular test case. The distinguishing  fact about the test case is that it 
is a big one using lots of keywords.

I know it might work if I split my test case but have any of you encountered 
this problem and knows how to fix it ? some fix like providing more memory or 
specifying some parameter when pythonw.exe starts?


Thank you very much  in advance.

Cheers,

Rahul.

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


[issue22381] update zlib in 2.7 to 1.2.8

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3c343588f6a6 by doko in branch '2.7':
- Issue #22381: Update zlib to 1.2.8.
http://hg.python.org/cpython/rev/3c343588f6a6

--
nosy: +python-dev

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



[issue2943] Distutils should generate a better error message when the SDK is not installed

2014-09-11 Thread Piotr Dobrogost

Changes by Piotr Dobrogost p...@bugs.python.dobrogost.net:


--
nosy: +piotr.dobrogost

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



[issue22381] update zlib in 2.7 to 1.2.8

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 769126143656 by doko in branch '2.7':
- Issue #22381: Update zlib to 1.2.8.
http://hg.python.org/cpython/rev/769126143656

--

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



[issue9951] introduce bytes.hex method

2014-09-11 Thread Chris Lasher

Chris Lasher added the comment:

int has int.from_bytes and int.to_bytes.

Currently, bytes has bytes.fromhex. Would the core developers please consider 
naming the method bytes.tohex instead of bytes.hex, so there's at least a 
modicum of consistency in the method names of Python's builtin types?

--

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



[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread Ned Deily

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


--
nosy: +eric.smith

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



[issue22386] Python 3.4 logging.getLevelName() no longer maps string to level.

2014-09-11 Thread Ned Deily

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


--
nosy: +vinay.sajip

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



[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread Eric V. Smith

Eric V. Smith added the comment:

I think this would need to be implemented by adding bytes.__format__. I can't 
think of a way to make it work on bytes-like objects in general.

--

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



[issue16662] load_tests not invoked in package/__init__.py

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

The changeset d0ff527c53da5b925b61a8a70afc686ca6e05960 related to this issue 
introduced a regression in test_unittest. The test now fails on Windows. 
Example:

http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/5065/steps/test/logs/stdio


==
ERROR: test_discover_with_init_module_that_raises_SkipTest_on_import 
(unittest.test.test_discovery.TestDiscovery)
--
Traceback (most recent call last):
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\test\test_discovery.py,
 line 451, in test_discover_with_init_module_that_raises_SkipTest_on_import
suite = loader.discover('/foo')
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\loader.py, 
line 284, in discover
tests = list(self._find_tests(start_dir, pattern))
  File C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\loader.py, 
line 319, in _find_tests
paths = sorted(os.listdir(start_dir))
  File 
C:\buildbot.python.org\3.x.kloth-win64\build\lib\unittest\test\test_discovery.py,
 line 388, in list_dir
return list(vfs[path])
KeyError: 'C:\\foo'

--
nosy: +haypo
resolution: fixed - 
status: closed - open

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



[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

 .precision: chunks output, placing a space after every precision bytes

I dislike this option. There is already %.precisions in Python 2 and Python 
3 (and printf of the C language) which truncates the string.

If you need such special output, please write your own function.

--
nosy: +haypo

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



[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread Eric V. Smith

Eric V. Smith added the comment:

I'm not particularly wild about the .precision syntax either, but I think the 
feature is generally useful.

Adding bytes.__format__ is exactly what special output for bytes _is_, as far 
as format() is concerned.

Another option would be to invent a new format specification for bytes. There's 
no reason it needs to follow the same syntax as for str, int, etc., except for 
ease of remembering the syntax, and some code reuse.

For example, although it's insane, you could do:

format(b'abcdwxyz', 'use_spaces,grouping=4,add_prefix')
  - '0x61626364 0x7778797a'

--

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



[issue9951] introduce bytes.hex method

2014-09-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 11.09.2014 01:04, Nick Coghlan wrote:
 
 Nick Coghlan added the comment:
 
 Just as a recap of at least some of the *current* ways to do a bytes - hex 
 conversion:
 
 import codecs
 codecs.encode(babc, hex)
 b'616263'
 import binascii
 binascii.hexlify(babc)
 b'616263'
 import base64
 base64.b16encode(babc)
 b'616263'
 hex(int.from_bytes(babc, big))
 '0x616263'
 hex(int.from_bytes(babc, little))
 '0x636261'
 
 Thus, the underlying purpose of this proposal is to provide a single more 
 obvious way to do it. As per the recent discussion on python-ideas, the 
 point where that is most useful is in debugging output.
 
 However, rather than a new method on bytes/bytearray/memoryview for this, I 
 instead suggest it would be appropriate to extend the default handling of the 
 x and X format characters to accept arbitrary bytes-like objects. The 
 processing of these characters would be as follows:
 
 x: display a-f as lowercase digits
 X: display A-F as uppercase digits
 #: includes 0x prefix
 .precision: chunks output, placing a space after every precision bytes
 ,: uses a comma as the separator, rather than a space

Hmm, but those would then work for str.format() as well, right ?

Since x and X are already used to convert numbers to hex
representation, opening these up for bytes sounds like it could
easily mask TypeErrors for cases where you really want an integer
to be formatted as hex and not bytes.

--
nosy: +lemburg

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



[issue22379] Empty exception message of str.join

2014-09-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +pitrou

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



[issue21951] tcl test change crashes AIX

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee969a717cb5 by Serhiy Storchaka in branch '2.7':
Issue #21951: Use attemptckalloc() instead of ckalloc() in Tkinter.
http://hg.python.org/cpython/rev/ee969a717cb5

New changeset 1223c882253f by Serhiy Storchaka in branch '3.4':
Issue #21951: Use attemptckalloc() instead of ckalloc() in Tkinter.
http://hg.python.org/cpython/rev/1223c882253f

New changeset 499b60b7d067 by Serhiy Storchaka in branch 'default':
Issue #21951: Use attemptckalloc() instead of ckalloc() in Tkinter.
http://hg.python.org/cpython/rev/499b60b7d067

New changeset d6c7ab5a2065 by Serhiy Storchaka in branch '2.7':
Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
http://hg.python.org/cpython/rev/d6c7ab5a2065

New changeset 6a96c28f9474 by Serhiy Storchaka in branch '3.4':
Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
http://hg.python.org/cpython/rev/6a96c28f9474

New changeset 7b7bae546959 by Serhiy Storchaka in branch 'default':
Issue #21951: Fixed a crash in Tkinter on AIX when called Tcl command with
http://hg.python.org/cpython/rev/7b7bae546959

--

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



[issue22387] Making tempfile.NamedTemporaryFile a class

2014-09-11 Thread Antony Lee

New submission from Antony Lee:

Currently, tempfile.TemporaryFile and tempfile.NamedTemporaryFile are 
functions, not classes, despite what their names suggest, preventing 
subclassing.  It would arguably be not so easy to make TemporaryFile a class, 
as its return value is whatever _io.open returns, which can be of various 
types, but NamedTemporaryFile can trivially converted into a class by reusing 
the body of _TemporaryFileWrapper (which is not used elsewhere).

--
components: Library (Lib)
messages: 226752
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Making tempfile.NamedTemporaryFile a class
versions: Python 3.5

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is updated patch which is synchronized with the tip after changes made in 
issue21951 and addresses my comments.

--
Added file: http://bugs.python.org/file36596/tkinter_pymem_2.patch

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



[issue21951] tcl test change crashes AIX

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Committed these two changes as separate patches.

--
stage: patch review - commit review

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



[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-09-11 Thread Martin Panter

Martin Panter added the comment:

Fair enough, challenge accepted! Here is my attempt. I have explicitly made the 
info(), geturl() and getcode() methods available for all cases, and used 
Evens’s wording for the modified “msg” attribute, but dropped mentioning the 
“url” attribute.

--
Added file: http://bugs.python.org/file36597/addinfourl-first.patch

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



[issue22387] Making tempfile.NamedTemporaryFile a class

2014-09-11 Thread Eric V. Smith

Eric V. Smith added the comment:

Can you explain why you want to subclass them?

--
nosy: +eric.smith
type:  - enhancement

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



[issue13968] Support recursive globs

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ff4b9d654691 by Serhiy Storchaka in branch 'default':
Issue #13968: The glob module now supports recursive search in
http://hg.python.org/cpython/rev/ff4b9d654691

--
nosy: +python-dev

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



[issue22387] Making tempfile.NamedTemporaryFile a class

2014-09-11 Thread Antony Lee

Antony Lee added the comment:

The initial idea was to solve #14243 (NamedTemporaryFile would be more useful 
on Windows if you could close it without deleting) by adding a closed keyword 
argument to the constructor of a subclass, that would set delete to False and 
then close it, e.g.

class NTF(NamedTemporaryFile):
def __init__(self, *args, closed=False, **kwargs):
if closed: kwargs[delete] = True
super().__init__(*args, **kwargs)
if closed: self.close()

Actually, there are some not-so-nice interactions with the context-manager 
protocol though, as the file cannot be reopened.  So it's not clear that this 
is such a good idea.

Still, it somewhat confusing that a CamelCase object is not actually a type 
(especially when TemporaryDirectory is one).

--

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



[issue13968] Support recursive globs

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Nick.

--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue22385] Allow 'x' and 'X' to accept bytes-like objects in string formatting

2014-09-11 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue21147] sqlite3 doesn't complain if the request contains a null character

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 430865e9ea9f by Serhiy Storchaka in branch '2.7':
Issue #21147: sqlite3 now raises an exception if the request contains a null
http://hg.python.org/cpython/rev/430865e9ea9f

New changeset 517f216d45ea by Serhiy Storchaka in branch '3.4':
Issue #21147: sqlite3 now raises an exception if the request contains a null
http://hg.python.org/cpython/rev/517f216d45ea

New changeset b81f5652c2d7 by Serhiy Storchaka in branch 'default':
Issue #21147: sqlite3 now raises an exception if the request contains a null
http://hg.python.org/cpython/rev/b81f5652c2d7

--
nosy: +python-dev

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



[issue13968] Support recursive globs

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

The test failed on a buildbot, I reopen the issue.

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/10607/steps/test/logs/stdio

==
FAIL: test_selflink (test.test_glob.SymlinkLoopGlobTests)
--
Traceback (most recent call last):
  File /srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_glob.py, 
line 284, in test_selflink
self.assertIn(path, results)
AssertionError: 
'@test_23056_tmp_dir/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/link/file'
 not found in {'noodly2', '@test_23056_tmp-\udcff.py', '__pycache__'}

--
nosy: +haypo
resolution: fixed - 
status: closed - open

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



[issue21951] tcl test change crashes AIX

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

 Committed these two changes as separate patches.

Thanks, it's clearer like that.

--

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



[issue21951] tcl test change crashes AIX

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

test_tcl now pass on AIX:
http://buildbot.python.org/all/builders/PPC64%20AIX%203.x/builds/2592/steps/test/logs/stdio

Thanks Serhiy for the fix.

--
resolution:  - fixed
status: open - closed

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

I read tkinter_pymem_2.patch.

Remaining calls to ckalloc():

* they are only used to allocate events passed later to Tcl_ThreadQueueEvent(). 
Tcl_ThreadQueueEvent doc explicitly says that the memory must be allocated by 
Tcl_Alloc or ckalloc, so it's correct (PyMem cannot be used).

Remaining calls to ckfree():

* Tkapp_SplitList() calls ckfree() on memory allocated by Tcl_SplitList(), it's 
correct.

* Tkapp_CallDeallocArgs() ckfree() on memory allocated by PyMem_Malloc() = 
wrong (see my review on Rietveld).

--

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



[issue21951] tcl test change crashes AIX

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Victor for great investigation of this issue.

--

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



[issue22387] Making tempfile.NamedTemporaryFile a class

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You can do this with a function too:

def NTF(*args, closed=False, **kwargs):
if closed: kwargs[delete] = True
ntf = NamedTemporaryFile(*args, **kwargs)
if closed: ntf.close()
return ntf

--
nosy: +georg.brandl, ncoghlan, serhiy.storchaka

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



[issue22388] Unify style of Contributed by notes

2014-09-11 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Here is a patch which converts Contributed by notes in whatsnews to most 
prevalent style. This means:

* Previous sentence ends by a period and the Contributed is titled.
* The note ends by a period and it is placed before closing parent.
* The note is separated from previous sentence by two spaces or newline (as any 
sentences).

Overwhelming majority of Contributed by notes are written in this style 
(except of unfinished 3.5 whatsnews).

--
assignee: docs@python
components: Documentation
files: doc_contributed_by_style.patch
keywords: patch
messages: 226767
nosy: docs@python, r.david.murray, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Unify style of Contributed by notes
type: enhancement
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36598/doc_contributed_by_style.patch

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



[issue13968] Support recursive globs

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 180f5bf7d1b9 by Serhiy Storchaka in branch 'default':
Issue #13968: Fixed newly added recursive glob test.
http://hg.python.org/cpython/rev/180f5bf7d1b9

--

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



[issue13968] Support recursive globs

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Victor. The test was failed also when run it directly, omitting the 
test.regrtest module (which run a test inside temporary directory):

./python Lib/test/test_glob.py

Now it is fixed.

However perhaps we should consider as a bug if a test ran by regrtest doesn't 
clean created files or directories ('noodly2', '@test_23056_tmp-\udcff.py', and 
'__pycache__' are created by some previous tests).

--

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



[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-09-11 Thread Evens Fortuné

Evens Fortuné added the comment:

I'm satisfied with this new patch.

--

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 * Tkapp_CallDeallocArgs() ckfree() on memory allocated by PyMem_Malloc() =
 wrong 

Oh, you are right, thanks.

 (see my review on Rietveld).

Perhaps you forgot to press the Publish button.

--
Added file: http://bugs.python.org/file36599/tkinter_pymem_3.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22336
___diff -r 180f5bf7d1b9 Modules/_tkinter.c
--- a/Modules/_tkinter.cThu Sep 11 14:33:02 2014 +0300
+++ b/Modules/_tkinter.cThu Sep 11 15:49:49 2014 +0300
@@ -605,7 +605,7 @@
 Tcl_SetVar(v-interp, tcl_interactive, 0, TCL_GLOBAL_ONLY);
 
 /* This is used to get the application class for Tk 4.1 and up */
-argv0 = (char*)attemptckalloc(strlen(className) + 1);
+argv0 = (char*)PyMem_Malloc(strlen(className) + 1);
 if (!argv0) {
 PyErr_NoMemory();
 Py_DECREF(v);
@@ -616,7 +616,7 @@
 if (Py_ISUPPER(Py_CHARMASK(argv0[0])))
 argv0[0] = Py_TOLOWER(Py_CHARMASK(argv0[0]));
 Tcl_SetVar(v-interp, argv0, argv0, TCL_GLOBAL_ONLY);
-ckfree(argv0);
+PyMem_Free(argv0);
 
 if (! wantTk) {
 Tcl_SetVar(v-interp,
@@ -639,7 +639,7 @@
 if (use)
 len += strlen(use) + sizeof -use ;
 
-args = (char*)attemptckalloc(len);
+args = (char*)PyMem_Malloc(len);
 if (!args) {
 PyErr_NoMemory();
 Py_DECREF(v);
@@ -657,7 +657,7 @@
 }
 
 Tcl_SetVar(v-interp, argv, args, TCL_GLOBAL_ONLY);
-ckfree(args);
+PyMem_Free(args);
 }
 
 if (Tcl_AppInit(v-interp) != TCL_OK) {
@@ -914,15 +914,15 @@
list is too long);
 return NULL;
 }
-argv = (Tcl_Obj **) attemptckalloc(((size_t)size) * sizeof(Tcl_Obj *));
-if(!argv) {
+argv = (Tcl_Obj **) PyMem_Malloc(((size_t)size) * sizeof(Tcl_Obj *));
+if (!argv) {
   PyErr_NoMemory();
   return NULL;
 }
 for (i = 0; i  size; i++)
   argv[i] = AsObj(PySequence_Fast_GET_ITEM(value,i));
 result = Tcl_NewListObj(size, argv);
-ckfree(FREECAST argv);
+PyMem_Free(argv);
 return result;
 }
 else if (PyUnicode_Check(value)) {
@@ -948,7 +948,7 @@
 if (kind == sizeof(Tcl_UniChar))
 return Tcl_NewUnicodeObj(inbuf, size);
 allocsize = ((size_t)size) * sizeof(Tcl_UniChar);
-outbuf = (Tcl_UniChar*)attemptckalloc(allocsize);
+outbuf = (Tcl_UniChar*)PyMem_Malloc(allocsize);
 /* Else overflow occurred, and we take the next exit */
 if (!outbuf) {
 PyErr_NoMemory();
@@ -965,14 +965,14 @@
  character U+%x is above the range 
  (U+-U+) allowed by Tcl,
  ch);
-ckfree(FREECAST outbuf);
+PyMem_Free(outbuf);
 return NULL;
 }
 #endif
 outbuf[i] = ch;
 }
 result = Tcl_NewUnicodeObj(outbuf, size);
-ckfree(FREECAST outbuf);
+PyMem_Free(outbuf);
 return result;
 }
 else if(PyTclObject_Check(value)) {
@@ -1084,7 +1084,7 @@
 for (i = 0; i  objc; i++)
 Tcl_DecrRefCount(objv[i]);
 if (objv != objStore)
-ckfree(FREECAST objv);
+PyMem_Free(objv);
 }
 
 /* Convert Python objects to Tcl objects. This must happen in the
@@ -1115,7 +1115,7 @@
   list is too long);
 return NULL;
 }
-objv = (Tcl_Obj **)attemptckalloc(((size_t)objc) * sizeof(Tcl_Obj 
*));
+objv = (Tcl_Obj **)PyMem_Malloc(((size_t)objc) * sizeof(Tcl_Obj 
*));
 if (objv == NULL) {
 PyErr_NoMemory();
 objc = 0;
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22384] Tk.report_callback_exception kills process when run with pythonw.exe

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be this patch would help.

--
assignee:  - serhiy.storchaka
keywords: +patch
nosy: +serhiy.storchaka
stage:  - patch review
type: crash - behavior
versions: +Python 2.7, Python 3.5
Added file: 
http://bugs.python.org/file36600/tkinter_report_callback_exception.patch

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



[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-09-11 Thread Larry Hastings

Larry Hastings added the comment:

Ping?

--

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



[issue22389] Generalize contextlib.redirect_stdout

2014-09-11 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

redirect_stdout is almost exactly what I want, except I want to redirect 
stderr!  redirect_stdout.__init__() should take a 'stream_name' argument 
(possibly keyword-only) which could be set to 'stderr'.  I propose it's 
implemented as setattr(sys, stream_name, new_target)

--
components: Library (Lib)
messages: 226774
nosy: barry
priority: normal
severity: normal
status: open
title: Generalize contextlib.redirect_stdout
versions: Python 3.5

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



[issue22389] Generalize contextlib.redirect_stdout

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

Why not adding a new redirect_stderr() function?

--
nosy: +haypo

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



[issue22389] Generalize contextlib.redirect_stdout

2014-09-11 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 11, 2014, at 02:25 PM, STINNER Victor wrote:

Why not adding a new redirect_stderr() function?

With a little refactoring redirect_stdout into a subclass, that would work
too.

--

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-11 Thread STINNER Victor

New submission from STINNER Victor:

A change in test_glob of issue #13968 started to fail because a previous test 
created temporary files but didn't remove them.

test.regrtest should at least emit a warning if the temporary directory used to 
run tests is not empty before removing it.

--
components: Tests
messages: 226777
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test.regrtest should complain if a test doesn't remove temporary files
versions: Python 3.5

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



[issue13968] Support recursive globs

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

 However perhaps we should consider as a bug if a test ran by regrtest doesn't 
 clean created files or directories

= yes, I opened the issue #22390.

--

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

tkinter_pymem_3.patch looks good to me.

--

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



[issue22382] sqlite3 connection built from apsw connection should raise IntegrityError, not DatabaseError

2014-09-11 Thread william tonkin

william tonkin added the comment:

sqlite3 allows a connection to be built from an apsw.Connection().  Using an 
apsw.Connection() to build an sqlite3.connect() implies that the underlying 
sqlite database engine will have extended error codes turned on (the default if 
for them to be turned off.)

The problem is that Modules/_sqlite/util.c:_pysqlite_seterror() is not extended 
error code aware.  In particular, the extended error code 
SQLITE_CONSTRAINT_CHECK will not be recognized as a kind of constraint 
violation and will fall into the default: arm of the case statement.  This 
will result in raising the exception DatabaseError when the correct exception 
to raise is IntegrityError.

One simple solution would be to convert the extended error code back to the 
base error code, that is:
 errorcode = 0xffu % sqlite3_errcode(db);

--
status: closed - open
type:  - behavior

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



[issue21199] Python on 64-bit Windows uses signed 32-bit type for read length

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I added comments to test on Rietveld.

--
nosy: +serhiy.storchaka

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And to me too. Please commit it, this is mainly your patch.

--

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



[issue22387] Making tempfile.NamedTemporaryFile a class

2014-09-11 Thread Antony Lee

Antony Lee added the comment:

Yes, but this will make the context-manager approach (with 
NamedTemporaryFile(closed=True): do stuff) unusable, because the underlying 
file object will be closed before calling __enter__.  I think the only 
reasonable way to implement this would be to have __enter__ return the file 
name (as for TemporaryDirectory), instead of the file object (which is 
reasonable because if I pass closed=True, it probably means all I care is that 
a file exists here for some other process to use!).
But, with the function approach, I cannot override __enter__.

--

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9f1d3e6e6ce6 by Victor Stinner in branch 'default':
Closes #22336: attemptckalloc() with PyMem_Malloc() in _tkinter
http://hg.python.org/cpython/rev/9f1d3e6e6ce6

--
nosy: +python-dev
resolution:  - fixed
stage:  - resolved
status: open - closed

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



[issue22336] _tkinter should use Python PyMem_Malloc() instead of Tcl ckalloc()

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

 And to me too. Please commit it, this is mainly your patch.

Ok, thanks, done.

--

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch. It warns if new files or directories are left after test run 
in current directory and removes those of them which starts with TESTFN (i.e. 
TESTFN_UNICODE, TESTFN + 2, TESTFN + .py and other names used in tests).

--
keywords: +patch
nosy: +ezio.melotti, michael.foord, pitrou
stage:  - patch review
type:  - enhancement
versions: +Python 2.7, Python 3.4
Added file: http://bugs.python.org/file36601/regrtest_warn_lost_files.patch

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

I would prefer to fix tests instead of trying to remove arbitrary files. I'm 
not sure that fn.startswith(support.TESTFN) check is safe enough.

Maybe we should not remove TESTFN neither. You are supposed to be able to run 
tests without regrtest.

--

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-11 Thread STINNER Victor

STINNER Victor added the comment:

I ran the test suite with the patch applied:

7 tests altered the execution environment:
test_imp test_import test_pdb test_posix test_source_encoding
test_support test_threaded_import

I will try to investigate these warnings.

--

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



[issue22391] MSILIB truncates last character in summary information stream

2014-09-11 Thread Kevin Phillips

New submission from Kevin Phillips:

I recently exploited a subtle bug with the msilib module's GetProperty method 
on the SummaryInformation class. When retrieving string-typed properties from 
the stream the last character in the string gets truncated, replaced by a 
null-byte.

I am using Python v3.2.5 64bit on Windows 7, and I've managed to reproduce the 
error with the following code snippet:

filename = sample.msp
patch_database = msilib.OpenDatabase(filename, msilib.MSIDBOPEN_READONLY | 
msilib.MSIDBOPEN_PATCHFILE)
summary_info = patch_database.GetSummaryInformation(20)
print (summary_info.GetProperty(msilib.PID_REVNUMBER))

The PID_REVNUMBER returns the patch-GUID for the Windows Installer patch file. 
In this example the GUID is returned properly however the character string is 
supposed to be delimited by curly braces - { }. Examination of the returned 
byte array shows that the leading curly brace is included by the final curly 
brace is not. Closer examination also shows that the last character in the byte 
array is \x00.

While it is possible, in this situation, to circumvent the bug by simply 
removing the trailing bytes and replacing them with a closing curly brace, this 
may not be so easy to work around for general character strings if the last 
character in the sequence is not static. As such I'd highly recommend fixing 
this in the source for the msilib module.

--
components: Library (Lib), Windows
messages: 226789
nosy: Kevin.Phillips
priority: normal
severity: normal
status: open
title: MSILIB truncates last character in summary information stream
type: behavior
versions: Python 3.2

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



[issue22364] Unify error messages of re and regex

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 By the way, which is preferred, cannot or can't? The regex module always
 uses can't, but re module uses cannot except for TypeError: can't use
 a bytes pattern on a string-like object, I think.

It's interesting question. Grepping in CPython sources got results:

Cannot  210
cannot  865
Can't   216
can't   796

Lowercase wins uppercase with score 4:1 and short and long forms are 
equivalent.

I left the decision to English speakers.

 Also, you said that one of the re module's messages was better, but didn't
 say which! Did you mean this one?
  re:expected bytes, bytearray, or an object with the buffer interface,
  str found
  regex: expected bytes instance, str found

Both are not good. re variant is too verbose, but it is more correct.

May be 6, 7, 8, 10, 11, 16, 18 are better in re.

--

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



[issue22391] MSILIB truncates last character in summary information stream

2014-09-11 Thread Kevin Phillips

Kevin Phillips added the comment:

I should mention that I did discover some source code on GitHub, presumably for 
this wrapper module, and I believe I found a few questionable parts in the 
logic for this library that may help explain the cause of this problem:

https://github.com/python-git/python/blob/master/PC/_msi.c

Here are some snippets from the summary_getproperty function that may help:

char sbuf[1000];
char *sval = sbuf;
DWORD ssize = sizeof(sval);

First, here, I believe the ssize value is not going to be initialized as one 
would expect at first glance. Since sval is a pointer and sizeof() returns the 
size of it's parameter, in this case a pointer, ssize will represent the 
pointer size on the target platform. In this case, on a 64bit OS, it's likely 
going to be set to 8, which I suspect the expected value for ssize is going to 
be 1000 - the size of the static array sbuff.

status = MsiSummaryInfoGetProperty(si-h, field, type, ival, 
fval, sval, ssize);
if (status == ERROR_MORE_DATA) {
sval = malloc(ssize);
status = MsiSummaryInfoGetProperty(si-h, field, type, ival, 
fval, sval, ssize);
}

Now, in this snippet it tries to load the string value from the file, and if 
the input buffer is not of sufficient size it reallocates the pointer to an 
appropriate size. Given the fact that ssize is probably initialized to 8 (or 
less) it is pretty safe to assume the first call to MsiSummaryInfoGetProperty 
changes this value to the length of the data stored in the file. Closer 
examination of the documentation for this Windows API function reveals that in 
this case ssize will be set to the number of characters required 'not including 
the terminating null character'. 
(http://msdn.microsoft.com/en-us/library/aa370409(v=vs.85).aspx)

result = PyString_FromStringAndSize(sval, ssize);

Then finally I noticed this function call. I suspect the problem may lie here. 
I'm not too familiar with the Python SDK but it sounds like when using Unicode 
strings - as all string are in Python 3 - you are supposed to use 
PyUnicode_FromStringAndSize instead. So perhaps there might be something 
getting lost in the translation, either via the use of this function or perhaps 
subsequent marshalling of the string object into the Python runtime, due to the 
encoding changes... not sure. It could be something as simple as one of the 
function calls used therein assume that the 'size' count includes a null-byte 
while others don't. It's hard to say without digging into the libs some more.

I hope this helps.

--

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I would prefer to fix tests instead of trying to remove arbitrary files. I'm
 not sure that fn.startswith(support.TESTFN) check is safe enough.

This allow other tests which leaks the same file to be reported too.

support.TESTFN contains process ID so it is unique enough.

--

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 I will try to investigate these warnings.

Run tests with the -vv option.

--

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



[issue9205] Parent process hanging in multiprocessing if children terminate unexpectedly

2014-09-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

You should certainly create a new issue!

--

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



[issue22391] MSILIB truncates last character in summary information stream

2014-09-11 Thread Mark Lawrence

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


--
nosy: +steve.dower, tim.golden, zach.ware

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



[issue13968] Support recursive globs

2014-09-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
status: open - closed

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



[issue21147] sqlite3 doesn't complain if the request contains a null character

2014-09-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
resolution:  - fixed
stage: patch review - resolved
status: open - closed

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



[issue22386] Python 3.4 logging.getLevelName() no longer maps string to level.

2014-09-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +larry
priority: normal - release blocker
versions: +Python 3.5

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



[issue22392] Clarify documentation of __getinitargs__

2014-09-11 Thread David Gilman

New submission from David Gilman:

Implementations of __getinitargs__ return a tuple of the positional arguments 
for __init__.   This wasn't initially apparent to me after reading the docs: I 
thought you were passing a tuple (args, kwargs) that would get called f(*args, 
**kwargs) and had to go to the pickle implementation to find out what you were 
supposed to do.

The proposed documentation enhancement: mention that you're just supposed to 
return a tuple of positional args and that it doesn't support kwargs.

--
assignee: docs@python
components: Documentation
messages: 226795
nosy: David.Gilman, docs@python
priority: normal
severity: normal
status: open
title: Clarify documentation of __getinitargs__
type: enhancement
versions: Python 2.7

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 Really, the test for whether to keep or remove the prefix should be to 
 remove the prefix and try and resolve the path again. If it succeeds, 
 remove the prefix; otherwise, keep it. This can only really be done as 
 part of the resolve() call, which would address the original issue,
 but it may be quite a perf. hit. 

It would also be prone to race conditions. All in all it sounds like a bad idea.
I still think it should be asked for explicitly. I don't know how the method 
should be called, .extended() perhaps?

--

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



[issue22359] Remove incorrect uses of recursive make

2014-09-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Martin, Matthias, do you think this would break any legitimate use?

--
nosy: +loewis, pitrou
stage:  - patch review
type: compile error - behavior

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



[issue22362] Warn about octal escapes 0o377 in re

2014-09-11 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think we should simply raise ValueError in 3.5. There's no reason to accept 
such invalid escapes.

--

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



[issue22299] resolve() on Windows makes some pathological paths unusable

2014-09-11 Thread Steve Dower

Steve Dower added the comment:

Another alternative is to always leave the prefix there after calling resolve() 
(as opposed to the current behaviour which is to always remove it). If the 
Win32 API says that the path should include the prefix, then it should. There's 
no reliable way for a developer to decide that an arbitrary path should include 
the prefix other than by resolving it.

I still like the idea of a format character to omit the prefix, as that 
correctly implies that the only reason you should remove it is for displaying 
to the user. Alternatively, a .without_prefix property seems like a safer 
route than requiring the user to add it. Long paths are the only time you may 
want to add it, but even that doesn't guarantee that the path will work.

--

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



[issue22391] MSILIB truncates last character in summary information stream

2014-09-11 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis

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



[issue22382] sqlite3 connection built from apsw connection should raise IntegrityError, not DatabaseError

2014-09-11 Thread william tonkin

william tonkin added the comment:

The following worked for me:


--- util.c  2014-09-11 15:15:11.480266548 -0400
+++ util.c.fixed2014-09-11 15:17:19.214878592 -0400
@@ -54,7 +54,7 @@
 (void)sqlite3_reset(st);
 }

-errorcode = sqlite3_errcode(db);
+errorcode = 0xffu  sqlite3_errcode(db);

 switch (errorcode)
 {

--

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



[issue22362] Warn about octal escapes 0o377 in re

2014-09-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Well, here is a patch which makes re raise an exception on suspicious octals.

--
Added file: 
http://bugs.python.org/file36602/re_octal_escape_overflow_raise.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22362
___diff -r 180f5bf7d1b9 Lib/sre_parse.py
--- a/Lib/sre_parse.py  Thu Sep 11 14:33:02 2014 +0300
+++ b/Lib/sre_parse.py  Thu Sep 11 23:31:31 2014 +0300
@@ -283,7 +283,11 @@ def _class_escape(source, escape):
 elif c in OCTDIGITS:
 # octal escape (up to three digits)
 escape += source.getwhile(2, OCTDIGITS)
-return LITERAL, int(escape[1:], 8)  0xff
+c = int(escape[1:], 8)
+if c  0o377:
+raise error('octal escape value %r outside of '
+'range 0-0o377' % escape)
+return LITERAL, c
 elif c in DIGITS:
 raise ValueError
 if len(escape) == 2:
@@ -325,7 +329,7 @@ def _escape(source, escape, state):
 elif c == 0:
 # octal escape
 escape += source.getwhile(2, OCTDIGITS)
-return LITERAL, int(escape[1:], 8)  0xff
+return LITERAL, int(escape[1:], 8)
 elif c in DIGITS:
 # octal escape *or* decimal group reference (sigh)
 if source.next in DIGITS:
@@ -334,7 +338,11 @@ def _escape(source, escape, state):
 source.next in OCTDIGITS):
 # got three octal digits; this is an octal escape
 escape = escape + source.get()
-return LITERAL, int(escape[1:], 8)  0xff
+c = int(escape[1:], 8)
+if c  0o377:
+raise error('octal escape value %r outside of '
+'range 0-0o377' % escape)
+return LITERAL, c
 # not an octal escape, so this is a group reference
 group = int(escape[1:])
 if group  state.groups:
@@ -825,7 +833,11 @@ def parse_template(source, pattern):
 s.next in OCTDIGITS):
 this += sget()
 isoctal = True
-lappend(chr(int(this[1:], 8)  0xff))
+c = int(this[1:], 8)
+if c  0o377:
+raise error('octal escape value %r outside of '
+'range 0-0o377' % this)
+lappend(chr(c))
 if not isoctal:
 addgroup(int(this[1:]))
 else:
diff -r 180f5bf7d1b9 Lib/test/test_re.py
--- a/Lib/test/test_re.py   Thu Sep 11 14:33:02 2014 +0300
+++ b/Lib/test/test_re.py   Thu Sep 11 23:31:31 2014 +0300
@@ -154,8 +154,8 @@ class ReTests(unittest.TestCase):
 self.assertEqual(re.sub('x', r'\09', 'x'), '\0' + '9')
 self.assertEqual(re.sub('x', r'\0a', 'x'), '\0' + 'a')
 
-self.assertEqual(re.sub('x', r'\400', 'x'), '\0')
-self.assertEqual(re.sub('x', r'\777', 'x'), '\377')
+self.assertRaises(re.error, re.sub, 'x', r'\400', 'x')
+self.assertRaises(re.error, re.sub, 'x', r'\777', 'x')
 
 self.assertRaises(re.error, re.sub, 'x', r'\1', 'x')
 self.assertRaises(re.error, re.sub, 'x', r'\8', 'x')
@@ -691,7 +691,7 @@ class ReTests(unittest.TestCase):
 self.assertIsNotNone(re.match(r\08, \0008))
 self.assertIsNotNone(re.match(r\01, \001))
 self.assertIsNotNone(re.match(r\018, \0018))
-self.assertIsNotNone(re.match(r\567, chr(0o167)))
+self.assertRaises(re.error, re.match, r\567, )
 self.assertRaises(re.error, re.match, r\911, )
 self.assertRaises(re.error, re.match, r\x1, )
 self.assertRaises(re.error, re.match, r\x1z, )
@@ -719,6 +719,7 @@ class ReTests(unittest.TestCase):
 self.assertIsNotNone(re.match(r[\U%08x] % i, chr(i)))
 self.assertIsNotNone(re.match(r[\U%08x0] % i, chr(i)+0))
 self.assertIsNotNone(re.match(r[\U%08xz] % i, chr(i)+z))
+self.assertRaises(re.error, re.match, r[\567], )
 self.assertIsNotNone(re.match(r[\U0001d49c-\U0001d4b5], 
\U0001d49e))
 self.assertRaises(re.error, re.match, r[\911], )
 self.assertRaises(re.error, re.match, r[\x1z], )
@@ -740,7 +741,7 @@ class ReTests(unittest.TestCase):
 self.assertIsNotNone(re.match(br\08, b\0008))
 self.assertIsNotNone(re.match(br\01, b\001))
 self.assertIsNotNone(re.match(br\018, b\0018))
-self.assertIsNotNone(re.match(br\567, bytes([0o167])))
+self.assertRaises(re.error, re.match, br\567, b)
 self.assertRaises(re.error, re.match, br\911, b)
 self.assertRaises(re.error, re.match, br\x1, b)
 self.assertRaises(re.error, re.match, br\x1z, b)
@@ -755,6 

[issue16662] load_tests not invoked in package/__init__.py

2014-09-11 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

On Sep 11, 2014, at 07:23 AM, STINNER Victor wrote:

The changeset d0ff527c53da5b925b61a8a70afc686ca6e05960 related to this issue
introduced a regression in test_unittest. The test now fails on
Windows.

Darn.  I don't have Windows handy to work out a fix.  I'll try to get a VM
running but wouldn't mind if someone beats me to it. :)

--

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



  1   2   >