Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Steven D'Aprano
On Monday 20 July 2015 13:30, Ian Kelly wrote:

 On Sun, Jul 19, 2015 at 9:12 PM, Steven D'Aprano st...@pearwood.info
 wrote:
 On Mon, 20 Jul 2015 11:35 am, Rick Johnson wrote:

 I figured that was you *MARK LAWRENCE*. I shall add sock-puppeting
 to your many egregious offenses! And poorly executed sock-puppeting
 as well! You're a zero.

 Rick, what the hell are you talking about? Mark is using the same email
 address as he has always used (unlike a certain person who shall remain
 unnamed, but used to go by the names RR and Ranting Rick and possibly
 others).
 
 Not quite; one is @yahoo.co.uk, and the other is @gmail.com.

Ah, so they are. You're right, I was wrong, they're not the same email 
address. But still, accusations of sock-puppetry from a change in email 
provider is unreasonable, and I believe that Rick should acknowledge that he 
over-reacted.


 If the
 great Ranting Rick can't tell that these belong to the same person
 just based on the local part, then what chance do we mere mortals
 have?



-- 
Steve

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Michael Torrie
On 07/19/2015 11:33 PM, Michael Torrie wrote:
  For the most part,
 it's been good to hear from Cecil (there have been a few snarky posts)
 as he has learned python and really run with it.  I don't understand
 where your apparent frustration with Cecil is coming from.

Come to think of it, I can't think of but one post, maybe, where he was
short with someone, but not snarky.  I take that back.  Which is better
than me, and probably others!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread dieter
Mark Lawrence breamore...@yahoo.co.uk writes:
 ...
 So I most humbly suggest, as I may have hinted at once or twice
 earlier in this thread, that people either put up or shut up.

In another of your contributions to this thread, you spoke of another
alternative: do a bit of begging. That is what some of us are doing.

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


[issue19663] Not so correct error message when initializing defaultdict

2015-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset efda1eaf86a3 by Raymond Hettinger in branch '3.4':
Issue #19663: Improve error message for defaultdict.
https://hg.python.org/cpython/rev/efda1eaf86a3

--
nosy: +python-dev

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



[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2015-07-20 Thread Martin Panter

Martin Panter added the comment:

This updated patch adds the clarification about NotImplemented.

--
Added file: 
http://bugs.python.org/file39958/default-ne-reflected-priority.v4.patch

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



Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread dieter
Ian Kelly ian.g.ke...@gmail.com writes:

 On Sun, Jul 19, 2015 at 10:10 AM, Cecil Westerhof ce...@decebal.nl wrote:
 On Sunday 19 Jul 2015 15:42 CEST, Mark Lawrence wrote:

 On 19/07/2015 03:13, Terry Reedy wrote:
 On 7/18/2015 7:50 PM, Devin Jeanpierre wrote:
 to 2.7, surely bug fixes are also allowed?

 Of course, allowed.  But should they be made, and if so, by who?

 The people who want the fixes.

 Babies want clean diapers. So babies have to change diapers
 themselves?

 Poor analogy. Babies need others to change their diapers for them
 because they're not capable of doing it for themselves.

I believe Cecil was aware of this and wanted to stress:
not everyone who needs a fix is also able to backport a corresponding
patch.

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread dieter
Mark Lawrence breamore...@yahoo.co.uk writes:

 On 19/07/2015 18:14, Cecil Westerhof wrote:
 On Sunday 19 Jul 2015 18:38 CEST, Mark Lawrence wrote:
 ...
 You think so? I think that a lot of people who are using 2.7 would
 like to have the fixes. They know how to use Python, but they would
 not now how to implement a patch. That is why I made this comment.


 I don't think so, I know.  If they want the patches that badly and
 can't do it themselves they'll have to grin and bear it, or do a bit
 of begging, or pay somebody to do it for them.

Well, there might be budget constraints and the difficulty
to find someone capable of doing a backport.

We are doing here some form of begging. Thus, we are in line with
your recommendations ;-)

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


[issue19663] Not so correct error message when initializing defaultdict

2015-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d248702feab0 by Raymond Hettinger in branch '2.7':
Issue #19663: Improve error message for defaultdict.
https://hg.python.org/cpython/rev/d248702feab0

--

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



Re: New to python

2015-07-20 Thread David Palao
2015-07-20 7:20 GMT+02:00 Arthi Vigneshwari arthi15sm...@gmail.com:
 Hi,
   Am interested to learn python!Can you please guide me how to start with
 python which will help in my selenium automation?

 Regards,
 Arthi

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


Hi,
If you enter learning python in a search engine, you'll probably get
several interesting resources to start with it.
For instance, have you had a look at
https://www.python.org/about/gettingstarted/
?

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread dieter
Mark Lawrence breamore...@yahoo.co.uk writes:

 On 19/07/2015 17:10, Cecil Westerhof wrote:
 On Sunday 19 Jul 2015 15:42 CEST, Mark Lawrence wrote:
 ...
 Babies want clean diapers. So babies have to change diapers
 themselves?


 That has to be the worst analogy I've ever read.  We are discussing
 backporting working patches, *NOT* having to go through the whole
 shooting match from scratch.

Nevertheless, the task is (usually) far from trivial.
Beside the pure functional aspect, you need at least also address
testing againt interference with other features, i.e. you need
detailed knowledge about Python's test suite and its setup.
This obviously is non trivial - as I have seen fixes break other things.

If C code is envolved, you need also understand Python's build environment
-- another huge requirement of specific knowledge. Especially, because
the Python build process must function on many platforms and typical
users only use a single one.

The first point causes me prefer external packages - where I (not
a community) decide about the extent of testing. It is also easy to
remove an external package should it really make problems.

The second point causes me to prefer working around problems envolving
C code rather than fixing it.

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Terry Reedy

On 7/19/2015 9:20 PM, Devin Jeanpierre wrote:


Search your logs for https://bugs.python.org/issue17094
http://bugs.python.org/issue5315

I was most frustrated by the first case --

 the patch was (informally) rejected

By 'the patch', I presume you mean current-frames-cleanup.patch
by Stefan Ring, who said it is certainly not the most complete 
solution, but it solves my problem.. It was reviewed a month later by a 
core dev, who said it had two defects.  Do you expect us to apply 
defective patches?



in favor of the right fix,


right is your word. Natali simply uploaded an alternate patch that did 
not have the defects cited.  It went through 4 versions, two by Pitrou, 
before the commit and close 2 months later, with the comment Hopefully 
there aren't any applications relying on the previous behaviour.


and the right fix was (informally) rejected because it changed behavior,

The bugfix was rejected *for both 2.7 and 3.3* in msg186011.  The 
rejection therefore does not indicate animus against 2.7 versus 3.x. The 
reason is that it did more than just fix the bug. When this is the case, 
we only apply to the upcoming release.  If we broke working code as a 
side-effect, as opposed to a direct effect, of a bugfix, many people 
would be frustrated. See some of the other comments in this thread.


Two years later, last May, you proposed and uploaded a patch with what 
looks to be a new and different approach.  It has been ignored.  In the 
absence of a core dev focused on 2.7, I expect that this will continue. 
Too bad you did not upload it in Feb 2013, before the review and fix 
started.


 and http://bugs.python.org/issue5315

Another fairly obscure issue for most of us. Five years ago, this was 
turned into a doc issue, but no patch was ever submitted for either 2.x 
or 3.x.  Again, no particular prejudice against 2.x.


In May, you posted a bugfix which so far has been ignored.  Not too 
surprising.  I submitted a ping and updated the versions.  If anyone 
responds, you might be asked for a patch against 3.4 or 3.5.


--
Terry Jan Reedy

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread dieter
Rick Johnson rantingrickjohn...@gmail.com writes:

 On Sunday, July 19, 2015 at 1:44:25 PM UTC-5, bream...@gmail.com wrote:
 No, it's simply that nobody can force volunteers to back
 port something when they're just not interested in doing
 the work, for whatever reason.  Hence my statement above,
 of which you have focused on the last eight words.

 Well i argue that the free labor *WOULD* exists *IF* the
 patching mechanism were more inclusive and intuitive.

Thinking of myself, I am not sure. Ensuring the quality of
a distribution goes far beyond a single bug fix. While I usually
are ready to share a bug fix I have found, I am reluctant to get
involved in the complete quality ensurance process (such as
the test suite, review process, style guides, ...). This would
require far more time than that for analysing and fixing the initial
problem. Thus, from my point of view, it calls for a division of labor --
where quality ensurance experts do the integration of my patch/backport.


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


