HTTPSConnection from http.client?

2015-11-17 Thread Alex Naumov
Hello, does anybody know how to create a HTTPS connections in python2 or python3? I tried second day to do that with http.client[1], but every time get error: from http.client import HTTPSConnection ImportError: cannot import name HTTPSConnection Where is HTTPSConnection located? Which module?

[issue24164] Support pickling objects with __new__ with keyword arguments with protocol 2+

2015-11-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7adc1d24d05b by Victor Stinner in branch 'default': Closes #25645: Fix a reference leak introduced by change bc5894a3a0e6 of the https://hg.python.org/cpython/rev/7adc1d24d05b -- ___ Python tracker

[issue24172] Errors in resource.getpagesize module documentation

2015-11-17 Thread John Runyon
John Runyon added the comment: This is a duplicate of 20468, which has a patch submitted (over a year ago). -- nosy: +jrunyon ___ Python tracker ___

[issue20468] resource module documentation is incorrect

2015-11-17 Thread John Runyon
John Runyon added the comment: *bump*. This flat-out wrong documentation has already misled several people, and has had a proposed patch with no comments for over a year. -- nosy: +jrunyon ___ Python tracker

Re: HTTPSConnection from http.client?

2015-11-17 Thread Alex Naumov
On Tue, Nov 17, 2015 at 12:22 PM, Peter Otten <__pete...@web.de> wrote: > Alex Naumov wrote: > >> Hello, >> >> does anybody know how to create a HTTPS connections in python2 or python3? >> I tried second day to do that with http.client[1], but every time get >> error: >> >> from http.client import

[issue25648] asyncio.coroutine fails if asyncio debug mode is enabled and wrapped function don't have "__name__" attribute

2015-11-17 Thread Vladimir Rutsky
New submission from Vladimir Rutsky: In Python 3.4.3 with enabled asyncio debug a function is wrapped using the following code in @asyncio.coroutine: @functools.wraps(func) def wrapper(*args, **kwds): w = CoroWrapper(coro(*args, **kwds), func) if w._source_traceback: del

Re: HTTPSConnection from http.client?

2015-11-17 Thread Marko Rauhamaa
Peter Otten <__pete...@web.de>: > Alex Naumov wrote: >> I tried second day to do that with http.client[1], but every time get >> error: >> >> from http.client import HTTPSConnection >> ImportError: cannot import name HTTPSConnection >> [...] >> I use openSUSE 13.1 x86_64. > > Did you compile

Re: HTTPSConnection from http.client?

2015-11-17 Thread Peter Otten
Alex Naumov wrote: > On Tue, Nov 17, 2015 at 12:22 PM, Peter Otten <__pete...@web.de> wrote: >> Alex Naumov wrote: >> >>> Hello, >>> >>> does anybody know how to create a HTTPS connections in python2 or >>> python3? I tried second day to do that with http.client[1], but every >>> time get error:

cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread andrea . gavana
Hello List, I am working with relatively humongous binary files (created via cPickle), and I stumbled across some unexpected (for me) performance differences between two approaches I use to load those files: 1. Simply use cPickle.load(fid) 2. Read the file as binary using file.read() and

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-17 Thread STINNER Victor
STINNER Victor added the comment: I don't know the physical disk type on Windows. Can you read and write from such "file" type? If no, I don't think that it makes sense to support it in io.FileIO. What do you think? It looks like the file must be opened with specific options, otherwise it

[issue25645] Reference leak in test_capi, on "import _pickle" in a subinterpreter

2015-11-17 Thread STINNER Victor
STINNER Victor added the comment: > The patch LGTM. Thank you Victor. Thanks for the review Serhiy. -- ___ Python tracker ___

[issue25645] Reference leak in test_capi, on "import _pickle" in a subinterpreter

2015-11-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7adc1d24d05b by Victor Stinner in branch 'default': Closes #25645: Fix a reference leak introduced by change bc5894a3a0e6 of the https://hg.python.org/cpython/rev/7adc1d24d05b -- nosy: +python-dev resolution: -> fixed stage: -> resolved

