[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: `x != ''` emits BytesWarning if x is bytes. 'encode' attribute is not needed for URL parsing. any() is slower that a `for` loop. I would suggest to look at efficient os.path implementations. -- nosy: +serhiy.storchaka

[issue26847] filter docs unclear wording

2016-04-25 Thread Georg Brandl
Georg Brandl added the comment: You didn't test your examples: >>> [] == False False False is not equal to the "empty value" of any other type than other numeric types. (This is mostly because of how booleans were originally introduced to Python.) "is false", on the other hand, is the

Python email issues

2016-04-25 Thread pannis2013
Hi, I am trying send email through smtplib import smtplib import os from libs import send_mail_status send_mail_status('test', False, 'ABCD', os.getcwd()) libs.py has a function as below: def send_status_mail(name, success, id, dir): #SERVER = "localhost" FROM = "localhost" TO =

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Jack O'Connor
Jack O'Connor added the comment: Related: The asyncio communicate() method differs from standard subprocess in how it treats input bytes when stdin is (probably mistakenly) not set to PIPE. Like this: proc = await create_subprocess_shell("sleep 5") await proc.communicate(b"foo") #

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Jack O'Connor
Jack O'Connor added the comment: Thanks for the heads up, Berker, I've re-submitted the PR as https://github.com/python/asyncio/pull/335. -- ___ Python tracker

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: python/cpython is a semi-official read-only mirror of hg.python.org/cpython. We haven't switched to GitHub yet. You may want to open a pull request to https://github.com/python/asyncio See https://github.com/python/asyncio/wiki/Contributing for details.

[issue26848] asyncio.subprocess's communicate() method mishandles empty input bytes

2016-04-25 Thread Jack O'Connor
New submission from Jack O'Connor: Setting stdin=PIPE and then calling communicate(b"") should close the child's stdin immediately, similar to stdin=DEVNULL. Instead, communicate() treats b"" like None and leaves the child's stdin open, which makes the child hang forever if it tries to read

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Luiz Poleto
Luiz Poleto added the comment: As discussed on the Mentors list, the attached patch (issue22234_37.patch) changes the urlparse function to handle non-str and non-bytes arguments and adds a new test case for it. -- Added file: http://bugs.python.org/file42592/issue22234_37.patch

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2016-04-25 Thread Luiz Poleto
Luiz Poleto added the comment: As discussed on the Mentors list, the attached patch (issue22234_36.patch) includes the deprecation warning (and related test) on the urlparse function. -- keywords: +patch versions: +Python 3.6 -Python 3.4 Added file:

[issue26847] filter docs unclear wording

2016-04-25 Thread Luke
Luke added the comment: josh, we're saying the same thing but misunderstanding each other. :) I realize that they can be empty containers, etc., and that's why I think "equal to False" is appropriate -- because those things *are* equal to False: >>> [] == False True >>> 0 == False True etc.

[issue26847] filter docs unclear wording

2016-04-25 Thread Josh Rosenberg
Josh Rosenberg added the comment: That's why lower case "false" is used, not "False"; the former is the loose definition, the latter is the strict singleton. -- ___ Python tracker

[issue26847] filter docs unclear wording

2016-04-25 Thread Josh Rosenberg
Josh Rosenberg added the comment: "are equal to False" would be wrong though. Any "falsy" value is preserved by filterfalse, and removed by filter. They need not be equal to False (the bool singleton); empty containers (e.g. (), [], {}, "") are all considered false, and behave as such,

[issue26847] filter docs unclear wording

2016-04-25 Thread Luke
New submission from Luke: The current docs for both filter and itertools.filterfalse use the following wording (emphasis added): all elements that are false are removed returns the items that are false This could be confusing for a new Python programmer, because the actual behaviour is that

[issue26039] More flexibility in zipfile write interface

2016-04-25 Thread Martin Panter
Martin Panter added the comment: I understand Python’s zipfile module does not allow reading unless seek() is supported (this was one of Марк’s complaints). So it is irrelevant whether we are writing. I left a few comments, but it sounds like it is valid read and write at the same time.

Re: Python path and append

2016-04-25 Thread Dan Sommers
On Tue, 26 Apr 2016 11:51:23 +1000, Steven D'Aprano wrote: > ... (Possible a few very old operating systems on supercomputers from > the 1970s or 80s may have supported inserting... I seem to recall that > VMS may have allowed that... but don't quote me.) Some [non-supercomputer]

