Re: Convert Python 3 ResourceWarnings into exception

2014-07-31 Thread Piotr Dobrogost
Terry Reedy udel.edu> writes: > > python -W error ... > "Raise an exception instead of printing a warning message." > > You can also turn this on with the warnings module. Assuming that this > works for ResourceWarning, which is should, please correct the SO record. Thanks for taking time to

Convert Python 3 ResourceWarnings into exception

2014-07-30 Thread Piotr Dobrogost
Hi! Recently A. Jesse Jiryu Davis asked at Stackoverflow (http://stackoverflow.com/q/24717027/95735) if there is "a way to force a Python 3 unittest to fail, rather than simply print a warning to stderr, if it causes any ResourceWarning?" Daniel Harding, in the accepted answer, states it's not pos

Re: Cross-platform way to get default directory for binary files like console scripts?

2014-02-21 Thread Piotr Dobrogost
On Thursday, February 20, 2014 4:34:25 PM UTC+1, Piotr Dobrogost wrote: > > I'm wondering if there's some API to get this info as what you showed is > really roundabout way to achieve the goal... Turns out there is API for this - see thread on distutils-sig mai

Re: Cross-platform way to get default directory for binary files like console scripts?

2014-02-20 Thread Piotr Dobrogost
On Thursday, February 20, 2014 4:42:54 PM UTC+1, Ned Batchelder wrote: > > As roundabout and advanced as that code is, it doesn't give the right > answer for me. It returns None. Indeed. I tried on Linux and got None both inside and outside virtualenv :( Regards, Piotr -- https://mail.python.

Re: Cross-platform way to get default directory for binary files like console scripts?

2014-02-20 Thread Piotr Dobrogost
On Thursday, February 20, 2014 4:22:53 PM UTC+1, Oscar Benjamin wrote: > > I'm not sure if I understand the question. Are you trying to find > where a script would go if it had been installed as a result of > 'python setup.py install' or 'pip install ...'? > Yes. > If so there are > different p

Cross-platform way to get default directory for binary files like console scripts?

2014-02-20 Thread Piotr Dobrogost
rocess and we would like to make sure we run tools that accompany Python's interpreter used to run this script. Please note that the script may be run from within virtualenv which had not been activated - ./venv/bin/python our_script.py Regards, Piotr Dobrogost -- https://mail.python.org/m

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-06 Thread Piotr Dobrogost
On Friday, December 6, 2013 3:07:51 PM UTC+1, Neil Cerutti wrote: > On 2013-12-04, Piotr Dobrogost > > wrote: > > > On Wednesday, December 4, 2013 10:41:49 PM UTC+1, Neil Cerutti > > wrote: > > >> not something to do commonly. Your proposed syntax leaves th

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Thursday, December 5, 2013 12:09:52 AM UTC+1, Ethan Furman wrote: > Perhaps you should look > at different ways of spelling your identifiers? Why can't you use an > underscore instead of a hyphen? So that underscore could be left for use inside fields' names? However I think we could use some

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Wednesday, December 4, 2013 11:11:56 PM UTC+1, Terry Reedy wrote: > > The discussion of enlarging the scope of 'identifier' is not relevant as > you are not proposing that. In particular, you are not asking that > obj.value-1 get the 'value-1' attribute of obj. Right. > The discussion of k

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Wednesday, December 4, 2013 10:41:49 PM UTC+1, Neil Cerutti wrote: > On 2013-12-04, Piotr Dobrogost <> wrote: > > > Right. If there's already a way to have attributes with these > > "non-standard" names (which is a good thing) > > At best its a

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Tuesday, December 3, 2013 6:48:38 PM UTC+1, Dave Angel wrote: > On Tue, 3 Dec 2013 09:14:49 -0800 (PST), Piotr Dobrogost > > wrote: > > > What is the reason there's no "natural" syntax allowing to access > > attributes with names not being valid Pyth

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Wednesday, December 4, 2013 10:41:49 PM UTC+1, Neil Cerutti wrote: > > not something to do commonly. Your proposed syntax leaves the > distinction between valid and invalid identifiers a problem the > programmer has to deal with. It doesn't unify access to > attributes the way the getattr and se

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Wednesday, December 4, 2013 2:23:24 PM UTC+1, Roy Smith wrote: > In article <17gt99hg615jfm7bdid26185884d2pf...@4ax.com>, > > Tim Roberts <> wrote: > > > Piotr Dobrogost <> wrote: > > > >Attribute access syntax being very concise is very often

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Wednesday, December 4, 2013 2:06:44 AM UTC+1, Tim Chase wrote: > > I think random832 is saying that the designed purpose of setattr() > was to dynamically set attributes by name, so they could later be > accessed the traditional way; not designed from the ground-up to > support non-identifier na

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Piotr Dobrogost
On Wednesday, December 4, 2013 6:45:05 AM UTC+1, Tim Roberts wrote: > > It is not "very concise". It is slightly more concise. > > x = obj.value1 > x = dct['value1'] > > You have saved 3 keystrokes. Actually only 1 as you should have compared these: x = obj.'value-1' x = dct['value-1

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-03 Thread Piotr Dobrogost
On Tuesday, December 3, 2013 6:31:58 PM UTC+1, Ethan Furman wrote: > > When would you have attribute names that are not valid identifiers? > See my answer to rand's post. -- https://mail.python.org/mailman/listinfo/python-list

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-03 Thread Piotr Dobrogost
On Tuesday, December 3, 2013 7:03:41 PM UTC+1, rand...@fastmail.us wrote: > On Tue, Dec 3, 2013, at 12:14, Piotr Dobrogost wrote: > > > Hi! > > > I find global getattr() function awkward when reading code. > > What is the reason there's no "natural" syn

Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-03 Thread Piotr Dobrogost
tribute-name-but-not-valid-identifier'? Regards, Piotr Dobrogost -- https://mail.python.org/mailman/listinfo/python-list

Why is str(None) == 'None' and not an empty string?

2013-08-28 Thread Piotr Dobrogost
Hi! Having repr(None) == 'None' is sure the right thing but why does str(None) == 'None'? Wouldn't it be more correct if it was an empty string? Regards Piotr Dobrogost -- http://mail.python.org/mailman/listinfo/python-list

Re: Python pdb bug, followed by bug in bugs.python.org

2013-04-13 Thread Piotr Dobrogost
On Thursday, April 11, 2013 5:12:53 PM UTC+2, donald...@gmail.com wrote: > > I just submitted a bug report on the pdb issue. It would be nice of you to share the link to this issue. -- http://mail.python.org/mailman/listinfo/python-list

Re: SimpleHTTPRequestHandler used with HTTP/1.1 hangs after the second resource on a page.

2013-04-13 Thread Piotr Dobrogost
On Saturday, April 13, 2013 12:21:33 AM UTC+2, Terry Jan Reedy wrote: > I find the doc slightly confusing. The SO code uses BaseHTTPServer. The > doc says "Usually, this module isn’t used directly," On the other hand, > SimpleHTTPServer only defines a request handler and not a server itself. Tha

SimpleHTTPRequestHandler used with HTTP/1.1 hangs after the second resource on a page.

2013-04-12 Thread Piotr Dobrogost
hon/file/d9893d13c628/Lib/http/server.py#l370) but I can't see what's wrong. Any ideas? Best regards, Piotr Dobrogost -- http://mail.python.org/mailman/listinfo/python-list

backporting PEP 3134 "Exception Chaining and Embedded Tracebacks" to Python 2.7

2013-02-19 Thread Piotr Dobrogost
Hi! What is a chance of backporting PEP 3134 "Exception Chaining and Embedded Tracebacks" to Python 2.7? Regards, Piotr Dobrogost -- http://mail.python.org/mailman/listinfo/python-list

DLLs folder on Windows

2013-01-16 Thread Piotr Dobrogost
lled for all users." (https://github.com/pypa/virtualenv/issues/87). Regards, Piotr Dobrogost ps. This was originaly posted to python-devel see http://thread.gmane.org/gmane.comp.python.devel/136821 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is pylaucher in Python 3.3 being installed in Windows folder?

2012-10-04 Thread Piotr Dobrogost
On Oct 4, 6:30 am, Chris Rebert wrote: > Presumably because Program Files isn't part of the > $PATH.http://superuser.com/questions/124239/what-is-the-default-path-enviro... > Contrast (from the PEP): "However, the Windows directory is always on the > path." I guess that's the reason indeed. >

Why is pylaucher in Python 3.3 being installed in Windows folder?

2012-10-03 Thread Piotr Dobrogost
Why is pylauncher in Python 3.3 being installed in Windows folder and not in Program Files folder? Installing into Windows folder was maybe acceptable 10 years ago but not now... -- http://mail.python.org/mailman/listinfo/python-list