[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-20 Thread Daniel al. LordBlick

Changes by Daniel al. LordBlick lordbl...@gmail.com:


--
nosy: +serhiy.storchaka

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



Re:New to python

2015-07-20 Thread Arthi Vigneshwari
Hi,
  Am interested to learn python!Can you please guide me how to start with
python which will help in my selenium automation?

Regards,
Arthi
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

2015-07-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

--

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



Re: How we can send mail with attachment in Python?

2015-07-20 Thread dieter
Kevin Peterson qh.res...@gmail.com writes:

 How we can send mail with attachment in Python? Is it any prerequisite for it?

You look at the email package to build the message
and the smtplib package to send the message -
both are part of Python's runtime library and documented in its
documentation.

Note that you need access to an smtp server (aka mail server).
It ensures in cooperation with other smtp servers the distribution
of your email around the world. Access to an smtp server is a non-Python
issue.

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


Procedure for downloading and Installing Python 2.7 Modules

2015-07-20 Thread W. D. Allen

Would like to locate and install numpy, scipy and matplotlib
with Wing 101 for Python 2.7

Just beginning to use Python 2.7 for engineering work.

Any guidance would be appreciated.

Thanks,

WDA
balle...@gmail.com

end

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread dieter
Rick Johnson rantingrickjohn...@gmail.com writes:

 On Sunday, July 19, 2015 at 12:54:34 AM UTC-5, dieter wrote:
 From my point of view: if you want help with fixing bugs,
 you must ensure that there is a high probability that
 those contributions really find their way into the main
 development lines. As I understand from other messages in
 this thread, this is also a problem with Python bug
 fixing.

 (Not sure who said this, so my apologies if the attribution
 is incorrect)
 
 Bug fixing is not something most programmers find enjoyable,
 at least not for long durations. I prefer to spend my time
 solving real world problems, and designing intuitive APIs,
 this is what brings me joy. 

This was me.

And I am like you. I do not hunt bugs I find in a bug tracker
but only bugs I get hit in real world problems.
But once hit, I usually find a solution (or work around)
and like to share it with others who might get hit in the future.
That's why I take the time to file bug reports (often with patches).

But when those bug reports and patches seem to be ignored by
the core development team - I look for other means, such as
external packages.


 Heck, there have been many times that i purposefully re-
 invented the wheel simply because solving the problem is
 much easier (and more enjoyable) than trying to understand
 another programmer's atrocious spaghetti code. Therefor, we
 should not be surprised that the bug list is so understaffed
 and lacks vigor.

In my experience (with other open source projects), I think
almost none of my patches was ever taken over without modifications.
In my view, the changes were usually of a cosmetic nature.
For me, this is fine - as long as the problem gets fixed.

 ...
 What is becoming apparent to me though, is that most of the
 complaints i had voiced (years ago) about the exclusive
 attitudes, horrible interface, and the burdensome workflow
 of submitting patches is contributing to the lack of
 interest in this process - and it seems i am not alone!

 I can remember twice getting excited about helping out, to
 only quickly become frustrated with the politics and
 interface. Why should i have to fight just to volunteer?

Experience like this (in another project) causes me to
be very reluctant to become a core contributor (in the sense
of actively fixing things in the core). You need a lot of knowledge
(coding conventions, test setup, change workflow, ...) whichs
goes far beyond the functionality of the fix -- and you
must be resilient, patient and maybe even fighting to get the work
accepted.

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


[issue19663] Not so correct error message when initializing defaultdict

2015-07-20 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


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

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



Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Devin Jeanpierre
I think you're missing the line where I said all the relevant
conversation happened in IRC, and that you should refer to logs.

On Sun, Jul 19, 2015 at 11:25 PM, Terry Reedy tjre...@udel.edu wrote:
 On 7/19/2015 9:20 PM, Devin Jeanpierre wrote:

 Search your logs for https://bugs.python.org/issue17094
 http://bugs.python.org/issue5315

 I was most frustrated by the first case --

 the patch was (informally) rejected

 By 'the patch', I presume you mean current-frames-cleanup.patch
 by Stefan Ring, who said it is certainly not the most complete solution,
 but it solves my problem.. It was reviewed a month later by a core dev, who
 said it had two defects.  Do you expect us to apply defective patches?

No, I meant my patch. It was discussed in IRC, and I gave the search
term to grep for. (The issue URL.)

 in favor of the right fix,


 right is your word. Natali simply uploaded an alternate patch that did not
 have the defects cited.  It went through 4 versions, two by Pitrou, before
 the commit and close 2 months later, with the comment Hopefully there
 aren't any applications relying on the previous behaviour.

No, right is the word used by members of #python-dev, referrig to
Antoine's fix.

 Two years later, last May, you proposed and uploaded a patch with what looks
 to be a new and different approach.  It has been ignored.  In the absence of
 a core dev focused on 2.7, I expect that this will continue. Too bad you did
 not upload it in Feb 2013, before the review and fix started.

I'm not sure what you're implying here. It couldn't be helped.

 and http://bugs.python.org/issue5315

 Another fairly obscure issue for most of us. Five years ago, this was turned
 into a doc issue, but no patch was ever submitted for either 2.x or 3.x.
 Again, no particular prejudice against 2.x.

 In May, you posted a bugfix which so far has been ignored.  Not too
 surprising.  I submitted a ping and updated the versions.  If anyone
 responds, you might be asked for a patch against 3.4 or 3.5.

Again, the prejudice was expressed in IRC. It was ignored because you
can just use asyncio in 3.x, and because the bug was old.

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


[issue24483] Avoid repeated hash calculation in C implementation of functools.lru_cache()

2015-07-20 Thread Tal Einat

Tal Einat added the comment:

Ping? Let's not miss the final 3.5 beta.

--

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



Re: New to python

2015-07-20 Thread Arthi Vigneshwari
Hey David,
  Yeah,I had an overall look at
https://www.python.org/about/gettingstarted/! Let me dig deep into the
websites you shared me with!

Thanks,
Arthi

On Mon, Jul 20, 2015 at 1:19 PM, David Palao dpalao.pyt...@gmail.com
wrote:

 2015-07-20 7:20 GMT+02:00 Arthi Vigneshwari arthi15sm...@gmail.com:
  Hi,
Am interested to learn python!Can you please guide me how to start with
  python which will help in my selenium automation?
 
  Regards,
  Arthi
 
  --
  https://mail.python.org/mailman/listinfo/python-list
 

 Hi,
 If you enter learning python in a search engine, you'll probably get
 several interesting resources to start with it.
 For instance, have you had a look at
 https://www.python.org/about/gettingstarted/
 ?

 Best regards

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


Generating type annotations by tracing execution runs

2015-07-20 Thread Michael Williamson
Hello,

I've knocked together a quick proof-of-concept that allows type
annotations to be automatically added to Python source code by running
it:

https://github.com/mwilliamson/farthing

As the code, such as a test suite, runs, the types of arguments and
return values (for functions in the file/directory to be annotated) are
stored. After the code has finished, appropriate annotations are added.
(There's a tiny example in the README.rst in case that makes things a
little clearer.)

At the moment, this is just a small prototype that I've cobbled
together. I was curious if anybody knows if anybody else has done
anything similar?

Thanks

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


[issue24583] set.update(): Crash when source set is changed during merging

2015-07-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Both variants LGTM. But set_self_contained.diff seems better.

I suppose this is 3.6 only.

--

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



[issue24672] shutil.rmtree failes on non ascii filenames

2015-07-20 Thread Steffen Kampmann

New submission from Steffen Kampmann:

I run python 2.7 on Windows 7 and the function rmtree of the shutil package 
fails to remove files with a non ascii filename:

File C:\Users\skampmann\AppData\Local\Continuum\Anaconda\lib\shutil.py, 
line 247, in rmtreermtree(fullname, ignore_errors, onerror)
File C:\Users\skampmann\AppData\Local\Continuum\Anaconda\lib\shutil.py, 
line 247, in rmtreermtree(fullname, ignore_errors, onerror)
File C:\Users\skampmann\AppData\Local\Continuum\Anaconda\lib\shutil.py, 
line 247, in rmtreermtree(fullname, ignore_errors, onerror)
File C:\Users\skampmann\AppData\Local\Continuum\Anaconda\lib\shutil.py, 
line 252, in rmtreeonerror(os.remove, fullname, sys.exc_info())
File C:\Users\skampmann\AppData\Local\Continuum\Anaconda\lib\shutil.py, 
line 250, in rmtreeos.remove(fullname)
  WindowsError: [Error 2] Das System kann die angegebene Datei nicht finden: 
'H:\\ihre_perso\xa6\xeanlichen_Zugangsdaten600.jpg'

Please let me know if i can help with something.

--
components: Library (Lib)
messages: 246971
nosy: Steffen Kampmann
priority: normal
severity: normal
status: open
title: shutil.rmtree failes on non ascii filenames
versions: Python 2.7

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



[issue24672] shutil.rmtree failes on non ascii filenames

2015-07-20 Thread Tim Golden

Tim Golden added the comment:

Can you confirm whether it also fails if you pass in a unicode string? eg

shutil.rmtree(ufilename.txt)

--

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



[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The issue is not in os.path, but in __file__ been relative path. If you change 
current work directory, __file__ is no longer valid path to source file. Things 
are even worse with zipimport. When you will archive the script in the ZIP file 
and run this ZIP file, __file__ will not be a path to the source file from the 
start.

See also issue18416.

--
nosy: +brett.cannon, eric.snow, ncoghlan

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



[issue24672] shutil.rmtree failes on non ascii filenames

2015-07-20 Thread Serhiy Storchaka

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


--
components: +Windows
nosy: +haypo, paul.moore, steve.dower, tim.golden, zach.ware

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



File Upload in Restful Flask

2015-07-20 Thread subhabrata . banerji
Dear Group,

I am trying to learn Rest framework through Restful Flask. 
My initial exercises went fine with 
https://flask-restful.readthedocs.org/en/0.3.3/quickstart.html

Now I want to upload file through Restful Flask. I tried to check the web for 
reference. 
I got these urls, 
(i) 
http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
(ii) http://stackoverflow.com/questions/28982974/flask-restful-upload-image
(iii) http://blog.luisrei.com/articles/flaskrest.html

But the question I am stuck with what are the things I have to change in the 
example of quickstart tutorial so that I may be able to upload file. Or if any 
one may kindly suggest with a small example. 

If any one of the esteemed members may kindly suggest. 

Regards,
Subhabrata Banerjee. 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Mark Lawrence

On 20/07/2015 03:16, Rustom Mody wrote:

On Monday, July 20, 2015 at 7:16:50 AM UTC+5:30, Mark Lawrence wrote:

On 20/07/2015 02:20, Devin Jeanpierre wrote:



I don't like how this is being redirected to surely you
misunderstood or I don't believe you. The fact that some core devs
are hostile to 2.x development is really bleedingly obvious, you
shouldn't need quotes or context thrown at you. The rhetoric almost
always shies _just_ short of ceasing bugfixes (until 2020, when that
abruptly becomes a cracking good idea). e.g. in 2.7 is here until
2020, please don't call it a waste.



A couple of things.

First some core devs are hostile, actually some have stated that
they're simply not interested in 2.7 and will not work on it.

Second how has the thread got here, as it was originally asking about
back porting bug fixes from 3.x to 2.7?  Further it said:-

quote
If the vast majority of Python programmers are focused on 2.7, why are
volunteers to help fix 2.7 bugs so scarce?
/quote

So I most humbly suggest, as I may have hinted at once or twice earlier
in this thread, that people either put up or shut up.


I just ran the following command
$ hg log --template {author|person}\n | sort | uniq -c | sort -nr

as giving all the committers to python in sorted order.
I get the list below.
Dont see any Mark Lawrence there
Of course I dont know hg at all well... Just picked up the above command from
http://stackoverflow.com/questions/6126678/how-to-list-commiters-sorted-by-number-of-commits-commit-count

So... May I humbly ask where are your precious commits??



Thank you for showing your complete ignorance as to how Python works.

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


[issue24673] distutils/_msvccompiler does not remove /DLL during link(CCompiler.EXECUTABLE)

2015-07-20 Thread James Salter

New submission from James Salter:

Encountered trying to build numpy with python 3.5b3, visual studio 2015.

From distutils/_msvccompiler.py:MSVCCompiler.link:

if self._need_link(objects, output_filename):
ldflags = (self.ldflags_shared_debug if debug
   else self.ldflags_shared)
if target_desc == CCompiler.EXECUTABLE:
ldflags = ldflags[1:]

But

self.ldflags_shared = [
'/nologo', '/DLL', '/INCREMENTAL:NO'
]
self.ldflags_shared_debug = [
'/nologo', '/DLL', '/INCREMENTAL:no', '/DEBUG:FULL'
]

Which leads to a DLL being created instead of a .exe.

I have attached a patch that explicitly removes '/DLL' rather than trimming by 
index.

--
components: Distutils
files: _msvccompiler_link.patch
keywords: patch
messages: 246976
nosy: James Salter, dstufft, eric.araujo
priority: normal
severity: normal
status: open
title: distutils/_msvccompiler does not remove /DLL during 
link(CCompiler.EXECUTABLE)
type: compile error
versions: Python 3.5
Added file: http://bugs.python.org/file39959/_msvccompiler_link.patch

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



Re: File Upload in Restful Flask

2015-07-20 Thread Simmo

On 20/07/2015 11:13, subhabrata.bane...@gmail.com wrote:

Dear Group,

I am trying to learn Rest framework through Restful Flask.
My initial exercises went fine with 
https://flask-restful.readthedocs.org/en/0.3.3/quickstart.html

Now I want to upload file through Restful Flask. I tried to check the web for 
reference.
I got these urls,
(i) 
http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
(ii) http://stackoverflow.com/questions/28982974/flask-restful-upload-image
(iii) http://blog.luisrei.com/articles/flaskrest.html

But the question I am stuck with what are the things I have to change in the 
example of quickstart tutorial so that I may be able to upload file. Or if any 
one may kindly suggest with a small example.

If any one of the esteemed members may kindly suggest.

Regards,
Subhabrata Banerjee.



I'm no expert on Python or REST but the example

 url = 'http://httpbin.org/post'
 files = {'file': open('report.xls', 'rb')}

 r = requests.post(url, files=files)
 r.text
...

seems quite straightforward so I would suggest substituting your URL for 
'http://httpbin.org' and your file name (possibly with full pathname) 
for 'report.xls'.


Give it a try and report back...

Steve S

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


[issue24583] set.update(): Crash when source set is changed during merging

2015-07-20 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - not a bug
stage: patch review - resolved
status: open - closed

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



[issue24670] os.chdir breaks result of os.path.abspath(__file__) and os.path.realpath(__file__)

2015-07-20 Thread Daniel al. LordBlick

Daniel al. LordBlick added the comment:

If so, then should be internally __file__ edit by zipimport and/or os.cwd?
It's simple string in file.__dict__['__file__']…
Is exist some class representing internal file? Then any cwd operation should 
be wraped by it.

--
components: +Interpreter Core

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



[issue24605] segmentation fault at asciilib_split_char.lto_priv

2015-07-20 Thread josch

josch added the comment:

I do not see any module implemented in C in the imports. Is there a way to find 
out from where the segmentation fault came?

--

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



Does the Class UserGroup (issue 11588) exist for python 2.7 ?

2015-07-20 Thread CARANNANTE, MARTINE
Hi
Could you tell me if the Class UserGroup (method add_usage_group to support 
inclusive groups) exist for python 2.7 ?
The patch that I found on internet is only for python 3.

Thanks in advance for your answer
Best regards

Martine Carannante




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


Re: File Upload in Restful Flask

2015-07-20 Thread subhabrata . banerji
On Monday, July 20, 2015 at 4:40:09 PM UTC+5:30, Simmo wrote:
 On 20/07/2015 11:13, wrote:
  Dear Group,
 
  I am trying to learn Rest framework through Restful Flask.
  My initial exercises went fine with 
  https://flask-restful.readthedocs.org/en/0.3.3/quickstart.html
 
  Now I want to upload file through Restful Flask. I tried to check the web 
  for reference.
  I got these urls,
  (i) 
  http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
  (ii) http://stackoverflow.com/questions/28982974/flask-restful-upload-image
  (iii) http://blog.luisrei.com/articles/flaskrest.html
 
  But the question I am stuck with what are the things I have to change in 
  the example of quickstart tutorial so that I may be able to upload file. Or 
  if any one may kindly suggest with a small example.
 
  If any one of the esteemed members may kindly suggest.
 
  Regards,
  Subhabrata Banerjee.
 
 
 I'm no expert on Python or REST but the example
 
url = 'http://httpbin.org/post'
files = {'file': open('report.xls', 'rb')}
 
r = requests.post(url, files=files)
r.text
  ...
 
 seems quite straightforward so I would suggest substituting your URL for 
 'http://httpbin.org' and your file name (possibly with full pathname) 
 for 'report.xls'.
 
 Give it a try and report back...
 
 Steve S

Dear Sir,

Thanks. I could change the quickstart api.py slightly. I ran your suggestion
on it. Some result seems coming but I may have to improve some portion, I am 
not getting. Please see the same.

 import requests
 url='http://127.0.0.1:5000/toworks/post'
 files = {'file': open('C:\Python27\NEWS.txt', 'rb')}
 r = requests.post(url, files=files)
 r.text
u'{\nmessage: Method Not Allowed, \nstatus: 405\n}\n'
 

Regards,
Subhabrata Banerji
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24583] set.update(): Crash when source set is changed during merging

2015-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3f2c12c0abdb by Raymond Hettinger in branch 'default':
Issue #24583:  Consolidate previous set object updates into a single function
https://hg.python.org/cpython/rev/3f2c12c0abdb

--

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

This is likely a platform bug, it fails with os.write as well.  Interestingly 
enough file.write works fine on Python 2.7 (which uses stdio), that appearently 
works around this kernel misfeature.

A possible partial workaround is recognise this error in the implementation of 
os.write and then perform a partial write. Problem is: while write(2) is 
documented as possibly writing less data than expected most users writing to 
normal files (as opposed to sockets) probably don’t expect that behavior. On 
the other hand, os.write already limits writes to INT_MAX on Windows (see 
_Py_write in Python/fileutils.c)

Because of this I’m in favour of adding a simular workaround on OSX (and can 
provide a patch).

BTW. the manpage for write says that writev(2) might fail with EINVAL:

 [EINVAL]   The sum of the iov_len values in the iov array over-
flows a 32-bit integer.

I wouldn’t be surprised if write(2) is implemented using writev(2) and that 
this explains the problem.

 On 18 Jul 2015, at 06:05, Serhiy Storchaka rep...@bugs.python.org wrote:
 
 
 Changes by Serhiy Storchaka storch...@gmail.com:
 
 
 --
 components: +Extension Modules, IO -Interpreter Core
 nosy: +haypo, ned.deily, ronaldoussoren
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue24658
 ___

--

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



[issue24646] Python accepts SSL certificate that should be rejected on OSX

2015-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

Using our own OpenSSL build should be saver in the long run anyway.  Apple 
provides enough API’s to reproduce the behaviour of Apple’s build in a cleaner 
way (by making the loading of system CA certs an explicit action). Problem is: 
that likely requires using API’s higher up in the API stack, which could cause 
problems when using os.fork without os.exec (the old “CoreFoundation crashes in 
child processes” problem).

Ronald

 On 18 Jul 2015, at 06:22, Ned Deily rep...@bugs.python.org wrote:
 
 
 Ned Deily added the comment:
 
 For what it's worth, the El Capitan Beta's apparently don't ship with
 OpenSSL headers anymore though they do still ship with the dylibs.
 
 Hmm, I had tested installing existing python.org binary releases with the 
 first DPs of 10.11 and I *thought* I had tested building from source, as 
 well.  But, yes, it appears that the headers are no longer there, at least on 
 the most recent DP I have installed.  I'm traveling and essentially 
 off-the-net for another week but I will take a closer look at the situation 
 then.
 
 --
 
 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue24646
 ___

--

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread Eric O. LEBIGOT

Eric O. LEBIGOT added the comment:

Thank you for looking into this, Ronald.

What does your patch do, exactly? does it only limit the returned byte count, 
or does it really limit the size of the data written by truncating it?

In any case, it would be very useful to have a warning from the Python 
interpreter. If the data is truncated, I would even prefer an explicit 
exception (e.g. data too big for this platform (= 2 GB)), along with an 
explicit mention of it in the documentation. What do you think?

--

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



[issue24646] Python accepts SSL certificate that should be rejected on OSX

2015-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

BTW. I think someone (me?) should write down the problems with using higher 
levels in the API stack w.r.t. os.fork in a PEP-style document. This can then 
be used to decide whether or not we want to use such APIs in the stdlib (and if 
so, what should be changed to avoid crashes).

I'm slighlty in favour of using such APIs if that makes Python better on OSX, 
even if that introduces slight differences w.r.t. Linux (for example, 
multiprocessing could no longer use only os.fork).  The disadvantage is that it 
would no longer be possible to develop and test pre-forking code on OSX before 
deploying to Linux.

--

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



Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread Peter Heitzer
I am currently writing a python script to extract samples from old Roland 12 
bit sample
disks and save them as 16 bit wav files.

The samples are layouted as follows

0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0] [S1 bit 11..4]
3 [S2 bit 11..4] [S2 bit 3..0|S3 bit 3..0] [S3 bit 11..4]