Re: Python path and append

2016-04-25 Thread Steven D'Aprano
On Tue, 26 Apr 2016 08:04 am, Seymore4Head wrote: > BTW I was trying to use a line like yours that used an output file > that didn't exist and was getting an error.  I assume that import os > fixes that. Why would you assume that? "Doctor, I have a problem with my arm, but I won't tell you

Re: Python path and append

2016-04-25 Thread Steven D'Aprano
On Tue, 26 Apr 2016 05:00 am, Seymore4Head wrote: > I was reading that. I have read it before. I don't use python enough > to even remember the simple stuff. Then when I try to use if for > something simple I forget how. It is perfectly fine to forget things that you read weeks or months

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

2016-04-25 Thread Anthony Sottile
Anthony Sottile added the comment: I have a hunch that this fix here may be causing this: https://github.com/spotify/dh-virtualenv/issues/148 Minimally: echo 'from setuptools import setup; setup(name="demo")' > setup.py echo 'import pytest' > tests/__init__.py $ python setup.py test running

Re: Python path and append

2016-04-25 Thread Chris Angelico
On Tue, Apr 26, 2016 at 7:26 AM, John Gordon wrote: > It's much easier to create a new file and then rename it afterwards, > instead of rewriting the original file. And more importantly, it's safer. If anything happens to your process while it's doing its work, you'll have a

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-25 Thread Stefan Krah
Changes by Stefan Krah : -- assignee: -> skrah components: +Build -Cross-Build nosy: +skrah resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4, Python 3.5 ___ Python tracker