[issue24256] threading.Timer is not a class

2015-11-17 Thread John Runyon
John Runyon added the comment: New proposed patch. I understand not wanting to document an "internal only name", except that in this case it rather needs to be documented. I would strongly prefer Angad's patch to mine because you do, at times, need to know the actual name of the class being

[issue25645] Reference leak in test_capi, on "import _pickle" in a subinterpreter

2015-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch LGTM. Thank you Victor. -- ___ Python tracker ___ ___

Re: HTTPSConnection from http.client?

2015-11-17 Thread Peter Otten
Alex Naumov wrote: > Hello, > > does anybody know how to create a HTTPS connections in python2 or python3? > I tried second day to do that with http.client[1], but every time get > error: > > from http.client import HTTPSConnection > ImportError: cannot import name HTTPSConnection > > > Where

[issue25647] Return of asyncio.coroutine from asyncio.coroutine don't work in with enabled debug

2015-11-17 Thread Vladimir Rutsky
New submission from Vladimir Rutsky: Return of @asyncio.coroutine-wrapped coroutine object from @asyncio.coroutine-wrapped coroutine fails if asyncio debug is enabled. Consider following example: @asyncio.coroutine def outer_coro(): @asyncio.coroutine def inner_coro(): return

[issue25647] Return of asyncio.coroutine from asyncio.coroutine doesn't work in with enabled debug

2015-11-17 Thread Vladimir Rutsky
Changes by Vladimir Rutsky : -- title: Return of asyncio.coroutine from asyncio.coroutine don't work in with enabled debug -> Return of asyncio.coroutine from asyncio.coroutine doesn't work in with enabled debug ___

Trouble installing Python 3.5.0

2015-11-17 Thread Robert Ziomkowski via Python-list
Hello, I installed 3.5, "successfully" as the installer indicated, yet the program wouldn't run, with the following error message: "...failed to start because api-ms-win-crt-runtime-I1-1-0.dll was not found. Re-installing the application may fix this problem." I reinstalled, but no luck. I

Re: HTTPSConnection from http.client?

2015-11-17 Thread Alex Naumov
Hello Peter, thanks for your reply. >>> import ssl Works well in python2 and 3. Maybe somebody know another way to create a SSL connection (username/password)? I just need to log in and log out. Thanks, Alex On Tue, Nov 17, 2015 at 2:24 PM, Peter Otten <__pete...@web.de> wrote: > Alex Naumov

Re: Trouble installing Python 3.5.0

2015-11-17 Thread Zachary Ware
On Tue, Nov 17, 2015 at 8:51 AM, Nagy László Zsolt wrote: > I think Vista and XP was supported up to Python 3.4. The newest Python > 3.5 does not support Vista or XP. Vista is still supported in Python 3.5, but it requires the Universal CRT update, which requires the latest

[issue25629] Move set fill/used updates out of set_insert_clean()

2015-11-17 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread Peter Otten
andrea.gav...@gmail.com wrote: > Hi Chris, > > On Tuesday, November 17, 2015 at 4:20:34 PM UTC+1, Chris Angelico wrote: >> On Wed, Nov 18, 2015 at 1:20 AM, Andrea Gavana wrote: >> > Thank you for your answer. I do get similar timings when I swap the two >> > functions, and specifically still 15

Re: Which type should be used when testing static structure appartenance

2015-11-17 Thread Oscar Benjamin
On 17 November 2015 at 14:27, Nicolas Évrard wrote: > Hello, > > I saw the following retweet by Raymond Hettinger in this morning: > >https://twitter.com/sanityinc/status/666485814214287360 > >Programming tip: many of those arrays and hashes in your code >should

[issue25629] Move set fill/used updates out of set_insert_clean()

2015-11-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 23d0cae3f8a1 by Raymond Hettinger in branch 'default': Issue #25629: Move set fill/used updates out of inner loop https://hg.python.org/cpython/rev/23d0cae3f8a1 -- nosy: +python-dev ___ Python tracker