In other words 
sample0=(data[0]4)|(data[1]4)
sample1=(data[2]4)|(data[1]  0x0f)

I use this code for the conversion (using the struct module)

import struct
from array import array

def getWaveData(diskBuffer):
  offset=0
  words=array('H')
  for i in range(len(diskBuffer)/3):
h0=struct.unpack_from('h',diskBuffer,offset)
h1=struct.unpack_from('h',diskBuffer,offset+1)
words.append(h0[0]  0xfff0)
words.append(h1[0]  0xfff0)
offset+=3
  return words

I unpack the samples in an array of unsigned shorts for I later can use the 
byteswap() method
if the code is running on a big endian machine.

What options using pure python do I have to make the conversion faster?
I thought of unpacking more bytes at once e.g. using a format 'hxhxhxhx' for 4 
even samples
and 'xhxhxhxh' for 4 odd samples vice versa.
Can I map the ' 0xfff0' to the whole array?


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


[issue24646] Python accepts SSL certificate that should be rejected on OSX

2015-07-20 Thread Christian Heimes

Christian Heimes added the comment:

It's a platform bug but Apple doesn't consider it a bug. Hynek has analyzed and 
reported it over a year ago: 
https://hynek.me/articles/apple-openssl-verification-surprises/

--
nosy: +christian.heimes

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



