Re: should self be changed?
On Wed, May 27, 2015 at 5:39 PM, Marko Rauhamaa ma...@pacujo.net wrote: Chris Angelico ros...@gmail.com: Using some other name in place of self should definitely remain *possible*, but not commonly done. You are effectively making the argument that Python has made a mistake by not giving self a special, language-level status. Uhh... no I'm not. I'm saying it should be possible to use some other name instead of self, which means that Python got it right by not making it special. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue23790] When xdrlib.Packer().pack_string() fails, the Packer is corrupted
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - rejected stage: - resolved status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23790 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23970] Update distutils.msvccompiler for VC14
Marc-Andre Lemburg added the comment: I was away the last few days, so just found the changes now. IMO, it's a good idea to use a new module for the new compiler, but don't think it's a good idea to make the whole module private, since this implicitly disallows sub-classing the compiler class going forward, which people will need to do sooner or later. Why not rename the module to msvc14compiler (or some other public name) instead ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23914] pickle fails with SystemError
Changes by Serhiy Storchaka storch...@gmail.com: -- priority: normal - low ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23914 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17941] namedtuple should support fully qualified name for more portable pickling
Serhiy Storchaka added the comment: That will not work correctly if the module name has a dot in it. Pickling qualified names with arbitrary number of dots is supported in 3.4 with protocol 4 and in 3.5 with all protocols (backward compatibly). -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17941 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: should self be changed?
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Wednesday 27 May 2015 14:39, Ben Finney wrote: That kind of homophobic slur is inappropriate from anyone in this community. Kindly cut it out altogether. I look forward to the day when people would read the earlier insult and be perplexed as to why it is a slur at all. In the same way as your mother wears army boots has become a joke slur, not taken seriously. Yes, let's all work toward an end to the use of gender, sexuality, ethnicity, and other inborn traits as the punchline of insults or jokes. Until that happy day, let's work to improve the lot of those who are made the butt of such slurs. Part of that work must be to call foul when someone invokes an entire class of people as an insult. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\Brain, but why would anyone want to see Snow White and the | _o__) Seven Samurai?” —_Pinky and The Brain_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
On Wed, May 27, 2015 at 2:35 PM, Laura Creighton l...@openend.se wrote: I am missing something. Why do you need unicode at all? Why can you not just keep your binary data as binary data? Good question. From the SCons code I see that we need unicode, because we switched to io.StringIO which is advertised as the future (and Python 3 way of doing things, because Python 3 doesn't have non-unicode StringIO). A really deep and exhaustive answer. advertisement (first link on StringIO vs io.StringIO): http://stackoverflow.com/questions/3410309/what-is-the-difference-between-stringio-and-io-stringio-in-python2-7 peaceful details https://bitbucket.org/scons/scons/commits/05d5af305a5d gory consequences https://bitbucket.org/scons/scons/pull-request/235/fix-tree-all-print-when-build-tree I feel like I must be missing something obvious here ... Not that obvious as it appears. -- anatoly t. -- https://mail.python.org/mailman/listinfo/python-list
Re: SyntaxError on progress module
On Wed, May 27, 2015 at 5:30 PM, alb al.bas...@gmail.com wrote: But here I have another question, as a python novice is there really any reason for me to use any particular version of Python? Should I start directly with the newest? What about 2.7? Start with the newest that's conveniently available. With Debian Jessie, Python 3.4.2 is a simple apt-get away, so that's pretty convenient. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue22955] Pickling of methodcaller, attrgetter, and itemgetter
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22955 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24259] tar.extractall() does not recognize unexpected EOF
Thomas Guettler added the comment: Who has enough knowledge of the tarfile module to create a good patch? -- nosy: +guettli ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24259 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24295] Backport of #17086 causes regression in setup.py
New submission from Moritz Sichert: In 7955d769fdf5 a bug of #14330 got fixed and it got backported for 2.7. But these changes were reverted by another backport in 8ee6d96a1019 (which was a backport for #17086). The issue here is that right know setup.py looks for ssl and other libs' headers in /usr/include *first* before it searches in /usr/local/include. That makes it really hard to compile python with a setup where you have a newer version of openssl in /usr/local than the one in /usr. -- components: Build files: setup_regression.patch keywords: patch messages: 244154 nosy: moritzs priority: normal severity: normal status: open title: Backport of #17086 causes regression in setup.py type: compile error versions: Python 2.7 Added file: http://bugs.python.org/file39515/setup_regression.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
I am missing something. Why do you need unicode at all? Why can you not just keep your binary data as binary data? I feel like I must be missing something obvious here ... Laura -- https://mail.python.org/mailman/listinfo/python-list
Re: SyntaxError on progress module
Op Wednesday 27 May 2015 09:30 CEST schreef alb: But here I have another question, as a python novice is there really any reason for me to use any particular version of Python? Should I start directly with the newest? What about 2.7? In principal you should use the ‘latest’ 3. The only problem is that a lot of libraries are not converted to 3 yet. If you need one of those, then you have ‘no choice’ and have to use 2.7. But I would recommend to use ‘from __future__' to make the 2.7 code as much as possible 3 compliant. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
[issue23513] Add support for classes/object model in multiprocessing/pickle
Serhiy Storchaka added the comment: Could you please provide full example that you want to work and test it in Python 3.5? I suppose your issue is fixed in 3.5. -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23513 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Fwd: Lossless bulletproof conversion to unicode (backslashing)
Hi. This was labelled offtopic in python-ideas, so I edited and forwarded it here. Please CC as I am not subscribed. In short. I need is a bulletproof way to convert from anything to unicode. This requires some kind of escaping to go forward and back. Some helper function like u2b() (unicode to binary) and b2u() (that also removes escaping). So far I can't find any code that does just that. Background story. I need to print SCons graph. SCons is a build tool, so it has a graph of nodes - what depends on what. I have no idea what a node object could be. I know only that it can have human readable representation. Sometimes node is a filename in some encoding that is not utf-8, and without knowing the encoding, converting it to unicode is not possible without loosing the information about that filename. So, here is what Python proposes: https://docs.python.org/2.7/library/functions.html?highlight=unicode#unicode unicode() type constructor that doesn't allow you to do conversion without losing the data. It offers only two basic strategies - crash or corrupt: 1. ignore - meaning skip and corrupt the data 2. replace - just corrupt the data 3. strict - just crash Python design leaves the decision how to implement safe interoperability to you, and that's basically the reason why Python 3 fails. Without a safe approach (get my binary data back frum that unicode) people just can't wrap their heads around that. Python design assumes that people know the encoding of data they are processing, but that's not true in many cases. The data may also be just broken or invalid. So, the real world coding assumptions are: 1. external data encoding is unknown or varies 2. external data has binary chunks that are invalid for conversion to unicode In real world UnicodeDecode crashes is not an option for deal with unknown or broken and invalid input (such as when I need to print human representation of Node to the screen). In many (most?) situations lossless garbage is more welcome than crash or dataloss and that should be a default behaviour. The solution is to have filter preprocess the binary string to escape all non-unicode symbols so that the following lossless transformation becomes possible: binary - escaped utf-8 string - unicode - binary I want to know if that's real? I need to accomplish that with Python 2.x, but the use case is probably valid for Python 3 as well. This stuff is critical to port SCons to Python 3.x and I expect for other similar tools that have to deal with unknown ascii-binary strings too. -- anatoly t. -- https://mail.python.org/mailman/listinfo/python-list
[issue18032] Optimization for set/frozenset.issubset()
Serhiy Storchaka added the comment: In C implementation no need to create set object seen. More efficient way is to use bit array. Here is a patch that uses this approach. ./python -m timeit -s s1 = set(range(1000)) s1.issubset(range(1000)) Unpatched : 1 loops, best of 3: 115 usec per loop bru's patch: 1 loops, best of 3: 114 usec per loop My patch : 1 loops, best of 3: 92.6 usec per loop ./python -m timeit -s s1 = set(range(1000)) s1.issubset(range(1, 1000)) Unpatched : 1 loops, best of 3: 73.4 usec per loop bru's patch: 1 loops, best of 3: 114 usec per loop My patch : 1 loops, best of 3: 93 usec per loop ./python -m timeit -s s1 = set(range(100)) s1.issubset(range(1, 1000)) Unpatched : 1 loops, best of 3: 73.6 usec per loop bru's patch: 1 loops, best of 3: 89 usec per loop My patch : 1 loops, best of 3: 62.4 usec per loop ./python -m timeit -s s1 = set(range(100)) s1.issubset(range(1000)) Unpatched : 1 loops, best of 3: 75.5 usec per loop bru's patch: 10 loops, best of 3: 8.77 usec per loop My patch : 10 loops, best of 3: 5.34 usec per loop ./python -m timeit -s s1 = set('a'); s2 = ['a'] + ['b'] * 1 s1.issubset(s2) Unpatched : 1000 loops, best of 3: 326 usec per loop bru's patch: 100 loops, best of 3: 0.394 usec per loop My patch : 100 loops, best of 3: 0.409 usec per loop ./python -m timeit -s s1 = set('a'); from itertools import repeat s1.issubset(repeat('a')) Unpatched : NEVER FINISHES bru's patch: 100 loops, best of 3: 0.794 usec per loop My patch : 100 loops, best of 3: 0.725 usec per loop -- nosy: +serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23574] datetime: support leap seconds
Marc-Andre Lemburg added the comment: Here's what mxDateTime uses: import mx.DateTime t1 = mx.DateTime.DateTime(2012,6,30,23,59,60) t2 = mx.DateTime.DateTime(2012,7,1,0,0,0) t1 mx.DateTime.DateTime object for '2012-06-30 23:59:60.00' at 7fbb36008d68 t2 mx.DateTime.DateTime object for '2012-07-01 00:00:00.00' at 7fbb36008d20 t2-t1 mx.DateTime.DateTimeDelta object for '00:00:00.00' at 7fbb35ff0540 (t2-t1).seconds 0.0 t1 + mx.DateTime.oneSecond mx.DateTime.DateTime object for '2012-07-01 00:00:01.00' at 7fbb360083d8 It preserves the broken down values, but uses POSIX days of 86400 seconds per day to calculate time deltas. It's a compromise, not a perfect solution, but it prevents applications from failing for that one second every now and then. I don't believe there is a perfect solution, since what your application or users expect may well be different. All I can say is that raising exceptions in these rare cases is not what your users typically want :-) -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23574 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
On Wed, May 27, 2015 at 9:52 PM, anatoly techtonik techto...@gmail.com wrote: And the short answer is that we need unicode because we are printing this information to the stdout, and stdout is opened in text mode at least on Windows, and without explicit conversion, Python will try to decode stuff as being `ascii` and fail anyway. So you're working with text. That means you HAVE to decode it somehow; you fundamentally cannot print bytes to the console. Lossless concealment of arbitrary bytes won't help you. If you can't adequately decode everything, either backslash-escape the rest, or use a replacement character; you can't print out those bytes. And no, I will not cc you. Subscribe to the list if you're going to ask a question. ChrisA -- https://mail.python.org/mailman/listinfo/python-list
[issue18032] Optimization for set/frozenset.issubset()
Bruno Cauet added the comment: Serhiy, that sounds good but I think that you have forgotten to attach the mentioned patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: should self be changed?
On Wed, May 27, 2015 at 2:40 PM, zipher dreamingforw...@gmail.com wrote: On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Wednesday 27 May 2015 14:39, Ben Finney wrote: That kind of homophobic slur is inappropriate from anyone in this community. Kindly cut it out altogether. I look forward to the day when people would read the earlier insult and be perplexed as to why it is a slur at all. In the same way as your mother wears army boots has become a joke slur, not taken seriously. Yes, let's all work toward an end to the use of gender, sexuality, ethnicity, and other inborn traits as the punchline of insults or jokes. Oh God, you people are being idiots. It's poop. And shall we all so look forward to the day, when people who eat poop are also welcome into the circle of humanity? Everyday, you let atrocity happen, and you're fighting for oppressed feltchers? If so, you dumbasses don't deserve much of a future. If your goal is to get people to stop calling you a troll, you are going about it the wrong way. If it isn't, why are you even here? Please remember the first rule of holes: if you find yourself in a hole, stop digging. -- https://mail.python.org/mailman/listinfo/python-list
Re: SyntaxError on progress module
On 27/05/2015 09:42, Cecil Westerhof wrote: Op Wednesday 27 May 2015 09:30 CEST schreef alb: But here I have another question, as a python novice is there really any reason for me to use any particular version of Python? Should I start directly with the newest? What about 2.7? In principal you should use the ‘latest’ 3. The only problem is that a lot of libraries are not converted to 3 yet. If you need one of those, then you have ‘no choice’ and have to use 2.7. But I would recommend to use ‘from __future__' to make the 2.7 code as much as possible 3 compliant. Please define a lot whilst bearing in mind green against red here https://python3wos.appspot.com/ -- 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
[issue24294] DeprecationWarnings should be visible by default in the interactive REPL
Martin Panter added the comment: I have learnt to run the interactive interpeter (and also most of my own scripts) with the -b -Wall options. But having these switched on automatically may not be a bad thing. -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24296] Queue documentation note needed
New submission from Sandy Chapman: The example at the bottom of the following page should have a warning added: https://docs.python.org/2/library/queue.html The warning should be such that the user is informed that the threads in the example are not cleaned up and will continue to run. Any future additions to the queue will then be processed immediately by those threads. -- assignee: docs@python components: Documentation messages: 244156 nosy: Sandy Chapman, docs@python priority: normal severity: normal status: open title: Queue documentation note needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24296 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23275] Can assign [] = (), but not () = []
Rahul Gupta added the comment: isn't it logical? [] is a mutable data structure while () is a immutable data structure (b, a) = [1, 2] is fine because a and b are mutable -- nosy: +Rahul Gupta ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23275 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24297] Lib/symbol.py is out of sync with Grammar/Grammar
R. David Murray added the comment: It is automatically generated in that it isn't hand-written. On the other hand, it isn't automatically generated in the sense of being part of the make process, ./python symbol.py is supposed to be run by hand when it is appropriate. A bit ago someone wrote tests for keyword.py that among other things made sure we didn't forget to update it when needed. Someone needs to write a similar test for symbol, it looks like. Whether or not one or both of these could be/should be incorporated into make (now that we have 'make touch' to deal with the consequences) is a separate question. As to why it is checked in, we check in almost all the build artifacts previous to the compile stage, so that there is no need to have an already-built python to build python from source. -- nosy: +benjamin.peterson, r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
On Wed, May 27, 2015 at 2:47 PM, anatoly techtonik techto...@gmail.com wrote: On Wed, May 27, 2015 at 2:35 PM, Laura Creighton l...@openend.se wrote: I am missing something. Why do you need unicode at all? Why can you not just keep your binary data as binary data? Good question. From the SCons code I see that we need unicode, because we switched to io.StringIO which is advertised as the future (and Python 3 way of doing things, because Python 3 doesn't have non-unicode StringIO). A really deep and exhaustive answer. advertisement (first link on StringIO vs io.StringIO): http://stackoverflow.com/questions/3410309/what-is-the-difference-between-stringio-and-io-stringio-in-python2-7 peaceful details https://bitbucket.org/scons/scons/commits/05d5af305a5d gory consequences https://bitbucket.org/scons/scons/pull-request/235/fix-tree-all-print-when-build-tree I feel like I must be missing something obvious here ... Not that obvious as it appears. And the short answer is that we need unicode because we are printing this information to the stdout, and stdout is opened in text mode at least on Windows, and without explicit conversion, Python will try to decode stuff as being `ascii` and fail anyway. -- anatoly t. -- https://mail.python.org/mailman/listinfo/python-list
Re: should self be changed?
On Wednesday, May 27, 2015 at 6:30:16 AM UTC-5, Ben Finney wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info writes: On Wednesday 27 May 2015 14:39, Ben Finney wrote: That kind of homophobic slur is inappropriate from anyone in this community. Kindly cut it out altogether. I look forward to the day when people would read the earlier insult and be perplexed as to why it is a slur at all. In the same way as your mother wears army boots has become a joke slur, not taken seriously. Yes, let's all work toward an end to the use of gender, sexuality, ethnicity, and other inborn traits as the punchline of insults or jokes. Oh God, you people are being idiots. It's poop. And shall we all so look forward to the day, when people who eat poop are also welcome into the circle of humanity? Everyday, you let atrocity happen, and you're fighting for oppressed feltchers? If so, you dumbasses don't deserve much of a future. Mark -- https://mail.python.org/mailman/listinfo/python-list
Re: a more precise distance algorithm
A minor point is that if you just need to compare distances you don't need to compute the hypotenuse, its square will do so no subtractions etc etc. -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list
[issue24294] DeprecationWarnings should be visible by default in the interactive REPL
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24294] DeprecationWarnings should be visible by default in the interactive REPL
Serhiy Storchaka added the comment: See discussion on Python-Ideas [1]. [1] http://comments.gmane.org/gmane.comp.python.ideas/32191 -- components: +Interpreter Core nosy: +serhiy.storchaka versions: +Python 3.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24296] Queue documentation note needed
R. David Murray added the comment: If you know anything about threads you can see that the threads are not explicitly shut down. As a standalone example it is correct, in that they get shut down at interpreter shutdown. I'm not sure it is appropriate to include what is essentially a thread tutorial note in the queue docs. A crosslink to threading would certainly be a good idea; perhaps the introductory sentence could be tweaked to point people who don't already know threads in the correct direction for enlightenment. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24296 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Accessing DataSocket Server with Python
Dear Python Team, currently I am working on a research project for my bachelor degree. A LabVIEW application is used for current and power measurements, whereas the measured data are sent to DataSocket Server, a technology by National Instruments used for data exchange between computers and applications. DataSocket is based on TCP/IP and thus requesting data from DataSocket should be similar to an internet request. I know with the socket library in Python it is possible with to establish sockets, send internet requests and communicate between clients and servers. Is there a possibility to access NI DataSocket and get measurement data with Python on the same computer where Python is installed and the codes are executed? Can you maybe send me an example code where such a connection with DataSocket is established? If you got any queries, please do not hesitate to contact me. Thank you very much for your efforts. Kind regards, *Corrado Garrone* DH-Student Fachrichtung Elektrotechnik / Co-op Student B.Eng. Electrical Engineering Roche Diagnostics GmbH DFGHMV8Y6164 Sandhofer Strasse 116 68305 Mannheim / Germany Phone: apprentice mailto:corrado.garr...@roche.com corrado.garr...@roche.com *Roche Diagnostics GmbH* Sandhofer Straße 116; D‑68305 Mannheim; Telefon +49‑621‑759‑0; Telefax +49‑621‑759‑2890 Sitz der Gesellschaft: Mannheim - Registergericht: AG Mannheim HRB 3962 - Geschäftsführung: Dr. Ursula Redeker, Sprecherin; Edgar Vieth - Aufsichtsratsvorsitzender: Dr. Severin Schwan *Confidentiality Note* This message is intended only for the use of the named recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient, please contact the sender and delete the message. Any unauthorized use of the information contained in this message is prohibited. -- https://mail.python.org/mailman/listinfo/python-list
[issue23275] Can assign [] = (), but not () = []
Martin Panter added the comment: I prefer to unpack into square brackets in general because it is a mnemonic for the star argument being a list: (a, *b) = range(3) a 0 b # A list, even though it was unpacked using tuple-like syntax [1, 2] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23275 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24297] Lib/symbol.py is out of sync with Grammar/Grammar
New submission from Marius Gedminas: While investigating https://bitbucket.org/pypa/setuptools/issue/388/install-from-sdist-fails-on-python-350b1 I noticed that Grammar/Grammar changed in 3.5, but Lib/symbol.py wasn't updated. I'm not familiar with the CPython parser, but I suspect that adding/removing/splitting grammar rules causes the nonterminal symbol IDs to shift, which ought to require an update in symbol.py. Huh. Now I see a comment in the file says it is automatically generated, but in that case why wasn't that done when I did 'hg pull -u make make install'? Why is it checked into source control? -- components: Library (Lib) messages: 244160 nosy: mgedmin priority: normal severity: normal status: open title: Lib/symbol.py is out of sync with Grammar/Grammar versions: Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
On Wed, 27 May 2015 09:15 pm, anatoly techtonik wrote: Hi. This was labelled offtopic in python-ideas, so I edited and forwarded it here. Please CC as I am not subscribed. In short. I need is a bulletproof way to convert from anything to unicode. This requires some kind of escaping to go forward and back. Why do you need to go back? Just keep the node, and use that. Some helper function like u2b() (unicode to binary) and b2u() (that also removes escaping). So far I can't find any code that does just that. def bytes2unicode(bytes): # Converts bytes to Unicode, allowing garbage (moji-bake). return bytes.decode('latin1') def unicode2bytes(unicode): # Convert unicode containing garbage (moji-bake) to bytes. return unicode.encode('latin1') It correctly does the round trip from any sequence of bytes to unicode and back to bytes, losslessly: py import random py node = bytes([random.randrange(0, 256) for _ in range(10)]) py uni = bytes2unicode(node) py b = unicode2bytes(uni) py b == node True But take careful note that you can't start with Unicode and still expect to round-trip losslessly. Many perfectly readable Unicode strings do *not* convert to bytes: py unicode2bytes(u'ДЙ') # two Cyrillic letters Traceback (most recent call last): File stdin, line 1, in module File stdin, line 3, in unicode2bytes UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256) That means that if you take a correctly encoded string, it will round-trip, but it will also display as garbage: py s = u'ДЙ' py node = s.encode('utf-8') py print(node) # Correctly encoded UTF-8 b'\xd0\x94\xd0\x99' py node == unicode2bytes(bytes2unicode(node)) # round trips okay True py print(repr(bytes2unicode(node))) # but prints as crap 'Ð\x94Ð\x99' Background story. I need to print SCons graph. SCons is a build tool, so it has a graph of nodes - what depends on what. I have no idea what a node object could be. I know only that it can have human readable representation. Sometimes node is a filename in some encoding that is not utf-8, and without knowing the encoding, converting it to unicode is not possible without loosing the information about that filename. py filename = My Russian ДЙ name # Unicode py b = filename.encode('koi8-r') # Oops, not UTF-8! py b.decode(utf-8) # Fails Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe4 in position 11: invalid continuation byte py b.decode(utf-8, errors=replace) # lossy, but works 'My Russian �� name' py s = b.decode(utf-8, errors=surrogateescape) # magic! py s 'My Russian \udce4\udcea name' It round-trips as well: py s.encode(utf-8, errors=surrogateescape) == b True Converting this back to Python 2.7 is left as an exercise for the reader. -- Steven -- https://mail.python.org/mailman/listinfo/python-list
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing) (fwd)
Chris Angelico apparantly has a problem with cc'd people who aren't on the list. python-list is very quiet these days, so if you subscribe it won't be drinking from the firehose. And you can always turn off delivery when you are done. Or you can just go read the archives: https://mail.python.org/pipermail/python-list/2015-May/thread.html Laura --- Forwarded Message Return-Path: python-list-bounces+lac=openend...@python.org Received: from mail.python.org (mail.python.org [82.94.164.166]) by theraft.openend.se (8.14.4/8.14.4/Debian-4) with ESMTP id t4RC09ap02From: Chris Angelico ros...@gmail.com Cc: python-list@python.org python-list@python.org On Wed, May 27, 2015 at 9:52 PM, anatoly techtonik techto...@gmail.com wrote: And the short answer is that we need unicode because we are printing this information to the stdout, and stdout is opened in text mode at least on Windows, and without explicit conversion, Python will try to decode stuff as being `ascii` and fail anyway. So you're working with text. That means you HAVE to decode it somehow; you fundamentally cannot print bytes to the console. Lossless concealment of arbitrary bytes won't help you. If you can't adequately decode everything, either backslash-escape the rest, or use a replacement character; you can't print out those bytes. And no, I will not cc you. Subscribe to the list if you're going to ask a question. ChrisA - -- https://mail.python.org/mailman/listinfo/python-list --- End of Forwarded Message -- https://mail.python.org/mailman/listinfo/python-list
[issue23275] Can assign [] = (), but not () = []
Devin Jeanpierre added the comment: [a, b] = (1, 2) is also fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23275 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
On Wed, May 27, 2015, at 07:15, anatoly techtonik wrote: The solution is to have filter preprocess the binary string to escape all non-unicode symbols so that the following lossless transformation becomes possible: binary - escaped utf-8 string - unicode - binary I want to know if that's real? I need to accomplish that with Python 2.x, but the use case is probably valid for Python 3 as well. In Python 3, you could *in principle* use surrogateescape (this would be more of a binary - escaped unicode workflow), but see below. It is worth noting that when you *read* posix filenames in unicode form (e.g. listdir with a unicode argument), they are decoded with surrogateescape, and can be returned to bytes format with fn.encode(sys.getfilesystemencoding(), errors='surrogateescape'). However keep in mind that on *windows*, the native filename format is a sequence of 16-bit WCHAR values, not a sequence of bytes. This stuff is critical to port SCons to Python 3.x and I expect for other similar tools that have to deal with unknown ascii-binary strings too. Even if your filename *is* valid UTF-8 (or whatever other encoding), it might contain invisible control characters that make it difficult to read. You'd probably be better off simply working directly with the binary representation, iterating over it and replacing all non-*ascii*-printable bytes with an escaped representation. As it happens, the repr() function should work well for doing exactly this. (note: repr on a *unicode* string in python 3 will pass non-ascii characters, but ideally you're working with byte strings.) There's no real need to go beyond this unless you're working in a problem domain where filenames are likely to legitimately include non-ascii characters (e.g. user documents of non-technical users who use languages other than English). -- https://mail.python.org/mailman/listinfo/python-list
[issue23970] Update distutils.msvccompiler for VC14
Steve Dower added the comment: I understood it only disallowed complaining about breaking changes without a deprecation cycle :) I'm sorry I didn't realize you were away. If you have examples of how subclassing this class (and not just CCompiler) is useful and does something that can't be done through the existing interface, then we'll have something to discuss. From past experiences, I now prefer to default to disallow inheritance by default, as it isn't a breaking change to allow it again in the future but you can't go the other way. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23275] Can assign [] = (), but not () = []
Changes by Ionel Cristian Mărieș cont...@ionelmc.ro: -- nosy: +ionelmc ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23275 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Fwd: Lossless bulletproof conversion to unicode (backslashing)
On Wed, May 27, 2015, at 07:47, anatoly techtonik wrote: because Python 3 doesn't have non-unicode StringIO That's actually not true - the non-unicode equivalent is BytesIO. However, it's probably not actually what you want, if the point is to display the filenames to the user. -- https://mail.python.org/mailman/listinfo/python-list
[issue18032] Optimization for set/frozenset.issubset()
Serhiy Storchaka added the comment: Oh, sorry. Here is it. -- Added file: http://bugs.python.org/file39516/set_issubset_bitarray.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18032 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23970] Update distutils.msvccompiler for VC14
Mark Lawrence added the comment: If the name is changed I'd like to see something that doesn't reflect the msvc version, as my understanding is that from now on the old compatibility issues are gone. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23970 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24295] Backport of #17086 causes regression in setup.py
Matthias Klose added the comment: I'll look at this in June. I don't think that reverting is the right choice here. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23359] Speed-up set_lookkey()
Serhiy Storchaka added the comment: Why you have added entry-hash == 0? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23359 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid - process mapping.
New submission from Paul Hobbs: Using pid namespacing it is possible to have multiple processes with the same pid. semlock_new creates a semaphore file with the template /dev/shm/mp{pid}-{counter}. This can conflict if the same semaphore file already exists due to another Python process have the same pid. This bug has been fixed in Python3: https://bugs.python.org/issue8713. However, that patch is very large (40 files, ~4.4k changed lines) and only incidentally fixes this bug while introducing a large backwards-incompatible refactoring and feature addition. The following small patch to just _multiprocessing/semaphore.c fixes the problem by using the system clock and retrying to avoid conflicts: --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -7,6 +7,7 @@ */ #include multiprocessing.h +#include time.h enum { RECURSIVE_MUTEX, SEMAPHORE }; @@ -419,7 +420,7 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { char buffer[256]; SEM_HANDLE handle = SEM_FAILED; -int kind, maxvalue, value; +int kind, maxvalue, value, try; PyObject *result; static char *kwlist[] = {kind, value, maxvalue, NULL}; static int counter = 0; @@ -433,10 +434,24 @@ semlock_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } -PyOS_snprintf(buffer, sizeof(buffer), /mp%ld-%d, (long)getpid(), counter++); +/* With pid namespaces, we may have multiple processes with the same pid. + * Instead of relying on the pid to be unique, we use the microseconds time + * to attempt to a unique filename. */ +for (try = 0; try 100; ++try) { +struct timespec tv; +long arbitrary = clock_gettime(CLOCK_REALTIME, tv) ? 0 : tv.tv_nsec; +PyOS_snprintf(buffer, sizeof(buffer), /mp%ld-%d-%ld, + (long)getpid(), + counter++, + arbitrary); +SEM_CLEAR_ERROR(); +handle = SEM_CREATE(buffer, value, maxvalue); +if (handle != SEM_FAILED) +break; +else if (errno != EEXIST) +goto failure; +} -SEM_CLEAR_ERROR(); -handle = SEM_CREATE(buffer, value, maxvalue); /* On Windows we should fail if GetLastError()==ERROR_ALREADY_EXISTS */ if (handle == SEM_FAILED || SEM_GET_LAST_ERROR() != 0) goto failure; -- messages: 244211 nosy: Paul Hobbs priority: normal severity: normal status: open title: OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid - process mapping. type: enhancement versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24303 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid - process mapping.
Changes by Ned Deily n...@acm.org: -- nosy: +devin, sbt stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24303 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24299] 2.7.10 test__locale.py change breaks on Solaris
Serhiy Storchaka added the comment: This is not the Right Answer because on Linux the thousands-separator for the fr_FR locale is a space. Perhaps better solution would be to specify the UTF-8 encoding for fr_FR locale. -- assignee: - serhiy.storchaka nosy: +lemburg, loewis, serhiy.storchaka stage: - patch review versions: +Python 3.4, Python 3.5, Python 3.6 Added file: http://bugs.python.org/file39523/issue24299-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24299 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid - process mapping.
Changes by Ned Deily n...@acm.org: -- nosy: +davin -devin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24303 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24303] OSError 17 due to _multiprocessing/semaphore.c assuming a one-to-one Pid - process mapping.
Changes by Mike Frysinger vap...@users.sourceforge.net: -- nosy: +vapier ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24303 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24288] Include/opcode.h is modified during building
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24288 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24301] gzip module failing to decompress valid compressed file
Ned Deily added the comment: Can you add a public copy of a file that fails this way? There are several open issues with gzip, like Issue1159051, that might cover this but it's hard to know for sure without a test case. -- nosy: +ned.deily type: crash - ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24301 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24294] DeprecationWarnings should be visible by default in the interactive REPL
Changes by Thomas Kluyver tak...@gmail.com: -- nosy: +takluyver ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24294 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24295] Backport of #17086 causes regression in setup.py
Changes by Ned Deily n...@acm.org: -- nosy: +doko priority: normal - high ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24295 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: a more precise distance algorithm
On Mon, May 25, 2015 at 11:11 PM, Steven D'Aprano st...@pearwood.info wrote: Let's compare three methods. def naive(a, b): return math.sqrt(a**2 + b**2) def alternate(a, b): a, b = min(a, b), max(a, b) if a == 0: return b if b == 0: return a return a * math.sqrt(1 + b**2 / a**2) d1 = naive(a, b) d2 = alternate(a, b) d3 = math.hypot(a, b) which shows that: (1) It's not hard to find mismatches; (2) It's not obvious which of the three methods is more accurate. Bottom line: they all suck. :) I ran the program you posted, and, like you, got the following two examples: for fun in [naive, alternate, math.hypot]: print '%.20f' % fun(222.44802484683657,680.255801504161) 715.70320611153294976248 715.70320611153283607564 715.70320611153283607564 and for fun in [naive, alternate, math.hypot]: print '%.20f' % fun(376.47153302262484,943.1877995550265) 1015.54617837194291496417 1015.54617837194280127733 1015.54617837194291496417 but when comparing to Wolfram Alpha, which calculates these out many more decimal places, we have for the two cases: 715.7032061115328768204988784125331443593766145937358347357252... 715.70320611153294976248 715.70320611153283607564 715.70320611153283607564 1015.546178371942943007625196455666280385821355370154991424749... 1015.54617837194291496417 1015.54617837194280127733 1015.54617837194291496417 where all of the methods deviate at the 13/14 decimal place. bb -- - bbl...@gmail.com http://web.bryant.edu/~bblais -- https://mail.python.org/mailman/listinfo/python-list
Python 3.5 crashes on wrong %PYTHONHOME
I just installed the 32-bit Python 3.5b4 via the Web-installer. First, I was a bit annoyed by the fact it installed under 'f:\ProgramFiler-x86\Python35' instead of 'f:\ProgramFiler\Python35' as I customided for. But I guess this is a WOW64 thing. I'm on Win-8.1 (64-bit). But then I noticed the whole thing crashes when calling python35!Py_FatalError. On a simple 'python -v' command. Presumably because my env-var: PYTHONHOME=f:\Programfiler\Python27 (and not 'PYTHONHOME=f:\Programfiler\Python35'). Reading the message on this list, gave me the impression Python 2.7 and Python 3.5 can co-exist with no problem. Doesn't look the case so far. Is there another 'PYTHONxx' env-var to override 'PYTHONHOME' in this case? Or what should I do to keep on using both 27 and 35? For reference, the call-stack: ucrtbase!abort+0x4b python35!Py_FatalError+0xbc python35!Py_InitializeEx_Private+0x45b python35!Py_Main+0x72c python+0x11df KERNEL32!BaseThreadInitThunk+0x24 ntdll!__RtlUserThreadStart+0x2f ntdll!_RtlUserThreadStart+0x1b And some of the modules shown in WinDbg: ModLoad: 1c47 1c47c000 F:\ProgramFiler\Python35\python.exe ModLoad: 7772 7788e000 C:\Windows\SYSTEM32\ntdll.dll ModLoad: 7750 7764 C:\Windows\SYSTEM32\KERNEL32.DLL ModLoad: 76e2 76ef7000 C:\Windows\SYSTEM32\KERNELBASE.dll ModLoad: 6cd5 6d057000 F:\ProgramFiler\Python35\python35.dll ModLoad: 6e7e 6e7f5000 C:\Windows\SYSTEM32\VCRUNTIME140.dll (the new universal CRT from MS) -- --gv -- https://mail.python.org/mailman/listinfo/python-list
Re: different types of inheritence...
On Tuesday, May 26, 2015 at 3:53:25 PM UTC-5, Michael Torrie wrote: On 05/26/2015 08:57 AM, zipher wrote: Comprende? I'm not trying to be cryptic here. This is a bit of OOP theory to be discussed. No, sorry. Maybe an actual example (with use case) would spur discussion. In the first example, super_dict changes the behavior of dict *for the user*, expanding the API, but keeping all the prior method behaviors the same. In the second example, specialized_dict changes the behavior in the machine -- the API stays the same so the user of the code just gets new benefits from whatever the specialized_dict is improving internally *without changing his/her code*. It's a drop-in replacement. In other words, the second class changes the INTERNALS of dict. While the first class changes the *externals* of dict. Yet they both use the same class definition, but semantically are completely different. It's TWO different definition of IS-A relationship. Two definitions of the word is. m -- https://mail.python.org/mailman/listinfo/python-list
Embedded Python. Debug Version and _ctypes
Hi! I'm trying to use embedding of Python in my program. Simple C-program, compiled in Debug, that uses py-script that just imports ctypes gives me an error about no module named _ctypes. How to compile python lib in Visual Studio statically with ctypes support? Or how to use shared ctypes lib in debug mode? -- https://mail.python.org/mailman/listinfo/python-list
Re: Python 3.5 crashes on wrong %PYTHONHOME
On Wed, May 27, 2015 at 1:13 PM, Gisle Vanem gva...@yahoo.no wrote: I just installed the 32-bit Python 3.5b4 via the Web-installer. First, I was a bit annoyed by the fact it installed under 'f:\ProgramFiler-x86\Python35' instead of 'f:\ProgramFiler\Python35' as I customided for. But I guess this is a WOW64 thing. I'm on Win-8.1 (64-bit). But then I noticed the whole thing crashes when calling python35!Py_FatalError. On a simple 'python -v' command. Presumably because my env-var: PYTHONHOME=f:\Programfiler\Python27 (and not 'PYTHONHOME=f:\Programfiler\Python35'). Reading the message on this list, gave me the impression Python 2.7 and Python 3.5 can co-exist with no problem. Doesn't look the case so far. Is there another 'PYTHONxx' env-var to override 'PYTHONHOME' in this case? Or what should I do to keep on using both 27 and 35? Is there any particular reason you're setting PYTHONHOME in the first place? It shouldn't be necessary unless you're doing something abnormal. I'd try unsetting it entirely and see if things just work. -- Zach -- https://mail.python.org/mailman/listinfo/python-list
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: But why was it building just fine before this commit? I haven't updated my system packages in a while. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Steve Dower added the comment: Those macros are only included if Py_BUILD_CORE is defined, regardless of platform (see Include/pyport.h). Is it possible that's being undefined somehow? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Steve Dower added the comment: Looking at a `grep PY_CORE_CFLAGS`, that sounds reasonable to me. I assumed that all core files were already being compiled with Py_BUILD_CORE (they certainly are for Windows), so this seems to be an oversight for timemodule.c. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Ned Deily added the comment: I think you have a Python installed in /usr/local that is interfering. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24301] gzip module failing to decompress valid compressed file
New submission from Eric Gorr: I have a file whose first four bytes are 1F 8B 08 00 and if I use gunzip from the command line, it outputs: gzip: zImage_extracted.gz: decompression OK, trailing garbage ignored and correctly decompresses the file. However, if I use the gzip module to read and decompress the data, I get the following exception thrown: File /usr/lib/python3.4/gzip.py, line 360, in read while self._read(readsize): File /usr/lib/python3.4/gzip.py, line 433, in _read if not self._read_gzip_header(): File /usr/lib/python3.4/gzip.py, line 297, in _read_gzip_header raise OSError('Not a gzipped file') I believe the problem I am facing is the same one described here in this SO question and answer: http://stackoverflow.com/questions/4928560/how-can-i-work-with-gzip-files-which-contain-extra-data This would appear to be serious bug in the gzip module that needs to be fixed. -- components: Extension Modules messages: 244188 nosy: Eric Gorr priority: normal severity: normal status: open title: gzip module failing to decompress valid compressed file type: crash versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24301 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: Wild guess: perhaps you did a ./configure or the Makefile did an implicit call to configure recently and/or you did a make install (to /usr/local) before? I don't have 'python' in /usr/local and /usr/local/bin -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Ned Deily added the comment: But do you have any Python header files in /usr/local/include? The gcc command you pasted shows -I/usr/local/include? Mine don't show that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: yury@ysmac ~/dev/py/cpython (HG: default?) $ ls /usr/local/include/ librtmp osxfuse pycairo -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: FWIW, I think that in order to use _Py_BEGIN_SUPPRESS_IPH timemodule.c should be compiled with PY_CORE_CFLAGS, and that should be reflected in the Makefile. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Ned Deily added the comment: Yury, I'm not seeing that compile error with current head of default on OS X. Try a clean build, perhaps? -- nosy: +ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: SyntaxError on progress module
Op Wednesday 27 May 2015 16:51 CEST schreef Mark Lawrence: On 27/05/2015 15:11, Cecil Westerhof wrote: Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence: On 27/05/2015 09:42, Cecil Westerhof wrote: Op Wednesday 27 May 2015 09:30 CEST schreef alb: But here I have another question, as a python novice is there really any reason for me to use any particular version of Python? Should I start directly with the newest? What about 2.7? In principal you should use the ‘latest’ 3. The only problem is that a lot of libraries are not converted to 3 yet. If you need one of those, then you have ‘no choice’ and have to use 2.7. But I would recommend to use ‘from __future__' to make the 2.7 code as much as possible 3 compliant. Please define a lot whilst bearing in mind green against red here https://python3wos.appspot.com/ I just started using Python again and the first ‘real’ program I wrote I had to write with Python 2 because the needed library (libturpial, that is not listed on your link) works only with Python 2. A short search about which of the two to use gives similar answers to mine. And as far as I can see in my neighbourhood Python 2 is almost exclusively used because used libraries are only available in Python 2. This is not a scientifically substantiated argument, but for me good enough to use a lot. Have you actaully tried running libturpial with Python 3 or have you simply taken somebody or something's word for it? I've taken code in the past that was only Python 2, run it thought the 2to3 fixer and job done. Perhaps you could do the same. Perhaps you've already tried. Again, you're the only person who actually knows. Of-course I tried: that is why I used “had to”. The library itself and libraries it depends on are only existing in a 2 version (at the moment). I write code that should work in 2 and 3 both as long as 2 is still a significant part. I call programs with python3 (even while it is 10 to 20 percent slower) and only when that is not possible I use Python 2. (Except to test if code also works with Python 2.) -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
[issue24300] Code Refactoring in function nis_mapname()
New submission from pankaj.s01: Hi, Here , A code refactoring patch have been submitted for Function: nis_mapname() and File: Python-3.4.3/Modules/nismodule.c Please Review it, Thanks, Pankaj -- components: Extension Modules files: Python-3.4.3-nismodule.patch keywords: patch messages: 244183 nosy: pankaj.s01 priority: normal severity: normal status: open title: Code Refactoring in function nis_mapname() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file39521/Python-3.4.3-nismodule.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24300 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24298] inspect.signature includes bound argument for wrappers around bound methods
Petr Viktorin added the comment: Reported by David Gibson here: https://bugzilla.redhat.com/show_bug.cgi?id=1201990 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24298 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24298] inspect.signature includes bound argument for wrappers around bound methods
New submission from Petr Viktorin: When obtaining the signature of a bound method, inspect.signature, by default, omits the self argument to the method, since it is already specified in the bound method. However, if you create a wrapper around a bound method with functools.update_wrapper() or @functools.wraps, calling inspect.signature on the wrapper will return a signature which includes the self argument. Reproducer: import inspect import functools class Foo(object): def bar(self, testarg): pass f = Foo() @functools.wraps(f.bar) def baz(*args): f.bar(*args) assert inspect.signature(baz) == inspect.signature(f.bar) The program will fail with an assertion error. Examining inspect.signature(baz) shows: print(inspect.signature(baz)) (self, testarg) print(inspect.signature(f.bar)) (testarg) Looking at the code in inspect.py: The handling of bound methods appears at the top of inspect._signature_internal(). Since baz is not itself a bound method, it doesn't trigger this case. Instead inspect.unwrap is called, returning f.bar. inspect._signature_is_functionlike(f.bar) returns True, causing Signature.from_function to be called. Unlike the direct bound method case, this includes the bound method's self argument. -- messages: 244178 nosy: encukou priority: normal severity: normal status: open title: inspect.signature includes bound argument for wrappers around bound methods versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24298 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24299] 2.7.10 test__locale.py change breaks on Solaris
New submission from John Beck: The upgrade from 2.7.9 to 2.7.10 resulted in test__locale failing. This test had previously succeeded. The difference is that the thousands-separator for the fr_FR locale in known_numerics was changed from '' (i.e., unknown) to ' ' (i.e. space). But on Solaris, '\xa0' (i.e., non-break space in ISO8859-1) is what the fr_FR locale returns for LC_NUMERIC's thousands-separator. I inquired with our Globalization experts, who replied: --- The short answer is that CLDR defines the group separator as no-break space (U+00A0): http://st.unicode.org/cldr-apps/v#/fr/Symbols/ so the solaris locale fr_FR (=fr_FR.ISO8859-1) is correct. The long answer is that the situation is confusing, the fr_FR.ISO8859-1 defines the thousands_sep as no-break space, but fr_FR.UTF-8 defines the thousands_sep as space (U+0020). There is no technical limit, but combination of POSIX [1] and C language [2] limits the thousands_sep to single byte character. The no-break space is single byte character in ISO8859-1, but multibyte in UTF-8. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04 [2] http://en.cppreference.com/w/c/locale/lconv http://en.cppreference.com/w/c/language/character_constant --- The attached patch fixes the test on Solaris. It is not clear if this is the Right Answer for all platforms, but I offer the attached patch in case it helps anyone else. -- components: Library (Lib) files: 25-test__locale.patch keywords: patch messages: 244181 nosy: jbeck priority: normal severity: normal status: open title: 2.7.10 test__locale.py change breaks on Solaris type: behavior versions: Python 2.7 Added file: http://bugs.python.org/file39520/25-test__locale.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24299 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: This exact sequence of commands $ make clean $ ./configure $ make -j8 does not build. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: $ hg status shows nothing, branch is default (but 3.5 doesn't get built either) etc. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Ned Deily added the comment: Wild guess: perhaps you did a ./configure or the Makefile did an implicit call to configure recently and/or you did a make install (to /usr/local) before? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24297] Lib/symbol.py is out of sync with Grammar/Grammar
Roundup Robot added the comment: New changeset 843fe7e831a8 by Yury Selivanov in branch '3.5': Issue 24297: Update symbol.py. See also issue 24017. https://hg.python.org/cpython/rev/843fe7e831a8 New changeset 87509d71653b by Yury Selivanov in branch 'default': Issue 24297: Update symbol.py. See also issue 24017. https://hg.python.org/cpython/rev/87509d71653b -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24017] Implemenation of the PEP 492 - Coroutines with async and await syntax
Roundup Robot added the comment: New changeset 843fe7e831a8 by Yury Selivanov in branch '3.5': Issue 24297: Update symbol.py. See also issue 24017. https://hg.python.org/cpython/rev/843fe7e831a8 New changeset 87509d71653b by Yury Selivanov in branch 'default': Issue 24297: Update symbol.py. See also issue 24017. https://hg.python.org/cpython/rev/87509d71653b -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24017 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24297] Lib/symbol.py is out of sync with Grammar/Grammar
Yury Selivanov added the comment: Attached is a new unittest to make sure that symbol.py is always updated. Essentially it's the same test that we have for keywords.py. Please review. -- assignee: - yselivanov keywords: +patch nosy: +yselivanov stage: - patch review versions: +Python 3.6 Added file: http://bugs.python.org/file39519/test_symbol.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24288] Include/opcode.h is modified during building
Serhiy Storchaka added the comment: I think the intension was to produce aligned data, but the alignment of the second column was wrong. Here is a patch that corrects formatting. -- stage: needs patch - patch review Added file: http://bugs.python.org/file39517/generate_opcode_h_align.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24288 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: SyntaxError on progress module
Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence: On 27/05/2015 09:42, Cecil Westerhof wrote: Op Wednesday 27 May 2015 09:30 CEST schreef alb: But here I have another question, as a python novice is there really any reason for me to use any particular version of Python? Should I start directly with the newest? What about 2.7? In principal you should use the ‘latest’ 3. The only problem is that a lot of libraries are not converted to 3 yet. If you need one of those, then you have ‘no choice’ and have to use 2.7. But I would recommend to use ‘from __future__' to make the 2.7 code as much as possible 3 compliant. Please define a lot whilst bearing in mind green against red here https://python3wos.appspot.com/ I just started using Python again and the first ‘real’ program I wrote I had to write with Python 2 because the needed library (libturpial, that is not listed on your link) works only with Python 2. A short search about which of the two to use gives similar answers to mine. And as far as I can see in my neighbourhood Python 2 is almost exclusively used because used libraries are only available in Python 2. This is not a scientifically substantiated argument, but for me good enough to use a lot. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof -- https://mail.python.org/mailman/listinfo/python-list
[issue24297] Lib/symbol.py is out of sync with Grammar/Grammar
Changes by Brett Cannon br...@python.org: -- priority: normal - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24297 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24296] Queue documentation note needed
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: docs@python - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24296 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: should self be changed?
On 2015-05-27, Todd toddr...@gmail.com wrote: On Wed, May 27, 2015 at 2:40 PM, zipher dreamingforw...@gmail.com wrote: [some stupid crap] If your goal is to get people to stop calling you a troll, you are going about it the wrong way. If it isn't, why are you even here? Please remember the first rule of holes: if you find yourself in a hole, stop digging. And thanks to everybody who keeps replying to zipher's posts so that those of use who's newsreaders are configured to filter him out get to see them anyway. -- Grant Edwards grant.b.edwardsYow! I need to discuss at BUY-BACK PROVISIONS gmail.comwith at least six studio SLEAZEBALLS!! -- https://mail.python.org/mailman/listinfo/python-list
Re: SyntaxError on progress module
On 27/05/2015 15:11, Cecil Westerhof wrote: Op Wednesday 27 May 2015 15:44 CEST schreef Mark Lawrence: On 27/05/2015 09:42, Cecil Westerhof wrote: Op Wednesday 27 May 2015 09:30 CEST schreef alb: But here I have another question, as a python novice is there really any reason for me to use any particular version of Python? Should I start directly with the newest? What about 2.7? In principal you should use the ‘latest’ 3. The only problem is that a lot of libraries are not converted to 3 yet. If you need one of those, then you have ‘no choice’ and have to use 2.7. But I would recommend to use ‘from __future__' to make the 2.7 code as much as possible 3 compliant. Please define a lot whilst bearing in mind green against red here https://python3wos.appspot.com/ I just started using Python again and the first ‘real’ program I wrote I had to write with Python 2 because the needed library (libturpial, that is not listed on your link) works only with Python 2. A short search about which of the two to use gives similar answers to mine. And as far as I can see in my neighbourhood Python 2 is almost exclusively used because used libraries are only available in Python 2. This is not a scientifically substantiated argument, but for me good enough to use a lot. Have you actaully tried running libturpial with Python 3 or have you simply taken somebody or something's word for it? I've taken code in the past that was only Python 2, run it thought the 2to3 fixer and job done. Perhaps you could do the same. Perhaps you've already tried. Again, you're the only person who actually knows. -- 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
[issue24296] Queue documentation note needed
Raymond Hettinger added the comment: It is normal for daemon threads to not be shut down. That is why they exist. The purpose of Queue.join() is to give other threads a way to know when daemons have finished doing their work (i.e. a print manager thread to indicate that it is done printing). If the worker threads were actually going to terminate, you wouldn't need Queue.join(), you would use a Thread.join(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24296 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24288] Include/opcode.h is modified during building
Yury Selivanov added the comment: lgtm -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24288 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: timemodule.c no longer compiles on MacOSX: gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Werror=declaration-after-statement -I./Include -I. -IInclude -I/usr/local/include -I/Users/yury/dev/py/cpython/Include -I/Users/yury/dev/py/cpython -c /Users/yury/dev/py/cpython/Modules/timemodule.c -o build/temp.macosx-10.10-x86_64-3.5/Users/yury/dev/py/cpython/Modules/timemodule.o /Users/yury/dev/py/cpython/Modules/timemodule.c:656:9: error: use of undeclared identifier '_Py_BEGIN_SUPPRESS_IPH' _Py_BEGIN_SUPPRESS_IPH ^ /Users/yury/dev/py/cpython/Modules/timemodule.c:658:9: error: use of undeclared identifier '_Py_END_SUPPRESS_IPH' _Py_END_SUPPRESS_IPH ^ 2 errors generated. -- nosy: +yselivanov priority: normal - critical ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24270] PEP 485 (math.isclose) implementation
Tal Einat added the comment: Attached yet another revised version of the math.isclose() patch. This patch fixes a problem with the tests in the previous patch which causes them to fail when the full test suite is run. I've also slightly reworded the doc-string. Hopefully this is ready to go in! -- Added file: http://bugs.python.org/file39518/math_isclose_v4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24270 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Steve Dower added the comment: That change was in for beta 1, so we would have noticed if we didn't get Mac builds. Something else has changed, probably some headers. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24302] Dead Code of Handler check in function faulthandler_fatal_error()
New submission from pankaj.s01: Hi, There is dead code reported in this issue and I think no need to check for NULL of 'handler' in function faulthandler_fatal_error() and file Python-3.4.3/Modules/faulthandler.c . where 'handler' is pointed to staic array faulthandler_handlers[] which never will be null inside loop with faulthandler_nsignals value and doesn't means to check for NULL outside of loop. but if there is possibility of 'handler' to be NULL then it should be check inside the loop until handler-signum is not equal to signum and then break; -- components: Extension Modules files: Python-3.4.3-faulthandler.patch keywords: patch messages: 244195 nosy: pankaj.s01 priority: normal severity: normal status: open title: Dead Code of Handler check in function faulthandler_fatal_error() type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file39522/Python-3.4.3-faulthandler.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24302 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24298] inspect.signature includes bound argument for wrappers around bound methods
Changes by Yury Selivanov yseliva...@gmail.com: -- nosy: +yselivanov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24298 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Yury Selivanov added the comment: Towards the end of the configured top-level Makefile, you should see: Yes, I don't see that line. What should I do to regenerate it? And another question: what did go wrong with my checkout? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Majeed Arni added the comment: Though %f is a valid format from Python's doc https://docs.python.org/2/library/datetime.html, the fix just ignores it on Windows? can we atleast get milliseconds on Windows and Micro on Linux? %f Microsecond as a decimal number, zero-padded on the left. 00, 01, ..., 99 (4) %f is an extension to the set of format characters in the C standard (but implemented separately in datetime objects, and therefore always available). When used with the strptime() method, the %f directive accepts from one to six digits and zero pads on the right. New in version 2.6. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23359] Speed-up set_lookkey()
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23359 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23359] Speed-up set_lookkey()
Roundup Robot added the comment: New changeset cd1e1715becd by Raymond Hettinger in branch 'default': Issue #23359: Specialize set_lookkey intoa lookup function and an insert function. https://hg.python.org/cpython/rev/cd1e1715becd -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23359 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23275] Can assign [] = (), but not () = []
Raymond Hettinger added the comment: Berker's patch looks good. It has several virtues: * the error message is reasonable and clear * it makes the language more consistent * it doesn't break any existing code. * it makes the AST a little simpler and faster by removing a special case The patch needs to updated: * remove the whatsnew entry * fix test_codeop which expects del () to raise SyntaxError * fix test_syntax which fails on () = 1 and del () * fix test_with which fails on with mock as () -- assignee: - rhettinger versions: +Python 3.6 -Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23275 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
Ned Deily added the comment: Yury, another (less) wild guess: do you have an out-of-date Modules/Setup or Setup.local? timemodule is defined in Setup.dist but that will be overridden by a locally modified copy in the Modules directory. Towards the end of the configured top-level Makefile, you should see: # Rules appended by makedepend [...] Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(PY_CORE_CFLAGS) -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24244] Python exception on strftime with %f on Python 3 and Python 2 on windows
R. David Murray added the comment: Note that when I run into build problems after an update, I generally run 'make distclean' and then redo the configure/make. This generally cleans up any problems like this (and I don't find that I need to do it very often.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24244 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com