Help on savefig parameters

2015-11-17 Thread fl
Hi, I find the parameters of savefig function has the similar format of that of main(*argc, **argv) in C. I have tried with savefig("temp.pdf", format='pdf'), and it works. I get the help content of savefig() as below. But I cannot understand why they also give: savefig(fname, dpi=None,

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread andrea . gavana
Hi Peter, On Tuesday, November 17, 2015 at 4:57:57 PM UTC+1, Peter Otten wrote: > Andrea Gavana wrote: > > > Hi Chris, > > > > On Tuesday, November 17, 2015 at 4:20:34 PM UTC+1, Chris Angelico wrote: > >> On Wed, Nov 18, 2015 at 1:20 AM, Andrea Gavana wrote: > >> > Thank you for your answer. I

[issue20220] test_datetime, test_tarfile, test_strptime time zone failures

2015-11-17 Thread STINNER Victor
STINNER Victor added the comment: > I also opened a glibc bug: > . Wow, great! Thank you. -- ___ Python tracker

[issue25639] open 'PhysicalDriveN' on windows fails (since python 3.5) with OSError: [WinError 1] Incorrect function

2015-11-17 Thread Roman Kozhemiakin
Roman Kozhemiakin added the comment: >I don't know the physical disk type on Windows. Can you read and write from >such "file" type? Yes this "files" can be readed and writed (with restriction - size of the data must be a multiple of the sector size) in python 3.4.3 open,read,write,seek -

[issue23895] [PATCH] python socket module fails to build on Solaris when -zignore is in LDFLAGS

2015-11-17 Thread Andrew Stormont
Changes by Andrew Stormont : -- title: python socket module fails to build on Solaris when -zignore is in LDFLAGS -> [PATCH] python socket module fails to build on Solaris when -zignore is in LDFLAGS ___ Python tracker

Re: Which type should be used when testing static structure appartenance

2015-11-17 Thread Chris Angelico
On Wed, Nov 18, 2015 at 1:27 AM, Nicolas Évrard wrote: > I saw just in time because in a review I wrote something like this: > >if operator not in ('where', 'not where') > > and my colleague proposed that I should use a list instead of a tuple. > But reading the mentioned

Re: Trouble installing Python 3.5.0

2015-11-17 Thread Nagy László Zsolt
>> Hello, >> >> I installed 3.5, "successfully" as the installer indicated, yet the program >> wouldn't run, with the following error message: "...failed to start because >> api-ms-win-crt-runtime-I1-1-0.dll was not found. Re-installing the >> application may fix this problem." I reinstalled,

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread Chris Angelico
On Wed, Nov 18, 2015 at 1:20 AM, wrote: > Thank you for your answer. I do get similar timings when I swap the two > functions, and specifically still 15 seconds to read the file via file.read() > and 2.4 seconds (more or less as before) via cPickle.load(fid). > > I

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread andrea . gavana
Hi Chris, On Tuesday, November 17, 2015 at 4:20:34 PM UTC+1, Chris Angelico wrote: > On Wed, Nov 18, 2015 at 1:20 AM, Andrea Gavana wrote: > > Thank you for your answer. I do get similar timings when I swap the two > > functions, and specifically still 15 seconds to read the file via > >

[issue25646] Distutils and Windows SDK 7.0 / Windows SDK 7.1 / Visual C++ Build Tools 2015

2015-11-17 Thread Steve Dower
Steve Dower added the comment: The tools for VS 2015 is a known issue. I let the team know before they released it but it was too late. There'll be an update soon that should work. For Python 3.2 and earlier use http://aka.ms/vcpython27 and setuptools 6 or later. The SDK 7.1 layout doesn't

[issue23895] python socket module fails to build on Solaris when -zignore is in LDFLAGS

2015-11-17 Thread Andrew Stormont
Andrew Stormont added the comment: Bump. -- status: open -> languishing ___ Python tracker ___ ___

[issue22555] Tracking issue for adjustments to binary/text boundary handling

2015-11-17 Thread Steve Dower
Steve Dower added the comment: The thing about bogus assumptions is that Python should paper over those anyway. I can guarantee there's production code out there with the same assumptions. How do we make this work? No idea in the context of the bytes/str filename convention differences.

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread Peter Otten
andrea.gav...@gmail.com wrote: > Hello List, > > I am working with relatively humongous binary files (created via > cPickle), and I stumbled across some unexpected (for me) performance > differences between two approaches I use to load those files: > > 1. Simply use

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread andrea . gavana
Hi Peter, On Tuesday, November 17, 2015 at 3:14:57 PM UTC+1, Peter Otten wrote: > Andrea Gavana wrote: > > > Hello List, > > > > I am working with relatively humongous binary files (created via > > cPickle), and I stumbled across some unexpected (for me) performance > >

Re: Trouble installing Python 3.5.0

2015-11-17 Thread Nagy László Zsolt
> Hello, > > I installed 3.5, "successfully" as the installer indicated, yet the program > wouldn't run, with the following error message: "...failed to start because > api-ms-win-crt-runtime-I1-1-0.dll was not found. Re-installing the > application may fix this problem." I reinstalled, but

Which type should be used when testing static structure appartenance

2015-11-17 Thread Nicolas Évrard
Hello, I saw the following retweet by Raymond Hettinger in this morning: https://twitter.com/sanityinc/status/666485814214287360 Programming tip: many of those arrays and hashes in your code should actually be sets. Match data structures to data constraints! I saw just in time

[issue25646] Distutils and Windows SDK 7.0 / Windows SDK 7.1 / Visual C++ Build Tools 2015

2015-11-17 Thread R. David Murray
Changes by R. David Murray : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware versions: -Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue25649] Come up with a good way to handle module aliasing