[issue24646] Python accepts SSL certificate that should be rejected on OSX

2015-07-20 Thread Christian Heimes

Christian Heimes added the comment:

Ronald: Can you check if SecTrustSettingsCopyCertificates() or 
SecTrustCopyAnchorCertificates() are affected by the fork() issue?

--

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The attached patch is a first stab at a workaround. It will unconditionally 
limit the write size in os.write to INT_MAX on OSX.

I haven't tested yet if this actually fixes the problem mentioned on stack 
overflow.

--
keywords: +needs review, patch
stage:  - patch review
Added file: http://bugs.python.org/file39960/issue24658.txt

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



[issue24646] Python accepts SSL certificate that should be rejected on OSX

2015-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I'll check, but they probably are because the use data structures from 
CoreFoundation.

--

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



[issue24674] pyclbr not recursively showing classes in packages

2015-07-20 Thread David Worenklein

New submission from David Worenklein:

In the following example, pyclbr does not report that foo.module.A is a 
superclass of C:

__module2.py__
import foo.module
class C(foo.module.B):
pass

__foo/module.py__
class A(object):
def foo(self):
print bar

class B(A):
pass

__test.py__
import pyclbr

def superclasses_of(class_data):
classes = [ class_data ]
super_classes = []
while classes:
class_data = classes.pop()
if isinstance(class_data, basestring):
super_classes.append(class_data)
else:
super_classes.append( class_data.module+'.'+class_data.name )
for c in class_data.super:
classes.append( c )
return super_classes

module = pyclbr.readmodule('module2',['.','./foo'])
for class_name, class_data in module.items():
print %s = %s % (class_name, superclasses_of(class_data))

__results__
C = ['foo.module.B']

I've attached a patch to pyclbr.py to fix this.

--
files: pyclbr.patch
keywords: patch
messages: 246990
nosy: worenklein
priority: normal
severity: normal
status: open
title: pyclbr not recursively showing classes in packages
versions: Python 2.7
Added file: http://bugs.python.org/file39961/pyclbr.patch

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



Re: Does the Class UserGroup (issue 11588) exist for python 2.7 ?

2015-07-20 Thread Mark Lawrence

On 20/07/2015 12:27, CARANNANTE, MARTINE wrote:

Hi
Could you tell me if the Class UserGroup (method add_usage_group to
support inclusive groups) exist for python 2.7 ?
The patch that I found on internet is only for python 3.
Thanks in advance for your answer
Best regards
*Martine Carannante
*


Almost certainly no as the patch has never been commited, which is why 
http://bugs.python.org/issue11588 is till open.  Even if the patch were 
committed there is no guarantee that the patch will be back ported to 2.7.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Re: File Upload in Restful Flask

2015-07-20 Thread Simmo

On 20/07/2015 12:57, subhabrata.bane...@gmail.com wrote:

On Monday, July 20, 2015 at 4:40:09 PM UTC+5:30, Simmo wrote:

On 20/07/2015 11:13, wrote:

Dear Group,

I am trying to learn Rest framework through Restful Flask.
My initial exercises went fine with 
https://flask-restful.readthedocs.org/en/0.3.3/quickstart.html

Now I want to upload file through Restful Flask. I tried to check the web for 
reference.
I got these urls,
(i) 
http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
(ii) http://stackoverflow.com/questions/28982974/flask-restful-upload-image
(iii) http://blog.luisrei.com/articles/flaskrest.html

But the question I am stuck with what are the things I have to change in the 
example of quickstart tutorial so that I may be able to upload file. Or if any 
one may kindly suggest with a small example.

If any one of the esteemed members may kindly suggest.

Regards,
Subhabrata Banerjee.



I'm no expert on Python or REST but the example

 url = 'http://httpbin.org/post'
 files = {'file': open('report.xls', 'rb')}

 r = requests.post(url, files=files)
 r.text
  ...

seems quite straightforward so I would suggest substituting your URL for
'http://httpbin.org' and your file name (possibly with full pathname)
for 'report.xls'.

Give it a try and report back...

Steve S


Dear Sir,

Thanks. I could change the quickstart api.py slightly. I ran your suggestion
on it. Some result seems coming but I may have to improve some portion, I am 
not getting. Please see the same.


import requests
url='http://127.0.0.1:5000/toworks/post'
files = {'file': open('C:\Python27\NEWS.txt', 'rb')}
r = requests.post(url, files=files)
r.text

u'{\nmessage: Method Not Allowed, \nstatus: 405\n}\n'




Regards,
Subhabrata Banerji



OK, so that message is telling you that whatever server is sitting 
behind 127.0.0.1 is not allowing you (your code) to POST to it.  There 
are many reasons why this could be happening.  Here are a couple for you 
to investigate...


- port 5000 is not not 'open' for POSTs
- your code may not have permission to POST to the server

It would help if you could tell us what OS you are using (Windows or 
Linux or ...) and what server is sitting behind 127.0.0.1.


I'n not going to be around for the next 24hrs but I'm sure someone else 
on the list will have some suggestions for you...


Happy bug hunting

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


[issue24674] pyclbr not recursively showing classes in packages

2015-07-20 Thread David Worenklein

David Worenklein added the comment:

P.S. Here are the results after the patch:
C = ['foo.module.B', 'foo.module.A', 'object']

--

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