[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: We don't support Android officially yet, but I think until #8610 is resolved something must be done here. -- ___ Python tracker

[issue22747] Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset ad6be34ce8c9 by Stefan Krah in branch 'default': Issue #22747: Workaround for systems without langinfo.h. https://hg.python.org/cpython/rev/ad6be34ce8c9 -- nosy: +python-dev ___ Python tracker

[issue20306] Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0d74d4937ab9 by Stefan Krah in branch 'default': Issue #20306: The pw_gecos and pw_passwd fields are not required by POSIX. https://hg.python.org/cpython/rev/0d74d4937ab9 -- nosy: +python-dev ___ Python

Re: Python path and append

2016-04-25 Thread Seymore4Head
On Mon, 25 Apr 2016 21:26:34 + (UTC), John Gordon wrote: >In <27nshbp40p1llr231dqm31p754tvurk...@4ax.com> Seymore4Head > writes: > >> On Tue, 19 Apr 2016 18:29:38 -0400, Seymore4Head >> wrote: > >> I am going to

Re: Python path and append

2016-04-25 Thread Peter Otten
Random832 wrote: > On Mon, Apr 25, 2016, at 16:15, Seymore4Head wrote: >> Thanks for the tip. >> >> Still broke. :( >> >> f = open('wout.txt', 'r+') >> for line in f: >> if line=="": >> exit >> line=line[:-1] >> line=line+" *" >> f.write(line) >> print line >>

Re: Python path and append

2016-04-25 Thread John Gordon
In <27nshbp40p1llr231dqm31p754tvurk...@4ax.com> Seymore4Head writes: > On Tue, 19 Apr 2016 18:29:38 -0400, Seymore4Head > wrote: > I am going to forget using a directory path. > I would like to take the file win.txt and append a

[issue9400] multiprocessing.pool.AsyncResult.get() messes up exceptions

2016-04-25 Thread Martin Dengler
Changes by Martin Dengler : ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-25 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___

Re: Python path and append

2016-04-25 Thread Seymore4Head
I am using a test file that is only 3 lines: Punjabi .Mp3 Big Lake (DVD) SWV.avi Blue Balloon.AHC.RH.mkv The program correctly appends an * to the end of the line, but then it goes into a loop printing random looking stuff. f = open('wout.txt', 'r+') for line in f: if line=="": exit

[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset fae01d14dd4e by Stefan Krah in branch 'default': Issue #26846: Workaround for non-standard stdlib.h on Android. https://hg.python.org/cpython/rev/fae01d14dd4e -- nosy: +python-dev ___ Python tracker

[issue26846] Workaround for non-standard stdlib.h on Android

2016-04-25 Thread Stefan Krah
New submission from Stefan Krah: Android's stdlib.h pollutes the namespace by including a memory.h header. -- assignee: skrah components: Build messages: 264199 nosy: skrah, xdegaye priority: normal severity: normal status: open title: Workaround for non-standard stdlib.h on Android

Re: Question on List processing

2016-04-25 Thread Matt Wheeler
On Mon, 25 Apr 2016 15:56 , wrote: > Dear Group, > > I have a list of tuples, as follows, > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA > philanthropic/NA activities/NA ','class1')", u"('koteeswaram/BHPERSN is/NA > a/NA very/NA nice/NA

Re: Python path and append

2016-04-25 Thread Random832
On Mon, Apr 25, 2016, at 16:15, Seymore4Head wrote: > Thanks for the tip. > > Still broke. :( > > f = open('wout.txt', 'r+') > for line in f: > if line=="": > exit > line=line[:-1] > line=line+" *" > f.write(line) > print line > f.close() Your problem is that after

Re: Python path and append

2016-04-25 Thread Seymore4Head
Thanks for the tip. Still broke. :( f = open('wout.txt', 'r+') for line in f: if line=="": exit line=line[:-1] line=line+" *" f.write(line) print line f.close() I did notice that it wrote the 3 lines of test file but it didn't append the * after the third entry

[issue26833] returning ctypes._SimpleCData objects from callbacks

2016-04-25 Thread SilentGhost
Changes by SilentGhost : -- components: +ctypes nosy: +amaury.forgeotdarc, belopolsky, meador.inge ___ Python tracker ___

[issue26845] Misleading variable name in exception handling

2016-04-25 Thread ProgVal
New submission from ProgVal: In Python/errors.c, PyErr_Restore is defined this way: void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback) In Python/ceval.c, in the END_FINALLY case, it is called like this: PyErr_Restore(status, exc, tb); I believe “exc” should be renamed

Re: Python path and append

2016-04-25 Thread MRAB
On 2016-04-25 20:08, Joaquin Alzola wrote: Strip() = white spaces. Description The method strip() returns a copy of the string in which all chars have been stripped from the beginning and the end of the string (default whitespace characters). Use to remove return carriage--> line[:-1] 1. In

[issue17905] Add check for locale.h

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: I think all locale includes are unguarded now. -- ___ Python tracker ___ ___

[issue17905] Add check for locale.h

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset cc501d439239 by Stefan Krah in branch 'default': Issue #17905: Do not guard locale include with HAVE_LANGINFO_H. https://hg.python.org/cpython/rev/cc501d439239 -- nosy: +python-dev ___ Python tracker

Re: Python path and append

2016-04-25 Thread Rob Gaddi
Seymore4Head wrote: > On Mon, 25 Apr 2016 18:24:02 - (UTC), Rob Gaddi > wrote: > >>Seymore4Head wrote: >> >>> On Tue, 19 Apr 2016 18:29:38 -0400, Seymore4Head >>> wrote: >>> >>> I am going to forget using a directory path. >>>

[issue17905] Add check for locale.h

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: Okay, closing as a duplicate (the second patch here that checks for locale.h seems too broad to me since it's a standard header). -- nosy: +skrah resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Interpreter fails in

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: Thank you, closing this. -- resolution: -> out of date stage: -> resolved status: open -> closed versions: +Python 3.6 -Python 3.4 ___ Python tracker

RE: Python path and append

2016-04-25 Thread Joaquin Alzola
Strip() = white spaces. Description The method strip() returns a copy of the string in which all chars have been stripped from the beginning and the end of the string (default whitespace characters). Use to remove return carriage--> line[:-1] -Original Message- From: Python-list

Re: Python path and append

2016-04-25 Thread Seymore4Head
On Mon, 25 Apr 2016 18:24:02 - (UTC), Rob Gaddi wrote: >Seymore4Head wrote: > >> On Tue, 19 Apr 2016 18:29:38 -0400, Seymore4Head >> wrote: >> >> I am going to forget using a directory path. >> I would like to take the file

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added comments on Rietveld (follow the "review" link beside the patch link). -- assignee: -> serhiy.storchaka ___ Python tracker

Re: Python path and append

2016-04-25 Thread Rob Gaddi
Seymore4Head wrote: > On Tue, 19 Apr 2016 18:29:38 -0400, Seymore4Head > wrote: > > I am going to forget using a directory path. > I would like to take the file win.txt and append a space and the * > symbol. > > f = open('win.txt', 'r+') > for line in f: >

Re: Python path and append

2016-04-25 Thread Seymore4Head
On Tue, 19 Apr 2016 18:29:38 -0400, Seymore4Head wrote: I am going to forget using a directory path. I would like to take the file win.txt and append a space and the * symbol. f = open('win.txt', 'r+') for line in f: f.read(line) f.write(line+" *") This

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > If yes, maybe we should start with a module on PyPI. Is there a volunteer to > try this option? bitsets – ordered subsets over a predefined domain bitarray – efficient boolean array implemented as C extension bitstring – pure-Python bit string based on

Re: Scraping email to make invoice

2016-04-25 Thread Grant Edwards
On 2016-04-25, Michael Torrie wrote: > On 04/25/2016 08:39 AM, Grant Edwards wrote: >> Your normal gmail password is used for IMAP. > > Actually, no, unless you explicitly tell Google to allow "less-secure" > authentication. Otherwise you are required to set up a special, >

[issue9998] ctypes find_library should search LD_LIBRARY_PATH on linux

2016-04-25 Thread Vinay Sajip
Vinay Sajip added the comment: > Does anyone have any valid use cases where they want to use a shared library > on LD_LIBRARY_PATH or similar I presume that would include this issue's creator and other people who have commented here about what they see as a drawback in find_library's current

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread Gregory P. Smith
Gregory P. Smith added the comment: I have wanted bytes/bytearray bit operations (be sure to include the in place operators for bytearray) when using micropython where it is normal to be operating on binary data. that said, i'd need someone from micropython to chime in as to if they can

Re: Scraping email to make invoice

2016-04-25 Thread Michael Torrie
On 04/25/2016 08:39 AM, Grant Edwards wrote: > Your normal gmail password is used for IMAP. Actually, no, unless you explicitly tell Google to allow "less-secure" authentication. Otherwise you are required to set up a special, application-specific password.

[issue26842] Python Tutorial 4.7.1: Need to explain default parameter lifetime

2016-04-25 Thread Edward Segall
Edward Segall added the comment: I agree with most of your points: A tutorial should be brief and should not go down rabbit holes. Expanded discussion of default parameter behavior would probably fit better with the other facets of parameter speceification and parameter passing, perhaps as a

[issue26844] Wrong error message during import

2016-04-25 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: -> brett.cannon ___ Python tracker ___ ___

Re: Question on List processing

2016-04-25 Thread Steven D'Aprano
On Tue, 26 Apr 2016 12:56 am, subhabangal...@gmail.com wrote: > Dear Group, > > I have a list of tuples, as follows, > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA [... 17 more lines of data ...] Hi Subhabrata, and thanks for the question. Please remember that we

HOT REQ Closable Position :Websphere message broker at Edison, NJ

2016-04-25 Thread sourav524 . itscient
Hello Associates, Please go through the below job description and let me know your interest. Please revert me: soura...@itscient.com or sourav524.itsci...@gmail.com. Position: Websphere Message Broker Location:Edison , NJ Duration: 6+ MONTHS Requisition Details: Engineer with experience on

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread Guido van Rossum
Guido van Rossum added the comment: Can you point to some examples of existing code that would become more readable and faster when this feature exists? Separately, how is it more secure? On Mon, Apr 25, 2016 at 9:17 AM, cowlicks wrote: > > cowlicks added the comment:

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread STINNER Victor
STINNER Victor added the comment: > I like to add the bitwise protocol between byte objects of equal length Would it make sense to add such operators in a new module like the existing (but deprecated) audioop module? If yes, maybe we should start with a module on PyPI. Is there a volunteer to

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Senthil Kumaran
Senthil Kumaran added the comment: This is fixed in all versions of Python. Thank you for your contribution, Hans-Peter Jansen. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset c502deb19cb0 by Senthil Kumaran in branch '2.7': backport fix for Issue #26804. https://hg.python.org/cpython/rev/c502deb19cb0 -- ___ Python tracker

[issue19251] bitwise ops for bytes of equal length

2016-04-25 Thread cowlicks
cowlicks added the comment: To reiterate, this issue would make more readable, secure, and speed up a lot of code. The concerns about this being a numpy-like vector operation are confusing to me. The current implementation is already vector-like, but lacks size checking. Isn't "int ^ int"

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Robert Collins
Robert Collins added the comment: You're changing _mock_call but readline is actually implemented in _readline_side_effect - just changing that should be all thats needed (to deal with StopIteration). You will however need to fixup the return values since the test I added is a bit wider than

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Yolanda
Yolanda added the comment: So... the failures are because i'm capturing the StopIteration exception in that case. then it's normal that it's not raised. How should you solve that problem instead? -- ___ Python tracker

Re: what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread Gary Herron
On 04/25/2016 07:13 AM, oyster wrote: for a simple code [code] vexList = [1, 2, 3] print('vexList', list(vexList)) vexList=map(lambda e: e+1, vexList) print('vexList', list(vexList)) vexList = list(vexList) print('vexList', list(vexList)) vexList=map(lambda e: e*2,vexList) print('vexList',

how to set nth bit of large binary file.

2016-04-25 Thread srinivas devaki
I use aria2c to download files, aria2c has this feature of allocating the memory to file before downloading the file and then it will download using multiple connections so filling the data into this file concurrently. So i wonder how to do it. I found a way to do that from here

encoding issue help

2016-04-25 Thread 李洋
hi: i want to decompress the string "\x1F\x8B\x08\x00\x00\x00\x00\x00\x00\x00UP]k\xC3

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Robert Collins
Robert Collins added the comment: Thanks Yolanda. I've touched up the test a little and run a full test run (make test) - sadly it fails: there is an explicit test that StopIteration gets raised if you set it as a side effect.

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 49b975122022 by Senthil Kumaran in branch '3.5': Issue #26804: urllib.request will prefer lower_case proxy environment variables https://hg.python.org/cpython/rev/49b975122022 New changeset 316593f5bf73 by Senthil Kumaran in branch 'default': merge

[issue25788] fileinput.hook_encoded has no way to pass arguments to codecs

2016-04-25 Thread Joseph Hackman
Joseph Hackman added the comment: Ping. Just wondering if anyone on the nosy list would be willing to help review my patch. :) -- ___ Python tracker

[issue26154] Add private _PyThreadState_UncheckedGet() to get the current thread state

2016-04-25 Thread Wenzel Jakob
Wenzel Jakob added the comment: I've also run into this regression. FWIW this is what I've ended up using to work around it (it's a mess, but what are we to do..) #if PY_VERSION_HEX >= 0x0305 && PY_VERSION_HEX < 0x03050200 extern "C" { /* Manually import _PyThreadState_Current symbol

Re: Writing different sections into a file

2016-04-25 Thread Karim
On 25/04/2016 17:00, justin walters wrote: On Mon, Apr 25, 2016 at 3:04 AM, Karim wrote: On 25/04/2016 09:30, Palpandi wrote: Hi, I need to write different sections into a file. At any point of time, content can be added to any section. I don't want keep each

Re: Writing different sections into a file

2016-04-25 Thread justin walters
On Mon, Apr 25, 2016 at 3:04 AM, Karim wrote: > > > On 25/04/2016 09:30, Palpandi wrote: > >> Hi, >> >> I need to write different sections into a file. >> At any point of time, content can be added to any section. >> >> I don't want keep each section into a temporary file. >>

Question on List processing

2016-04-25 Thread subhabangalore
Dear Group, I have a list of tuples, as follows, list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA philanthropic/NA activities/NA ','class1')", u"('koteeswaram/BHPERSN is/NA a/NA very/NA nice/NA person/NA ','class1')", u"('koteeswaram/BHPERSN came/NA to/NA mumbai/LOC

Re: Writing different sections into a file

2016-04-25 Thread Grant Edwards
On 2016-04-25, Palpandi wrote: > Hi, > > I need to write different sections into a file. At any point of > time, content can be added to any section. > > I don't want keep each section into a temporary file. What is the > better way to store the contents of each section

[issue26807] mock_open()().readline() fails at EOF

2016-04-25 Thread Yolanda
Yolanda added the comment: diff --git a/Lib/unittest/test/testmock/testwith.py b/Lib/unittest/test/testmock/testwith.py index a7bee73..efe6391 100644 --- a/Lib/unittest/test/testmock/testwith.py +++ b/Lib/unittest/test/testmock/testwith.py @@ -297,5 +297,16 @@ class

Re: what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread Michael Torrie
On 04/25/2016 08:13 AM, oyster wrote: > so, what produces this difference between py2 and py3 in nature? is > there more examples? where can I find the text abiut his difference? One thing I see is that both your py2 and py3 examples are treating print as a function. It's only a function in Py3.

Re: what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread Jussi Piitulainen
oyster writes: - - > I found > type(map(lambda e: e, vexList)) is in py2 > type(map(lambda e: e, vexList)) is in py3 > > so, what produces this difference between py2 and py3 in nature? is > there more examples? where can I find the text abiut his difference? Yes, there are more ways obtain

Re: Scraping email to make invoice

2016-04-25 Thread Grant Edwards
On 2016-04-24, Michael Torrie wrote: > On 04/24/2016 12:58 PM, CM wrote: > >> 1. INPUT: What's the best way to scrape an email like this? The >>email is to a Gmail account, and the content shows up in the >>email as a series of basically 6x7 tables (HTML?), one table

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-25 Thread Derek Klinge
A couple thoughts. I think my original approach would be faster than binary search for finding the minimum value of N needed to get a decimal level of absolute accuracy from Euler's number. Here is my reasoning: EulerlersNumber(13).LimitMethod() - math.e < .1 and EulersNumber(135).LimitMethod -

[issue23496] Steps for Android Native Build of Python 3.4.2

2016-04-25 Thread Eric Snow
Eric Snow added the comment: FYI: https://mail.python.org/pipermail/python-dev/2016-April/144320.html -- nosy: +eric.snow ___ Python tracker ___

what is the difference between one-line-operation and 2-line-operation

2016-04-25 Thread oyster
for a simple code [code] vexList = [1, 2, 3] print('vexList', list(vexList)) vexList=map(lambda e: e+1, vexList) print('vexList', list(vexList)) vexList = list(vexList) print('vexList', list(vexList)) vexList=map(lambda e: e*2,vexList) print('vexList', list(vexList)) [/code] py27 says [quote]

[issue26804] Prioritize lowercase proxy variables in urllib.request

2016-04-25 Thread Martin Panter
Martin Panter added the comment: V7 looks good to me -- stage: patch review -> commit review ___ Python tracker ___

Re: Optimizing Memory Allocation in a Simple, but Long Function

2016-04-25 Thread Oscar Benjamin
On 25 April 2016 at 08:39, Gregory Ewing wrote: > Derek Klinge wrote: >> >> Also, it seems to me if the goal is to use the smallest value of n to get >> a >> particular level of accuracy, changing your guess of N by doubling seems >> to >> have a high chance of

[issue26249] Change PyMem_Malloc to use pymalloc allocator

2016-04-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: 68b2a43d8653 introduced memory leak. $ ./python -m test.regrtest -uall -R : test_format Run tests sequentially 0:00:00 [1/1] test_format beginning 9 repetitions 123456789 . test_format leaked [6, 7, 7, 7] memory blocks, sum=27 1 test failed:

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread Peter Otten
harirammano...@gmail.com wrote: >> tree.write('output.xml') > > yup its working well if i include register namespace, else i am getting > ns:0 in every line of output.xml. > > But its removing top line > The write() method allows you to specify an encoding and/or require an xml declaration:

[issue26739] idle: Errno 10035 a non-blocking socket operation could not be completed immediately

2016-04-25 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: I think that the select.select calls there are a red herring, since I see no evidence that the rpc socket is ever put in non-blocking mode. But the line self.rpcclt.listening_sock.settimeout(10) indicates that the socket is in timeout mode, and so, the

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread Jussi Piitulainen
harirammano...@gmail.com writes: > On Monday, April 25, 2016 at 4:58:15 PM UTC+5:30, Jussi Piitulainen wrote: >> harirammano...@gmail.com writes: >> >> > On Monday, April 25, 2016 at 4:09:26 PM UTC+5:30, Jussi Piitulainen wrote: >> >> Peter Otten writes: >> >> >> >> > harirammano...@gmail.com

[issue991266] Cookie.py does not correctly quote Morsels

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: Here is a patch for Python 3. -- nosy: +berker.peksag versions: +Python 3.5, Python 3.6 -Python 3.1, Python 3.2 Added file: http://bugs.python.org/file42589/issue991266.diff ___ Python tracker

[issue7504] Same name cookies

2016-04-25 Thread Berker Peksag
Changes by Berker Peksag : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Improper handling of duplicate cookies ___ Python tracker

RE: delete from pattern to pattern if it contains match

2016-04-25 Thread Joaquin Alzola
I put some code I did before for the xmlns: xml_root = ET.ElementTree(ET.fromstring(xml_decoded)).getroot() for elem in xml_root.getiterator():

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread harirammanohar
On Monday, April 25, 2016 at 4:58:15 PM UTC+5:30, Jussi Piitulainen wrote: > harirammano...@gmail.com writes: > > > On Monday, April 25, 2016 at 4:09:26 PM UTC+5:30, Jussi Piitulainen wrote: > >> Peter Otten writes: > >> > >> > harirammano...@gmail.com wrote: > >> > > >> >> Here is the code: >

[issue23662] Cookie.domain is undocumented

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: Actually, it's already documented at https://docs.python.org/3.5/library/http.cookies.html#http.cookies.Morsel. I just added a note about the default value of domain. -- nosy: +berker.peksag resolution: -> fixed stage: needs patch -> resolved status:

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread Jussi Piitulainen
harirammano...@gmail.com writes: > On Monday, April 25, 2016 at 4:09:26 PM UTC+5:30, Jussi Piitulainen wrote: >> Peter Otten writes: >> >> > harirammano...@gmail.com wrote: >> > >> >> Here is the code: >> > >> > Finally ;) >> >> :) > > name space issue can be resolved registering name space i

[issue23662] Cookie.domain is undocumented

2016-04-25 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1fdaa71d47f5 by Berker Peksag in branch '3.5': Issue #23662: Document default value of RFC 2109 attributes https://hg.python.org/cpython/rev/1fdaa71d47f5 New changeset b3ad9c002bb8 by Berker Peksag in branch 'default': Issue #23662: Document

[issue9456] Apparent memory leak in PC/bdist_wininst/install.c

2016-04-25 Thread Mark Lawrence
Changes by Mark Lawrence : -- nosy: -BreamoreBoy ___ Python tracker ___ ___

[issue26039] More flexibility in zipfile write interface

2016-04-25 Thread Thomas Kluyver
Thomas Kluyver added the comment: It wasn't as bad as I thought (hopefully that doesn't mean I've missed something). zipfile-open-w6.patch allows interleaved reads and writes so long as the underlying file object is seekable. You still can't have multiple write handles open (it wouldn't know

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread harirammanohar
On Monday, April 25, 2016 at 4:09:26 PM UTC+5:30, Jussi Piitulainen wrote: > Peter Otten writes: > > > harirammano...@gmail.com wrote: > > > >> Here is the code: > > > > Finally ;) > > :) name space issue can be resolved registering name space i have no issue with that, only concern is xml

[issue9456] Apparent memory leak in PC/bdist_wininst/install.c

2016-04-25 Thread Berker Peksag
Berker Peksag added the comment: install_c.diff looks good to me. Attaching a fresh version of it. There is a comment in PC/bdist_wininst/install.c saying IMPORTANT NOTE: IF THIS FILE IS CHANGED, PCBUILD\BDIST_WININST.VCXPROJ MUST BE REBUILT AS WELL. I don't have Windows so I can't build

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread Jussi Piitulainen
harirammano...@gmail.com writes: > On Monday, April 25, 2016 at 3:19:15 PM UTC+5:30, hariram...@gmail.com wrote: [- -] >> Here is the code: >> >> import xml.etree.ElementTree as ET >> ET.register_namespace("", "http://xmlns.jcp.org/xml/ns/javaee;) >> tree = ET.parse('sample.xml') >> root =

Re: delete from pattern to pattern if it contains match

2016-04-25 Thread Jussi Piitulainen
Peter Otten writes: > harirammano...@gmail.com wrote: > >> Here is the code: > > Finally ;) :) -- https://mail.python.org/mailman/listinfo/python-list

  1   2   >