2015-11-17 Thread Brett Cannon
New submission from Brett Cannon: If you look at things like https://github.com/kennethreitz/requests/issues/2870 and https://pythonhosted.org/six/#module-six.moves you start to notice that users do on occasion have a need to alias module names. It might be worth thinking through what that

[issue25649] Come up with a good way to handle module aliasing

2015-11-17 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: Another example is the six.moves module, though I haven't looked at its implementation approach. -- ___ Python tracker

Re: Help on savefig parameters

2015-11-17 Thread Rob Gaddi
On Tue, 17 Nov 2015 08:31:08 -0800, fl wrote: > Hi, > I find the parameters of savefig function has the similar format of that > of main(*argc, **argv) in C. I have tried with savefig("temp.pdf", > format='pdf'), > and it works. I get the help content of savefig() as below. > But I cannot

Re: cPickle.load vs. file.read+cPickle.loads on large binary files

2015-11-17 Thread Peter Otten
andrea.gav...@gmail.com wrote: >> > I am puzzled with no end... Might there be something funny with my C >> > libraries that use fread? I'm just shooting in the dark. I have a >> > standard Python installation on Windows, nothing fancy :-( >> >> Perhaps there is a size threshold? You could

[issue25649] Come up with a good way to handle module aliasing

2015-11-17 Thread Barry A. Warsaw
Changes by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue25643] Python tokenizer rewriting

2015-11-17 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker ___ ___

[issue25648] asyncio.coroutine fails if asyncio debug mode is enabled and wrapped function don't have "__name__" attribute

2015-11-17 Thread Yury Selivanov
Yury Selivanov added the comment: > So until 3.4.4 is released this issue still may be considered as not fixed. Since this issue is fixed in the repo, and will be shipped in the upcoming 3.5.1 and 3.4.4, I'd suggest to close this issue -- there is nothing to be done here. --

[issue25647] Return of asyncio.coroutine from asyncio.coroutine doesn't work with enabled asyncio debug

2015-11-17 Thread Vladimir Rutsky
Changes by Vladimir Rutsky : -- title: Return of asyncio.coroutine from asyncio.coroutine doesn't work in with enabled debug -> Return of asyncio.coroutine from asyncio.coroutine doesn't work with enabled asyncio debug