[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-07-20 Thread Martin Panter

Martin Panter added the comment:

Okay, now at Issue 24675

--
status: open - closed

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



[issue24605] segmentation fault at asciilib_split_char.lto_priv

2015-07-20 Thread STINNER Victor

STINNER Victor added the comment:

You have to search for memory corruptions. You can try to run your application 
with a Python compiled a debug mode. If it doesn't work, you may try Valgrind 
which require a Python compiled with --with-valgrind and to use the suppression 
file. See Misc/README.valgrind.

--

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread Eric O. LEBIGOT

Eric O. LEBIGOT added the comment:

I see, thanks.

This sounds good to me too: no need for a warning or exception, indeed, since 
file.write() should work and the behavior of os.write() is documented.

--

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread STINNER Victor

STINNER Victor added the comment:

The Windows limit to INT_MAX is one many functions:

* os.write()
* io.FileIO.write()
* hum, maybe other, I don't remember

In the default branch, there is now _Py_write(), so only one place should be 
fixed.

See the issue #11395 which fixed the bug on Windows.

If it's a bug, it should be fixed on Python 2.7, 3.4, 3.5 and default branches.

--

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



[issue24675] Avoid DeprecationWarning in test_os

2015-07-20 Thread Martin Panter

New submission from Martin Panter:

This patch is to avoid the warning introduced with the changes in Issue 15745, 
originally described at https://bugs.python.org/issue15745#msg245455. The 
code has a “with” statement to hide the warning from os.stat_float_times(), but 
the warning triggers anyway because the TestCase.addCleanup() callback is 
triggered after the “with” statement has exited.

--
components: Tests
files: stat-times-deprecated.patch
keywords: patch
messages: 246995
nosy: haypo, vadmium
priority: normal
severity: normal
stage: patch review
status: open
title: Avoid DeprecationWarning in test_os
versions: Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file39962/stat-times-deprecated.patch

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



Re: File Upload in Restful Flask

2015-07-20 Thread subhabrata . banerji
On Monday, July 20, 2015 at 6:39:29 PM UTC+5:30, Simmo wrote:
 On 20/07/2015 12:57, wrote:
  On Monday, July 20, 2015 at 4:40:09 PM UTC+5:30, Simmo wrote:
  On 20/07/2015 11:13, wrote:
  Dear Group,
 
  I am trying to learn Rest framework through Restful Flask.
  My initial exercises went fine with 
  https://flask-restful.readthedocs.org/en/0.3.3/quickstart.html
 
  Now I want to upload file through Restful Flask. I tried to check the web 
  for reference.
  I got these urls,
  (i) 
  http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file
  (ii) 
  http://stackoverflow.com/questions/28982974/flask-restful-upload-image
  (iii) http://blog.luisrei.com/articles/flaskrest.html
 
  But the question I am stuck with what are the things I have to change in 
  the example of quickstart tutorial so that I may be able to upload file. 
  Or if any one may kindly suggest with a small example.
 
  If any one of the esteemed members may kindly suggest.
 
  Regards,
  Subhabrata Banerjee.
 
 
  I'm no expert on Python or REST but the example
 
  url = 'http://httpbin.org/post'
  files = {'file': open('report.xls', 'rb')}
 
  r = requests.post(url, files=files)
  r.text
...
 
  seems quite straightforward so I would suggest substituting your URL for
  'http://httpbin.org' and your file name (possibly with full pathname)
  for 'report.xls'.
 
  Give it a try and report back...
 
  Steve S
 
  Dear Sir,
 
  Thanks. I could change the quickstart api.py slightly. I ran your suggestion
  on it. Some result seems coming but I may have to improve some portion, I 
  am not getting. Please see the same.
 
  import requests
  url='http://127.0.0.1:5000/toworks/post'
  files = {'file': open('C:\Python27\NEWS.txt', 'rb')}
  r = requests.post(url, files=files)
  r.text
  u'{\nmessage: Method Not Allowed, \nstatus: 405\n}\n'
 
 
  Regards,
  Subhabrata Banerji
 
 
 OK, so that message is telling you that whatever server is sitting 
 behind 127.0.0.1 is not allowing you (your code) to POST to it.  There 
 are many reasons why this could be happening.  Here are a couple for you 
 to investigate...
 
 - port 5000 is not not 'open' for POSTs
 - your code may not have permission to POST to the server
 
 It would help if you could tell us what OS you are using (Windows or 
 Linux or ...) and what server is sitting behind 127.0.0.1.
 
 I'n not going to be around for the next 24hrs but I'm sure someone else 
 on the list will have some suggestions for you...
 
 Happy bug hunting
 
 Steve

Dear Sir,

Thanks. I am on MS-Windows 7 and I use mostly Firefox. I am checking other 
issues.

Regards,
Subhabrata Banerjee. 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue15745] Numerous utime ns tests fail on FreeBSD w/ ZFS (update: and NetBSD w/ FFS, Solaris w/ UFS)

2015-07-20 Thread Martin Panter

Changes by Martin Panter vadmium...@gmail.com:


Removed file: http://bugs.python.org/file39955/stat-times-deprecated.patch

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



Re: Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread MRAB

On 2015-07-20 14:10, Peter Heitzer wrote:

I am currently writing a python script to extract samples from old Roland 12 
bit sample
disks and save them as 16 bit wav files.

The samples are layouted as follows

0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0] [S1 bit 11..4]
3 [S2 bit 11..4] [S2 bit 3..0|S3 bit 3..0] [S3 bit 11..4]

In other words
sample0=(data[0]4)|(data[1]4)
sample1=(data[2]4)|(data[1]  0x0f)

I use this code for the conversion (using the struct module)

import struct
from array import array

def getWaveData(diskBuffer):
   offset=0
   words=array('H')
   for i in range(len(diskBuffer)/3):


If the 2 12-bit values are [0xABC, 0xDEF], the bytes will be [0xAB, 
0xCF, 0xDE].



 h0=struct.unpack_from('h',diskBuffer,offset)


This gives 0xABCF, which is ANDed to give 0xABC0. Good.


 h1=struct.unpack_from('h',diskBuffer,offset+1)


This gives 0xDECF, which is ANDed to give 0xDEC0. Not what you want.


 words.append(h0[0]  0xfff0)
 words.append(h1[0]  0xfff0)
 offset+=3
   return words

I unpack the samples in an array of unsigned shorts for I later can use the 
byteswap() method
if the code is running on a big endian machine.

What options using pure python do I have to make the conversion faster?
I thought of unpacking more bytes at once e.g. using a format 'hxhxhxhx' for 4 
even samples
and 'xhxhxhxh' for 4 odd samples vice versa.


You could try using lookup tables to decode even-numbered and 
odd-numbered pairs of bytes.



Can I map the ' 0xfff0' to the whole array?


That's something the numpy could do.

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


Re: linux os.rename() not an actual rename?

2015-07-20 Thread Jon Ribbens
On 2015-07-20, Jason H jh...@gmx.com wrote:
 I have a server process that looks (watches via inotify)  for files
 to be moved (renamed) into a particular directory from elsewhere on
 the same filesystem. We do this because it is an atomic operation,
 and our server process can see the modify events of the file being
 written before it is closed. The rename functions as a 'completed'
 event.  We have a python script that attempts to perform this
 behavior - to os.rename() a file into the watched directory after it
 is done being written. However unlike other tools, we don't see a
 proper 'rename' event. Instead we just see a 'changed' event. I've
 changed the implementation of the script to os.system('mv ...') and
 we get the expected 'rename' event. 

 Is this known issue? Should I be seeing a proper rename event? The
 only mention in the docs about the rename behavior is that it is
 atomic, as required by POSIX. 

os.rename() should just be calling the operating system rename(2)
function. I think you must be doing something wrong.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: linux os.rename() not an actual rename?

2015-07-20 Thread Marko Rauhamaa
Jason H jh...@gmx.com:

 I have a server process that looks (watches via inotify) for files to
 be moved (renamed) into a particular directory from elsewhere on the
 same filesystem. We do this because it is an atomic operation, and our
 server process can see the modify events of the file being written
 before it is closed. The rename functions as a 'completed' event. We
 have a python script that attempts to perform this behavior - to
 os.rename() a file into the watched directory after it is done being
 written. However unlike other tools, we don't see a proper 'rename'
 event. Instead we just see a 'changed' event. I've changed the
 implementation of the script to os.system('mv ...') and we get the
 expected 'rename' event.

Don't know about inotify(). However, strace reveals that python3's
os.rename() performs a regular rename(2) system call.


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


[issue24675] Avoid DeprecationWarning in test_os

2015-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bc67e0030d42 by Victor Stinner in branch '3.4':
Issue #24675: Avoid DeprecationWarning in test_os
https://hg.python.org/cpython/rev/bc67e0030d42

--
nosy: +python-dev

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



Re: Does the Class UserGroup (issue 11588) exist for python 2.7 ?

2015-07-20 Thread Chris Angelico
On Mon, Jul 20, 2015 at 10:15 PM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 On 20/07/2015 12:27, CARANNANTE, MARTINE wrote:

 Hi
 Could you tell me if the Class UserGroup (method add_usage_group to
 support inclusive groups) exist for python 2.7 ?
 The patch that I found on internet is only for python 3.
 Thanks in advance for your answer
 Best regards
 *Martine Carannante
 *


 Almost certainly no as the patch has never been commited, which is why
 http://bugs.python.org/issue11588 is till open.  Even if the patch were
 committed there is no guarantee that the patch will be back ported to 2.7.

There's almost a guarantee that it will NOT be backported to 2.7,
actually; it looks like a completely new feature. But if you're
interested, you might be able to apply the patch to a backported
argparse, such as:

https://pypi.python.org/pypi/argparse

Or just patch your own local version, but that's a bit dodgier.

If you're willing to migrate your code to Python 3, and you want this
feature, post in the tracker issue; even better, help with testing the
patch. The patch was updated for Python 3.5 roughly a year ago, and I
suspect that that version will still work; the lack of response after
that suggests that nobody has the time to test it and make sure it
works in all cases.

Since argparse is written in Python, you don't even need to play
around with a C compiler to test this. It's a nice easy thing to play
with - have a shot!

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


[issue12978] Figure out extended attributes on BSDs

2015-07-20 Thread Billy Foster

Billy Foster added the comment:

Is there any chance of getting this finalized?  I have been using William Orr's 
patch as a workaround for months now, but it would be nice to not have to 
manually apply it each version bump...

--
nosy: +billyfoster

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



Re: linux os.rename() not an actual rename?

2015-07-20 Thread Christian Heimes
On 2015-07-20 20:50, Marko Rauhamaa wrote:
 Jason H jh...@gmx.com:
 
 I have a server process that looks (watches via inotify) for files to
 be moved (renamed) into a particular directory from elsewhere on the
 same filesystem. We do this because it is an atomic operation, and our
 server process can see the modify events of the file being written
 before it is closed. The rename functions as a 'completed' event. We
 have a python script that attempts to perform this behavior - to
 os.rename() a file into the watched directory after it is done being
 written. However unlike other tools, we don't see a proper 'rename'
 event. Instead we just see a 'changed' event. I've changed the
 implementation of the script to os.system('mv ...') and we get the
 expected 'rename' event.
 
 Don't know about inotify(). However, strace reveals that python3's
 os.rename() performs a regular rename(2) system call.

So does Python 2.7:

$ touch test
$ strace -e trace=file -- python -c 'import os; os.rename(test, test2)'
execve(/bin/python, [python, -c, import os; os.rename(\test\,
\te...], [/* 76 vars */]) = 0
access(/etc/ld.so.preload, R_OK) = -1 ENOENT (No such file or directory)
open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
...
rename(test, test2) = 0
+++ exited with 0 +++


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


Re: how to play

2015-07-20 Thread Ian Kelly
On Mon, Jul 20, 2015 at 10:29 AM, Aron Barsam aronbar...@gmail.com wrote:
 what is an 0S comand line?

What OS are you using? In Windows it's a program called Command
Prompt. In Mac OS X it's an application called Terminal. In Linux it's
usually called something like Terminal or xterm.

However, if you don't know how to use the CLI (command-line
interface), then you're probably better off using IDLE, a development
environment that is included with the Python installation and includes
an interactive interpreter. Just look for the IDLE program and run
that.
-- 
https://mail.python.org/mailman/listinfo/python-list