[issue25646] Distutils and Windows SDK 7.0 / Windows SDK 7.1 / Visual C++ Build Tools 2015

2015-11-17 Thread JGoutin
JGoutin added the comment: For SDK 7.1, with "DISTUTILS_USE_SDK=1" (And "MSSdk=1"), I still have the problem. The error is on "include", "lib", "libpath", "path" environment variables which are not set by "vcvarsall.bat" (And are difficult to set manually). I looked on "msvc9compiler.py"

[issue25643] Python tokenizer rewriting

2015-11-17 Thread Brett Cannon
Changes by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue25612] nested try..excepts don't work correctly for generators

2015-11-17 Thread Yury Selivanov
Yury Selivanov added the comment: Can someone work with me on fixing this issue? I think it's important to ship 3.5.1 with this resolved (and 3.4.4 FWIW). -- ___ Python tracker

[issue25648] asyncio.coroutine fails if asyncio debug mode is enabled and wrapped function don't have "__name__" attribute

2015-11-17 Thread Guido van Rossum
Guido van Rossum added the comment: Fixed in repo is good enough to close an issue. -- resolution: -> duplicate status: open -> closed ___ Python tracker

PEP 484 stubs with generic types

2015-11-17 Thread Ian Kelly
Playing around a bit with PEP 484, I annotated a function that returns an asyncio.Future: import asyncio def get_future() -> asyncio.Future[int]: future = asyncio.Future() future.set_result(42) return future The problem with this is that in Python 3.5, asyncio.Future can't be used

[issue25650] Mismatching documentation <=> behaviour for typing.Any

2015-11-17 Thread Emanuel Barry
New submission from Emanuel Barry: The docstring for typing.Any specifically says "- Any object is an instance of Any."; in practice however it's not actually the case, as isinstance(x, Any) raises a TypeError. AnyMeta makes this behaviour seem intentional, however the official documentation

[issue25612] nested try..excepts don't work correctly for generators

2015-11-17 Thread Guido van Rossum
Guido van Rossum added the comment: You might have to ping python-dev. But in terms of priorities I think it's not a blocker -- it's been broken for quite some time now, and it's a fairly odd corner of the language. -- ___ Python tracker

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-17 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Should I develop a mock telnet server for the unittest ? -- ___ Python tracker ___

[issue25612] nested try..excepts don't work correctly for generators

2015-11-17 Thread STINNER Victor
STINNER Victor added the comment: > Can someone work with me on fixing this issue? I think it's important to > ship 3.5.1 with this resolved (and 3.4.4 FWIW). It don't consider this issue as a blocker for Python 3.5.1. This release already contains a *lot* of bugfixes! It's important to get

[issue25612] nested try..excepts don't work correctly for generators

2015-11-17 Thread Martin Panter
Martin Panter added the comment: Thinking about the __context__ thing some more, I guess it might make sense for __context__ to be overwritten by the generator context. The same way it gets overwritten when you execute “raise” inside an exception handler. --

[issue14911] generator.throw() documentation inaccurate

2015-11-17 Thread Martin Panter
Martin Panter added the comment: I can’t really comment on the 2.7 version, because I’m not too familiar with Python 2 exceptions. For Python 3, is there any reason to bless the None, tuple or non-exception cases as the exception “value” argument? IMO these just make things too complicated

[issue20468] resource module documentation is incorrect

2015-11-17 Thread Martin Panter
Martin Panter added the comment: I committed the text removal for getpagesize(). For the getrusage() table, I wonder if it is good enough as it already is. Otherwise, it opens questions about the units for all the other fields, and which platforms they are supported on. -- versions:

[issue20468] resource module documentation is incorrect

2015-11-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5e8b06ac7c97 by Martin Panter in branch '3.4': Issue #20468: Remove incorrect information about maxrss and page size https://hg.python.org/cpython/rev/5e8b06ac7c97 New changeset 1579de0b72f6 by Martin Panter in branch '3.5': Issue #20468: Merge

[issue25495] binascii documentation incorrect

2015-11-17 Thread Mouse
Mouse added the comment: Status...? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25589] test_ascii_formatd fails on Mac when built with Intel compiler

2015-11-17 Thread R. David Murray
R. David Murray added the comment: We've figured out that the difference is the optimization level. Without --with-pydebug, I can reproduce the failure. -- ___ Python tracker

Re: Is there any reason to introduce this intermediate variable (sz)?

2015-11-17 Thread John Gordon
In fl writes: > correctly. Could you see something useful with variable 'sz'? 'sz' is fewer characters than '(n_iter,)', which may make your code easier to read. The np.zeros() function explicitly accepts an 'int or

Is there any reason to introduce this intermediate variable (sz)?

2015-11-17 Thread fl
Hi, I find the following code snippet, which is useful in my project: n_iter = 50 sz = (n_iter,) # size of array x = -0.37727 z = np.random.normal(x,0.1,size=sz) Q = 1e-5 # process variance # allocate space for arrays xhat=np.zeros(sz) P=np.zeros(sz) I learn Python now and

[issue25485] Add a context manager to telnetlib.Telnet

2015-11-17 Thread R. David Murray
R. David Murray added the comment: The existing tests seem to have at least some infrastructure that would apply here, so figuring out how to use/extend that is better than writing new code, I'd say. -- nosy: +r.david.murray ___ Python tracker

[issue5784] raw deflate format and zlib module

2015-11-17 Thread Martin Panter
Martin Panter added the comment: Looking at the current zlib module source code, I confirmed that wbits is passed directly to the deflateInit2(windowBits) and inflateInit2(windowBits) parameters. So the following modes could also be added to the documentation for decompression: * Zero:

[issue25651] Confusing output for TestCase.subTest(0)

2015-11-17 Thread Ezio Melotti
New submission from Ezio Melotti: When a single positional argument is passed to subTest(), if the argument is false, its value won't be displayed in the output -- () will appear instead: >>> import unittest >>> class NumbersTest(unittest.TestCase): ... def test_odd(self): ... for i in

[issue18848] In unittest.TestResult .startTestRun() and .stopTestRun() methods don't work

2015-11-17 Thread Omar Diab
Omar Diab added the comment: I found out about this while writing my own test runner, and investigated it in an answer to a StackOverflow question here: https://stackoverflow.com/questions/32920025/how-do-i-use-unittest-testresult/33770125#33770125 The startTestRun() method is supposed to be

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Jonathan Goble
New submission from Jonathan Goble: In an instance of collections.UserString, any call to the __rmod__() method will raise NameError, due to the undefined "args" name in the method. -- components: Library (Lib) messages: 254830 nosy: Jonathan Goble, rhettinger priority: normal

[issue25653] ctypes+callbacks+fork+selinux = crash

2015-11-17 Thread Armin Rigo
New submission from Armin Rigo: Ctypes uses libffi's `ffi_closure_alloc()`, which has a bug that make existing applications obscurely crash in one situation: if we are running on SELinux, making use of callbacks, and forking. This is because `ffi_closure_alloc()` will detect that it is

[issue23200] Clarify max_length and flush() for zlib decompression

2015-11-17 Thread Roundup Robot
Roundup Robot added the comment: New changeset 106c49edbb12 by Martin Panter in branch '2.7': Issue #23200: Document that max_length=0 is not supported https://hg.python.org/cpython/rev/106c49edbb12 New changeset 660bdfaada64 by Martin Panter in branch '3.4': Issue #23200: Document that

Mapping between python packages and distro packages?

2015-11-17 Thread Stephane Wirtel
Hi, Do you know if there is a library to match a python package (from PyPI) and find the right debian/redhat packages ? Thank you, Stephane -- Stéphane Wirtel - http://wirtel.be - @matrixise -- https://mail.python.org/mailman/listinfo/python-list