linux os.rename() not an actual rename?

2015-07-20 Thread Jason H
I have a server process that looks (watches via inotify)  for files to be moved 
(renamed) into a particular directory from elsewhere on the same filesystem. We 
do this because it is an atomic operation, and our server process can see the 
modify events of the file being written before it is closed. The rename 
functions as a 'completed' event.  We have a python script that attempts to 
perform this behavior - to os.rename() a file into the watched directory after 
it is done being written. However unlike other tools, we don't see a proper 
'rename' event. Instead we just see a 'changed' event. I've changed the 
implementation of the script to os.system('mv ...') and we get the expected 
'rename' event. 

Is this known issue? Should I be seeing a proper rename event? The only mention 
in the docs about the rename behavior is that it is atomic, as required by 
POSIX. 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24675] Avoid DeprecationWarning in test_os

2015-07-20 Thread STINNER Victor

STINNER Victor added the comment:

Thanks Martin. I applied your patch, but I replaced tearDown() with a cleanup 
function.

--
resolution:  - fixed
status: open - closed

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



Re: Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread edmondo . giovannozzi
Il giorno lunedì 20 luglio 2015 15:10:22 UTC+2, Peter Heitzer ha scritto:
 I am currently writing a python script to extract samples from old Roland 12 
 bit sample
 disks and save them as 16 bit wav files.
 
 The samples are layouted as follows
 
 0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0] [S1 bit 11..4]
 3 [S2 bit 11..4] [S2 bit 3..0|S3 bit 3..0] [S3 bit 11..4]
 
 In other words 
 sample0=(data[0]4)|(data[1]4)
 sample1=(data[2]4)|(data[1]  0x0f)
 
 I use this code for the conversion (using the struct module)
 
 import struct
 from array import array
 
 def getWaveData(diskBuffer):
   offset=0
   words=array('H')
   for i in range(len(diskBuffer)/3):
 h0=struct.unpack_from('h',diskBuffer,offset)
 h1=struct.unpack_from('h',diskBuffer,offset+1)
 words.append(h0[0]  0xfff0)
 words.append(h1[0]  0xfff0)
 offset+=3
   return words
 
 I unpack the samples in an array of unsigned shorts for I later can use the 
 byteswap() method
 if the code is running on a big endian machine.
 
 What options using pure python do I have to make the conversion faster?
 I thought of unpacking more bytes at once e.g. using a format 'hxhxhxhx' for 
 4 even samples
 and 'xhxhxhxh' for 4 odd samples vice versa.
 Can I map the ' 0xfff0' to the whole array?

I'll try to read the binary data with numpy.fromfile, reshape the array in 
[n,3] matrix, and then you can operate with the columns to get what you want.
:-)
 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Generating type annotations by tracing execution runs

2015-07-20 Thread Chris Angelico
On Mon, Jul 20, 2015 at 7:59 PM, Michael Williamson m...@zwobble.org wrote:
 I've knocked together a quick proof-of-concept that allows type
 annotations to be automatically added to Python source code by running
 it:

 https://github.com/mwilliamson/farthing

 As the code, such as a test suite, runs, the types of arguments and
 return values (for functions in the file/directory to be annotated) are
 stored. After the code has finished, appropriate annotations are added.
 (There's a tiny example in the README.rst in case that makes things a
 little clearer.)

Sounds to me like a type inference system. Can be pretty handy in some
codebases.

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


Re: how to play

2015-07-20 Thread sohcahtoa82
On Sunday, July 19, 2015 at 12:04:26 PM UTC-7, Aron Barsam wrote:
 i have trouble trying to play python please can you respond soon 

...

 play python

http://i.imgur.com/x2KwTbw.jpg
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread Peter Heitzer
MRAB pyt...@mrabarnett.plus.com wrote:
On 2015-07-20 14:10, Peter Heitzer wrote:
 I am currently writing a python script to extract samples from old Roland 12 
 bit sample
 disks and save them as 16 bit wav files.

 The samples are layouted as follows

 0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0] [S1 bit 11..4]
 3 [S2 bit 11..4] [S2 bit 3..0|S3 bit 3..0] [S3 bit 11..4]

 In other words
 sample0=(data[0]4)|(data[1]4)
 sample1=(data[2]4)|(data[1]  0x0f)

 I use this code for the conversion (using the struct module)

 import struct
 from array import array

 def getWaveData(diskBuffer):
offset=0
words=array('H')
for i in range(len(diskBuffer)/3):

If the 2 12-bit values are [0xABC, 0xDEF], the bytes will be [0xAB, 
0xCF, 0xDE].

  h0=struct.unpack_from('h',diskBuffer,offset)

This gives 0xABCF, which is ANDed to give 0xABC0. Good.

  h1=struct.unpack_from('h',diskBuffer,offset+1)

This gives 0xDECF, which is ANDed to give 0xDEC0. Not what you want.
You are right! It looked to me as if it was little endian, but only for the MSB.

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


Re: Generating type annotations by tracing execution runs

2015-07-20 Thread Paul Rubin
Chris Angelico ros...@gmail.com writes:
 As the code, such as a test suite, runs, the types of arguments and
 return values...
 Sounds to me like a type inference system. Can be pretty handy in some
 codebases.

I haven't tried it out yet but it sounds more like the type extraction
part of a JIT compiler, i.e. the types are collected from actual
execution traces rather than statically.  I think of type inference as
meaning syntactic inference at compile time.  
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue20792] Idle: test PathBrowser more

2015-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 61d7e6fe0003 by Terry Jan Reedy in branch '2.7':
Issue #20792: Expand idle_test.test_pathbowser. Tweak file.
https://hg.python.org/cpython/rev/61d7e6fe0003

New changeset 0220328f962c by Terry Jan Reedy in branch '3.4':
Issue #20792: Expand idle_test.test_pathbowser. Tweak file to not copy twice.
https://hg.python.org/cpython/rev/0220328f962c

--
nosy: +python-dev

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



[issue20792] Idle: test PathBrowser more

2015-07-20 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.6

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



[issue20792] Idle: test PathBrowser more

2015-07-20 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I only did the test_pathbrowser changes now.  I added an assert that failed in 
2.7 because Idle still defines some old-style classes not subclassing object.

The 'main' test had been rewriten as an htest.  Am leaving issue open to look 
at those changes another time.

--
stage:  - patch review

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



[issue4945] json checks True/False by identity, not boolean value

2015-07-20 Thread Mark Mikofski

Mark Mikofski added the comment:

This is effecting IronPython as well, because .NET objects return copies not 
references. If a .NET assembly method is called from IronPython, its return is 
a copy, not a reference. Therefore the reference of a boolean return is not the 
same as the internal Python reference for that boolean, and the JSON encoder 
doesn't recognize the value as a boolean, but instead  treats it as an integer, 
and returns `str(o)`, which for `True` is True and for `False` is False. 
Then the decoder can't interpret the JSON object because true and false are 
capitalize, which is not in its spec. :(

See my comment https://github.com/IronLanguages/main/issues/1033.

The patch would solve this problem. A copy of a boolean will be equal to  its 
value, ie False == False even if their references are not the same.

--
nosy: +bwanamarko

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



Re: linux os.rename() not an actual rename?

2015-07-20 Thread Jason H
 From: Christian Heimes christ...@python.org
 On 2015-07-20 20:50, Marko Rauhamaa wrote:
  Jason H jh...@gmx.com:
  
  I have a server process that looks (watches via inotify) for files to
  be moved (renamed) into a particular directory from elsewhere on the
  same filesystem. We do this because it is an atomic operation, and our
  server process can see the modify events of the file being written
  before it is closed. The rename functions as a 'completed' event. We
  have a python script that attempts to perform this behavior - to
  os.rename() a file into the watched directory after it is done being
  written. However unlike other tools, we don't see a proper 'rename'
  event. Instead we just see a 'changed' event. I've changed the
  implementation of the script to os.system('mv ...') and we get the
  expected 'rename' event.
  
  Don't know about inotify(). However, strace reveals that python3's
  os.rename() performs a regular rename(2) system call.
 
 So does Python 2.7:
 
 $ touch test
 $ strace -e trace=file -- python -c 'import os; os.rename(test, test2)'
 execve(/bin/python, [python, -c, import os; os.rename(\test\,
 \te...], [/* 76 vars */]) = 0
 access(/etc/ld.so.preload, R_OK) = -1 ENOENT (No such file or directory)
 open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
 ...
 rename(test, test2) = 0
 +++ exited with 0 +++

Hrm, provably, you're right. But I was seeing 'rename', then two 'changed' 
events on the dest name, but the last thing the process did was rename before 
it exited. 

I'll look into it some more now that I know python should be using the OS 
implementation of rename. 

Thanks everyone.

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


[issue23573] Avoid redundant allocations in str.find and like

2015-07-20 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 311a4d28631b by Serhiy Storchaka in branch '3.5':
Issue #23573: Restored optimization of bytes.rfind() and bytearray.rfind()
https://hg.python.org/cpython/rev/311a4d28631b

New changeset c06410c68217 by Serhiy Storchaka in branch 'default':
Issue #23573: Restored optimization of bytes.rfind() and bytearray.rfind()
https://hg.python.org/cpython/rev/c06410c68217

--

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



[issue24665] CJK support for textwrap

2015-07-20 Thread R. David Murray

R. David Murray added the comment:

Because to get proper unicode support, we wrote python3, and because handling 
anything other than single-character-width characters in textwrap is a new 
feature.

--
nosy: +r.david.murray
versions: +Python 3.6 -Python 2.7

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread Ronald Oussoren

Ronald Oussoren added the comment:

The patch I attached earlier is for the default branch. More work is needed for 
the other active branches.

--

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



Re: Procedure for downloading and Installing Python 2.7 Modules

2015-07-20 Thread Steven D'Aprano
On Mon, 20 Jul 2015 08:14 am, W. D. Allen wrote:

 Would like to locate and install numpy, scipy and matplotlib
 with Wing 101 for Python 2.7


Wing is an IDE, that is, a fancy editor. As far as I know, you shouldn't
have to take any special steps to get numpy etc. working with Wing, you
just install them in the usual fashion.

Do you need help with installing Python packages?

If you have pip installed, you can just type:

pip install numpy scipy matplotlib

from your *operating system* command prompt. Not the Python shell! On Linux,
you would open a terminal and you should see a prompt that ends with a $
sign. On Windows, you run cmd.exe or command.com or whatever it is called,
I forget. If you see a prompt  then you're in the Python shell and pip
won't work.

However, installing numpy and scipy from scratch like this is often
difficult on Windows, as you need access to a Fortran or C compiler. Many
people prefer to use a Python environment that has numpy etc. already
pre-installed. Start here:

https://courses.p2pu.org/he/groups/scientific-python/content/setting-up-a-scientific-python-environment/

Does this help? Feel free to reply to the group with any follow up
questions.


-- 
Steven

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


[issue24676] Error in pickle using cProfile

2015-07-20 Thread Erick Fonseca

New submission from Erick Fonseca:

cPickle raises a PicklingError when trying to pickle an instance of a class 
defined in a module being profiled with cProfile.

Example code:

import cPickle

class A(object):
pass

a = A()
with open('file.dat', 'wb') as f:
cPickle.dump(a, f)

Running the above example with python -m cProfile resulted in 

cPickle.PicklingError: Can't pickle class '__main__.A': attribute lookup 
__main__.A failed

I'm not sure if this is the intended behavior (I suppose __main__ in this case 
refers to the cProfile module file), but I googled it and couldn't find 
anything. I noticed this problem in Ubuntu 14.04 and Windows 8.1, both with 
Python 2.7.

--
components: Extension Modules
messages: 247006
nosy: Erick Fonseca
priority: normal
severity: normal
status: open
title: Error in pickle using cProfile
type: crash
versions: Python 2.7

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



[issue24658] open().write() fails on 2 GB+ data (OS X)

2015-07-20 Thread Mali Akmanalp

Mali Akmanalp added the comment:

I don't know how helpful it is at this point, but the issue happens while 
reading also.

Here's some related discussion in the numpy tracker:

https://github.com/numpy/numpy/issues/3858 (The claim was that OSX Mavericks 
fixed this issue, it didn't, and there is an Apple bug ID in there somewhere, 
plus there is a link to a patch the torch folks used)