Re: Mapping between python packages and distro packages?

2015-11-17 Thread Ben Finney
Stephane Wirtel writes: > Do you know if there is a library to match a python package (from PyPI) > and find the right debian/redhat packages ? What would count as “the right package”? Do you mean “the package that has that PyPI distribution URL in its ‘debian/watch’

[issue25594] enum instance attribute access possible

2015-11-17 Thread Ethan Furman
Ethan Furman added the comment: Changed the wording slightly to indicate that looking up members on other members is a bad idea. -- Added file: http://bugs.python.org/file41064/issue25594.stoneleaf.04.patch ___ Python tracker

Re: palindrome

2015-11-17 Thread Peter Otten
Seymore4Head wrote: > http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html > > Here is my answers. What would make it better? 1. Break the code into functions: one to generate a random string (the desired length could be a parameter) and one to check if the string is a

[issue25593] _sock_connect_cb can be called twice resulting in InvalidStateError

2015-11-17 Thread Justin Mayfield
Justin Mayfield added the comment: Attached patch submission for stop flag proposal. I assume you didn't mean a github PR since the dev docs seem to indicate that is for readonly usage. This passes all the tests on my osx box but it should obviously be run by a lot more folks. --

[issue25645] Reference leak in test_capi, on "import _pickle" in a subinterpreter

2015-11-17 Thread STINNER Victor
Changes by STINNER Victor : Added file: http://bugs.python.org/file41061/test_leak.py ___ Python tracker ___

[issue25646] Distutils and Windows SDK 7.0 / Windows SDK 7.1 / Visual C++ Build Tools 2015

2015-11-17 Thread JGoutin
New submission from JGoutin: Hello, This issue is related to Visual C++ standalone distributions (Without any Visual Studio version installed). Distutils don't properly detect theses compilers. It try to work with "vcvarsall.bat" but this file : - is missing with Visual C++ Build Tools

Re: palindrome

2015-11-17 Thread Peter Otten
Abhiram R wrote: > ​Haha. Nice. Although with your length of string and the range you're > picking from,the chances of you getting a palindrome are (1/24!) :D ​ Are you sure? >>> candidates = list(itertools.product(string.ascii_lowercase, repeat=4)) >>> len(candidates)/len([c for c in

Re: Problems using struct pack/unpack in files, and reading them.

2015-11-17 Thread Dave Farrance
Steven D'Aprano wrote: >On Mon, 16 Nov 2015 05:15 pm, Gregory Ewing wrote: > >> Ints are not the only thing that // can be applied to: >> >> >>> 1.0//0.01 >> 99.0 > >Good catch! Hmmm. I see that the float for 0.01 _is_ slightly larger than 0.01 >>> Decimal(0.01)

pybabel: default locale is None ???

2015-11-17 Thread Nagy László Zsolt
Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 >>> from datetime import timedelta >>> from babel.dates import format_timedelta >>> td = timedelta(seconds=39.28355172422679) >>> format_timedelta(td) Traceback (most recent call last): File "", line

JOSE modules

2015-11-17 Thread Michael Ströder
HI! It seems there are already three modules for implementing JOSE (see RFC 7515..7520). :-/ Anyone here who has practical experience with any of them (with Python 2.7.x and preferrably with elliptic curves)? Ciao, Michael. pyjwkest https://pypi.python.org/pypi/pyjwkest JWCrypto

[issue25645] Reference leak in test_capi, on "import _pickle" in a subinterpreter