and also in pandas: https://github.com/pydata/pandas/issues/10641

I'd be happy to try to test patches out.

--
nosy: +Mali Akmanalp

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



[issue24665] CJK support for textwrap

2015-07-20 Thread R. David Murray

R. David Murray added the comment:

The problem is (if I'm understanding this correctly, which I may not be, I'm 
not a unicode expert) is that how you compute and manipulate CJK characters in 
python2 differs depending on whether you are dealing with a wide build or a 
narrow build.  And the fact that python3 doesn't handle it either is why this 
would be a new feature (see the referenced issues).

But I could be wrong.  I leave it to the unicode experts.

--
components: +Unicode
nosy: +ezio.melotti, haypo

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



Re: Procedure for downloading and Installing Python 2.7 Modules

2015-07-20 Thread Mark Lawrence

On 19/07/2015 23:14, W. D. Allen wrote:

Would like to locate and install numpy, scipy and matplotlib
with Wing 101 for Python 2.7

Just beginning to use Python 2.7 for engineering work.

Any guidance would be appreciated.

Thanks,

WDA
balle...@gmail.com

end



Just use pip from the command line for your OS.

It might even be that:-

pip install scipy

grabs everything that you've asked for above, why not try it and see?

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


[issue24665] CJK support for textwrap

2015-07-20 Thread Florent Gallaire

Florent Gallaire added the comment:

FUD about Python here is something I wasn't expecting.

Python 2 supports Unicode and is still used a lot by a lot of people.

CJK people are not subhumans, so don't support CJK is something called, wait... 
a bug ! And it's a shame that it was not fixed earlier.

Python 3 has this bug too, so it's not really what I would call a proper 
unicode support.

--

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



Re: Fast 12 bit to 16 bit sample conversion?

2015-07-20 Thread Mark Lawrence

On 20/07/2015 14:10, Peter Heitzer wrote:

I am currently writing a python script to extract samples from old Roland 12 
bit sample
disks and save them as 16 bit wav files.

The samples are layouted as follows

0 [S0 bit 11..4] [S0 bit 3..0|S1 bit 3..0] [S1 bit 11..4]
3 [S2 bit 11..4] [S2 bit 3..0|S3 bit 3..0] [S3 bit 11..4]

In other words
sample0=(data[0]4)|(data[1]4)
sample1=(data[2]4)|(data[1]  0x0f)

I use this code for the conversion (using the struct module)

import struct
from array import array

def getWaveData(diskBuffer):
   offset=0
   words=array('H')
   for i in range(len(diskBuffer)/3):
 h0=struct.unpack_from('h',diskBuffer,offset)
 h1=struct.unpack_from('h',diskBuffer,offset+1)
 words.append(h0[0]  0xfff0)
 words.append(h1[0]  0xfff0)
 offset+=3
   return words

I unpack the samples in an array of unsigned shorts for I later can use the 
byteswap() method
if the code is running on a big endian machine.

What options using pure python do I have to make the conversion faster?


By pure python I'm assuming you mean part of the stdlib.

Referring to https://wiki.python.org/moin/PythonSpeed/PerformanceTips 
you could end with something like this (untested).


def getWaveData(diskBuffer):
offset = 0
words = array('H')
wx = words.extend #saves two lookups and a function call
su = struct.unpack_from #saves two lookups
# 'i' not used in the loop so throw it away
for _ in range(len(diskBuffer)/3): # use xrange on Python 2
h0 = su('h',diskBuffer,offset)
h1 = su('h',diskBuffer,offset+1)
wx((h0[0]  0xfff0), (h1[0]  0xfff0)) # MRAB pointed out a 
problem with the masking in the second section???

offset += 3
return words


I thought of unpacking more bytes at once e.g. using a format 'hxhxhxhx' for 4 
even samples
and 'xhxhxhxh' for 4 odd samples vice versa.


If that reduces the number of times around the loop why not?  Combine it 
with MRAB's suggestion of lookups and I'd guess you'd get a speedup, but 
knowing Python I'm probably way out on that?  There's only one way to 
find out.


I'm also thinking that you could user one of the itertools functions or 
recipes to grab the data and hence simplify the loop even more, but it's 
now 3:45 BST, so I can't think straight, hence bed.



Can I map the ' 0xfff0' to the whole array?


If it works :)

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

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


Can I copy/paste Python code?

2015-07-20 Thread ryguy7272
I'm trying to copy some Python code from a PDF book that I'm reading.  I want 
to test out the code, and I can copy it, but when I paste it into the Shell, 
everything is all screwed up because of the indentation. Every time I paste in 
any kind of code, it seems like everything is immediately left-justified, and 
then nothing works.

Any idea how to make this work easily?  Without re-typing hundreds of lines of 
code...

Thanks to all.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24676] Error in pickle using cProfile

2015-07-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The same is with profile, pickle and in 3.x. May be profile should set 
sys.modules['__main__']?

--
components: +Library (Lib) -Extension Modules
nosy: +georg.brandl, serhiy.storchaka
type: crash - behavior
versions: +Python 3.4, Python 3.5, Python 3.6

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



Re: Can't Install Pandas

2015-07-20 Thread ryguy7272
On Sunday, July 19, 2015 at 11:05:46 PM UTC-4, ryguy7272 wrote:
 Hello experts.  I odwnloaded Pandas, and put it here.
 C:\Python34\Scripts\pandas-0.16.2
 
 Then, I ran this in what most people call the c-prompt, but I call it the 
 'Python 3.4.3 Shell'
 C:\Python34\Scripts\pandas-0.16.2 pip install 'setup.py' 
 
 It seems like everything ran fine, so I try this.
 import pandas as pd
 
 Then I get this error.
 Traceback (most recent call last):
   File pyshell#12, line 1, in module
 import pandas as pd
 ImportError: No module named 'pandas'
 
 Any idea what I'm doing wrong?
 
 
 I tried to follow the instructions here.
 https://pip.pypa.io/en/latest/installing.html
 
 
 That doesn't work either.
 python get-pip.py
 SyntaxError: invalid syntax
 
 I won't even ask the most obvious question, because I guess it's impossible 
 to do.  Rather, can someone please help me to get this working?
 
 Thanks.

Ok.  Back to the basics.
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Can't Install Pandas

2015-07-20 Thread Chris Angelico
On Tue, Jul 21, 2015 at 12:51 PM, ryguy7272 ryanshu...@gmail.com wrote:
 On Sunday, July 19, 2015 at 11:05:46 PM UTC-4, ryguy7272 wrote:
 Hello experts.  I odwnloaded Pandas, and put it here.
 C:\Python34\Scripts\pandas-0.16.2

 Then, I ran this in what most people call the c-prompt, but I call it the 
 'Python 3.4.3 Shell'
 C:\Python34\Scripts\pandas-0.16.2 pip install 'setup.py'

 It seems like everything ran fine, so I try this.
 import pandas as pd

 Then I get this error.
 Traceback (most recent call last):
   File pyshell#12, line 1, in module
 import pandas as pd
 ImportError: No module named 'pandas'

 Any idea what I'm doing wrong?


 I tried to follow the instructions here.
 https://pip.pypa.io/en/latest/installing.html


 That doesn't work either.
 python get-pip.py
 SyntaxError: invalid syntax

 I won't even ask the most obvious question, because I guess it's impossible 
 to do.  Rather, can someone please help me to get this working?

 Thanks.

 Ok.  Back to the basics.
 Thanks.

If by basics you mean this, then yes.

http://www.catb.org/esr/faqs/smart-questions.html

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


Re: Can I copy/paste Python code?

2015-07-20 Thread Chris Angelico
On Tue, Jul 21, 2015 at 12:49 PM, ryguy7272 ryanshu...@gmail.com wrote:
 I'm trying to copy some Python code from a PDF book that I'm reading.  I want 
 to test out the code, and I can copy it, but when I paste it into the Shell, 
 everything is all screwed up because of the indentation. Every time I paste 
 in any kind of code, it seems like everything is immediately left-justified, 
 and then nothing works.

 Any idea how to make this work easily?  Without re-typing hundreds of lines 
 of code...

Sounds like a flaw in the PDF - it creates indentation in some way
other than leading spaces/tabs. See if the PDF has a corresponding
file of ready-to-go code, that might save you some trouble.

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


Is there a way to install ALL Python packages?

2015-07-20 Thread ryguy7272
I'd like to install ALL Python packages on my machine.  Even if it takes up 
4-5GB, or more, I'd like to get everything, and then use it when I need it.  
Now, I'd like to import packages, like numpy and pandas, but nothing will 
install.  I figure, if I can just install everything, I can simply use it when 
I need it, and if I don't need it, then I just won't use it.

I know R offers this as an option.  I figure Python must allow it too.

Any idea  how to grab everything?

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Rick Johnson
On Sunday, July 19, 2015 at 9:17:11 PM UTC-5, Rustom Mody wrote:


 List of python committers:
 -
  11081 Guido van Rossum
 [snip: long list]

Thanks for posting this list of names. I had put in a pyFOIA
request for this data a few years ago, but to my surprise, was
flat out denied. I'm not sure how exhaustive this list may be,
but publicly displaying the commit hierarchy within the Python
community is very import for those who may want to get involved.

[Talking to Mark Lawrence, Rustom said:]
 So... May I humbly ask where are your precious commits??

Thanks for putting Mark in his place. He has been brow
beating folks on this list (myself included) for years, and
i'll bet he now feels as tiny as D'Aprano did -- when GvR
scolded him for disrespecting a Noob on Python-ideas.

  Yeah, i was watching! 

  I'M *ALWAYS* WATCHING!

  ಠ_ಠ

Now that Mark's lack of commit cred has been exposed, we can
safely ignore his hollow and hypocritical bullying. And now
that he has been de-fanged, he will be forced to seek employment
elsewhere. Hmm, my suggestion is that he market himself as an
on-call peanut butter removal service. A venture that will
no doubt be successful, seeing that he has two heads up on
his competition! 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to install ALL Python packages?

2015-07-20 Thread Chris Angelico
On Tue, Jul 21, 2015 at 12:57 PM, ryguy7272 ryanshu...@gmail.com wrote:
 I'd like to install ALL Python packages on my machine.  Even if it takes up 
 4-5GB, or more, I'd like to get everything, and then use it when I need it.  
 Now, I'd like to import packages, like numpy and pandas, but nothing will 
 install.  I figure, if I can just install everything, I can simply use it 
 when I need it, and if I don't need it, then I just won't use it.

 I know R offers this as an option.  I figure Python must allow it too.

 Any idea  how to grab everything?


pip install `wget https://pypi.python.org/simple/ -qO- |html2text`

Then figure out if there are any conflicts.

And make sure you stay up-to-date as packages get new versions released.

Good luck.

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


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Rustom Mody
On Tuesday, July 21, 2015 at 8:34:30 AM UTC+5:30, Rick Johnson wrote:
 On Sunday, July 19, 2015 at 9:17:11 PM UTC-5, Rustom Mody wrote:
 
 
  List of python committers:
  -
   11081 Guido van Rossum
  [snip: long list]
 
 Thanks for posting this list of names. I had put in a pyFOIA
 request for this data a few years ago, but to my surprise, was
 flat out denied. I'm not sure how exhaustive this list may be,
 but publicly displaying the commit hierarchy within the Python
 community is very import for those who may want to get involved.
 
 [Talking to Mark Lawrence, Rustom said:]
  So... May I humbly ask where are your precious commits??
 
 Thanks for putting Mark in his place. He has been brow
 beating folks on this list (myself included) for years, and
 i'll bet he now feels as tiny as D'Aprano did -- when GvR
 scolded him for disrespecting a Noob on Python-ideas.
 
   Yeah, i was watching! 
 
   I'M *ALWAYS* WATCHING!
 
   ಠ_ಠ
 
 Now that Mark's lack of commit cred has been exposed, we can
 safely ignore his hollow and hypocritical bullying. And now
 that he has been de-fanged, he will be forced to seek employment
 elsewhere. Hmm, my suggestion is that he market himself as an
 on-call peanut butter removal service. A venture that will
 no doubt be successful, seeing that he has two heads up on
 his competition!

Hey Rick!
Lets have a useful discussion
And cut the rhetoric
Please

[Chris already showed that this list is inaccurate -- probably related 
to hg not having sighoff distinct from commit like git]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a way to install ALL Python packages?

2015-07-20 Thread Rustom Mody
On Tuesday, July 21, 2015 at 8:47:29 AM UTC+5:30, Chris Angelico wrote:
 On Tue, Jul 21, 2015 at 12:57 PM, ryguy7272  wrote:
  I'd like to install ALL Python packages on my machine.  Even if it takes up 
  4-5GB, or more, I'd like to get everything, and then use it when I need it. 
   Now, I'd like to import packages, like numpy and pandas, but nothing will 
  install.  I figure, if I can just install everything, I can simply use it 
  when I need it, and if I don't need it, then I just won't use it.
 
  I know R offers this as an option.  I figure Python must allow it too.
 
  Any idea  how to grab everything?
 
 
 pip install `wget https://pypi.python.org/simple/ -qO- |html2text`
 
 Then figure out if there are any conflicts.
 
 And make sure you stay up-to-date as packages get new versions released.
 
 Good luck.
 
 ChrisA

Dear Sir,

This is to inform you we have just received your application which is being 
duly considered.

Office of Bofh
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Should non-security 2.7 bugs be fixed?

2015-07-20 Thread Chris Angelico
On Tue, Jul 21, 2015 at 1:15 PM, Rustom Mody rustompm...@gmail.com wrote:
 [Chris already showed that this list is inaccurate -- probably related
 to hg not having sighoff distinct from commit like git]

It's also the manner of workflow. If you want to accept patches and
have them acknowledged to their original authors, the patches need to
carry metadata identifying the authors. I went to the tracker and hit
Random Issue and got one with an attached file as the first hit:

http://bugs.python.org/issue12982
http://bugs.python.org/file26008/issue12982.diff

Repeated the exercise and won again:

http://bugs.python.org/issue4733
http://bugs.python.org/file12437/urlopen_text.diff

Notice how the patch files start straight in with content. There's no
authorship information retained.

By comparison, a patch created with 'git format-patch' and applied
with 'git am' starts with RFC 822 headers, provides a commit message,
and generally is intended as a way of transmitting a *commit*, rather
than simply some changes. I'm not overly familiar with Mercurial
workflows, but I think 'hg export' and 'hg import' give the same sort
of information; I tried on CPython and got this:

# HG changeset patch
# User Robert Collins rbtcoll...@hp.com
# Date 1436838700 -43200
#  Tue Jul 14 13:51:40 2015 +1200
# Branch 3.5
# Node ID 7021d46c490e8d9d3422737c69980dc1602f90db
# Parent  0127b0cad5ecb83c39ce58a4be27bf6d43a78d91
Issue #23661: unittest.mock side_effects can now be exceptions again.

This was a regression vs Python 3.4. Patch from Ignacio Rossi

diff -r 0127b0cad5ec -r 7021d46c490e Lib/unittest/mock.py
--- a/Lib/unittest/mock.py  Sat Jul 11 16:33:39 2015 -0700
+++ b/Lib/unittest/mock.py  Tue Jul 14 13:51:40 2015 +1200
@@ -506,7 +506,8 @@
 if delegated is None:

(chomp actual details)

Whether it's possible to have authorship retained or not, though, a
lot of patches can logically be credited to multiple people. Whose
name goes on it? With the CPython workflow, it's always the core
committer who applied it, nobody else. (That's consistent, at least.)
So the names in the log are of the people who have write access to the
repo, and nobody else.

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


Re: Devanagari int literals [was Re: Should non-security 2.7 bugs be fixed?]

2015-07-20 Thread Rustom Mody
On Sunday, July 19, 2015 at 10:15:37 AM UTC+5:30, Steven D'Aprano wrote:
  JFTR: My kids (um... students) have just managed to add devanagari
  numerals to python.
  ie we can now do
  
  १ + २
  3
 
 That is actually quite awesome, and I would support a new feature that set
 the numeric characters to a particular script, e.g. Latin, Arabic,
 Devanagari, whatever, and printed them in that same script. It seems
 unfortunate that १ + २ prints as 3 rather than ३.

BTW my boys have just mailed me their latest:

 九.九九

9.99

Can some unicode/Chinese literate person inform me whether
that ideograph is equivalent to roman '9' or roman 'nine'?
-- 
https://mail.python.org/mailman/listinfo/python-list


  1   2   >