2015-11-17 Thread STINNER Victor
New submission from STINNER Victor: """ [Python-checkins] Daily reference leaks (97e2a6810f7f): sum=10 results for 97e2a6810f7f on branch "default" test_asyncio leaked [0, 0, 3] memory blocks, sum=3 test_capi leaked [1, 1, 1]

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: Quite sorry for making some mistakes. unicodeobject does get a __radd__ method. It is added by addoperators though I cannot see it in PyNumberMethods. Now I think just fixing the typo is enough. -- Added file:

[issue23200] Deprecate the zlib decompressor’s flush() method

2015-11-17 Thread Martin Panter
Martin Panter added the comment: See Issue 224981 (bug) and Issue 403373 (patch) about the Z_SYNC_FLUSH change (the numbers in the commit message are different and do not work). I committed my doc change to 2.7 and 3.4+, which leaves the main problem of what to do about flush(). I propose

Writing SOME class methods in C

2015-11-17 Thread Daniel Haude
Hello, I'm trying to implement some (but not all) methods of a Python class in C. What I've found on the Net is: - how to implement entire modules in C so that I can import that module and use the C functions (successfully done it, too). - how to implement entire classes in C But I can't

[issue24172] Errors in resource.getpagesize module documentation

2015-11-17 Thread Martin Panter
Martin Panter added the comment: The documentation already says to consult the getrusage(2) man page. Regarding the getpagesize() API, Python’s implementation actually falls back to Posix’s sysconf(). Perhaps it should prefer sysconf() over getpagesize(), but that would be a separate issue.

Re: Is there any reason to introduce this intermediate variable (sz)?

2015-11-17 Thread fl
On Tuesday, November 17, 2015 at 4:03:05 PM UTC-5, John Gordon wrote: > In fl <@gmail.com> > writes: > > > correctly. Could you see something useful with variable 'sz'? > > 'sz' is fewer characters than '(n_iter,)', which may make your

[issue25612] nested try..excepts don't work correctly for generators

2015-11-17 Thread Martin Panter
Martin Panter added the comment: Regarding the second bug, did you consider that the exception thrown to the generator can already have __context__ set? try: try: raise ValueError("Context outside of generator") except ValueError as ex: raise SubError() from ex except SubError as ex:

Re: Is there any reason to introduce this intermediate variable (sz)?

2015-11-17 Thread John Gordon
In fl writes: > I still don't see the necessity of 'sz'. Thanks, sz isn't required. You can use (n_iter,) in place of sz. However, as I posted earlier, sz is shorter so it might make your code easier to read. Using

[issue20468] resource module documentation is incorrect

2015-11-17 Thread Martin Panter
Martin Panter added the comment: Python’s getrusage() calls the C-level getrusage() function. Man pages for reference: http://man7.org/linux/man-pages/man2/getrusage.2.html https://www.freebsd.org/cgi/man.cgi?query=getrusage=2

Re: Is there any reason to introduce this intermediate variable (sz)?

2015-11-17 Thread Mark Lawrence
On 17/11/2015 21:27, fl wrote: On Tuesday, November 17, 2015 at 4:03:05 PM UTC-5, John Gordon wrote: In fl <@gmail.com> writes: correctly. Could you see something useful with variable 'sz'? 'sz' is fewer characters than '(n_iter,)',

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Jonathan Goble
Jonathan Goble added the comment: c06b2480766d appears to be the offending changeset. -- ___ Python tracker ___

Re: Mapping between python packages and distro packages?

2015-11-17 Thread Chris Angelico
On Wed, Nov 18, 2015 at 3:33 PM, Ben Finney wrote: > What would count as “the right package”? > > Do you mean “the package that has that PyPI distribution URL in its > ‘debian/watch’ configuration”? > > Do you mean “the package that names that PyPI distribution in its

[issue25652] collections.UserString.__rmod__() raises NameError

2015-11-17 Thread Xiang Zhang
Xiang Zhang added the comment: It seems this is a typo. The args should be self.data. And since unicodeobject doesn't support __rmod__, at least I think we should str(format) or remove __rmod__ totally. I attach a patch. -- nosy: +xiang.zhang Added file:

[issue25654] test_multiprocessing_spawn ResourceWarning with -Werror

2015-11-17 Thread Martin Panter
New submission from Martin Panter: Running the test suite with -Werror enabled causes test_multiprocessing_spawn to print out lots of unhandled errors from the garbage collector, and one of these causes a test failure. It looks like there are lots of files that should be explicitly closed