[issue44311] How to print results of asyncio websockets at the same time?
Henk-Jaap Wagenaar added the comment: This bug tracker is for the Python language and not for asking for help with programming. This bug should be closed. You can go to e.g. stackoverflow.com and ask the question there. -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue44311> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44310] Document that lru_cache uses hard references
Henk-Jaap Wagenaar added the comment: Reading this bug thread last week made me realize we had made the following error in our code: class SomethingView(): @functools.lru_cache() def get_object(self): return self._object Now, as this class was instantiated for every (particular kind of) request to a webserver and this method called (a few times), the lru_cache just kept filling up and up. We had been having a memory leak we couldn't track down, and this was it. I think this is an easy mistake to make and it was rooted, not so much in hard references though (without that though, it would have not leaked memory) but because of the fact the cache lives on the class and not the object. -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue44310> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44310] Document that lru_cache uses hard references
Henk-Jaap Wagenaar added the comment: PR 26731 looks very good to me. My only comment, which I am not sure is worthy of adding/is a general lru_cache thing, that "instances are kept alive until they age out of the cache or until the cache is cleared", if you are creating instances and calling this method all the time, will lead to an infinite memory leak. Not sure whether that's too specific to the problem we encountered and we are all consenting adults and should infer this or it is helpful: leave it up to your/other people's judgement. P.S. In the programming.rst there is also the "Why are default values shared between objects?" section which actually uses default values to make its own poor version of a cache. It should probably at least mention lru_cache could be used (unless you particularly need callers to be able to pass their own cache). -- ___ Python tracker <https://bugs.python.org/issue44310> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44440] logging does not work as documented (setLevel)
Henk-Jaap Wagenaar added the comment: Logging can be quite tricky. There are filters at multiple levels. In this case, you didn't set up the "global logging" and I am guessing, by default, it only shows WARNING and above. You can fix your problem by doing: logging.basicConfig(level=logging.DEBUG) -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue0> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44440] logging does not work as documented (setLevel)
Henk-Jaap Wagenaar added the comment: The sentence within the doc should not be considered in isolation. The "Logger" object is *not* ignoring the message (in accordance with the documentation and your expectation), but the "Handler" is, see https://docs.python.org/3.8/library/logging.html#logging.Handler.setLevel and here: https://docs.python.org/3/howto/logging.html: "The default level is WARNING, which means that only events of this level and above will be tracked, unless the logging package is configured to do otherwise." Logging is quite complicated, and reading the API reference is not the best starting point, as is noted at the top of the page and links provided. -- ___ Python tracker <https://bugs.python.org/issue0> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14995] PyLong_FromString documentation should state that the string must be null-terminated
Change by Henk-Jaap Wagenaar : -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue14995> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14995] PyLong_FromString documentation should state that the string must be null-terminated
Change by Henk-Jaap Wagenaar : -- nosy: +Cryvate nosy_count: 4.0 -> 5.0 pull_requests: +25360 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26774 ___ Python tracker <https://bugs.python.org/issue14995> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31538] mailbox does not treat external factories the same
Change by Henk-Jaap Wagenaar : -- keywords: +patch nosy: +Cryvate nosy_count: 4.0 -> 5.0 pull_requests: +25362 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26776 ___ Python tracker <https://bugs.python.org/issue31538> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31538] mailbox does not treat external factories the same
Change by Henk-Jaap Wagenaar : -- versions: +Python 3.10, Python 3.11 -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue31538> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44310] Document that lru_cache uses hard references
Henk-Jaap Wagenaar added the comment: I clearly was missing some words there Raymond. I meant, if one has set maxsize=None. -- ___ Python tracker <https://bugs.python.org/issue44310> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44310] Document that lru_cache uses hard references
Henk-Jaap Wagenaar added the comment: (but consenting adults, setting max_size=None for "efficiency", you better be sure what you are doing in a long running process and making sure it cannot grow unbounded.) -- ___ Python tracker <https://bugs.python.org/issue44310> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32696] Fix pickling exceptions with multiple arguments
Henk-Jaap Wagenaar added the comment: It seems like the example in the OP now works (persist both arguments), but Irit's/Kirill's (create a msg) fails (I am running 3.9). -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue32696> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44470] 3.11 docs.python.org in Polish not English?
Henk-Jaap Wagenaar added the comment: I can confirm it looks the same to me, and I have never said Polish in my browser et cetera, so I assume this is the same for everyone. -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue44470> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44470] 3.11 docs.python.org in Polish not English?
Henk-Jaap Wagenaar added the comment: It seems to affect 3.10 as well and other languages (French seems to show a variety fo languages) -- versions: +Python 3.10 ___ Python tracker <https://bugs.python.org/issue44470> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44470] 3.11 docs.python.org in Polish not English?
Henk-Jaap Wagenaar added the comment: @Mark, I don't know about Samuel, but when I tried, I could get the bug with other languages, but not on other pages (which seems to agree with your point of reasoning). -- ___ Python tracker <https://bugs.python.org/issue44470> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44663] Possible bug in datetime utc
Henk-Jaap Wagenaar added the comment: I don't seem to be able to reproduce this by running this one-liner: from datetime import datetime, timezone; print(datetime.now(timezone.utc).timestamp()); print(datetime.u tcnow().timestamp()); on 3.9.5. How did you achieve this? It looks like the difference one would expect from (fast) human input). -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue44663> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25661] tokenize.untokenize does not maintain the order of tabbed indentations and leading spaces
Henk-Jaap Wagenaar added the comment: Python 2.7 is end-of-life, see e.g. https://www.python.org/doc/sunset-python-2/ so this is unlikely to be fixed. This behaviour continues on Python 3 it seems (I used 3.8.1), *however* on Python 3 this is not valid code as it mixes spaces and tabs, see e.g. https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces I think therefore this can be closed, though I might well be mistaken. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue25661> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31826] Misleading __version__ attribute of modules in standard library
Change by Henk-Jaap Wagenaar : -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31826> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40569] Add optional weights to random.sample()
Henk-Jaap Wagenaar added the comment: @rhettinger: I like this proposal. @dheiberg: to me, it seems negative weights are explicitly not supported, from: https://docs.python.org/3/library/random.html#random.choices "Weights are assumed to be non-negative." Unless I am missing something. In my mind negative weights make no sense and the fact it produces garbage in your example is garbage-in-garbage-out. Maybe an enhancement could be made (but it would be breaking for some abusing the behaviour you showed) for it to error (or do something sane? If such a thing exists) but that should be a separate issue. -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue40569> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40646] Builtins in doc show signature in documentation
New submission from Henk-Jaap Wagenaar : Due to a certain discussion on extending zip, I was having looking at this page: https://docs.python.org/3/library/functions.html It lists the builtins at the top as e.g. all() which I think is confusing: running all() will actually fail. I think it should either (using "all" as example): 1. display as "all" 2. display as "all(iterable)" (what to do about 'overloaded' functions like e.g. range?) I am happy to provide a PR for the preferred option. -- assignee: docs@python components: Documentation messages: 369053 nosy: cryvate, docs@python priority: normal severity: normal status: open title: Builtins in doc show signature in documentation type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue40646> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41393] Fix FAQ example to use __import__('functools').reduce
Henk-Jaap Wagenaar added the comment: It doesn't raise an error when you run the whole example, it has "from functools import reduce" at the top. -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue41393> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41651] Pip: Wrong Showing of Progressbar when Downloading Modules
Henk-Jaap Wagenaar added the comment: Thanks for the report, that does look like unfriendly UX. pip is maintained separately and then vendored (included/packaged in). Could you please file an issue here instead: https://github.com/pypa/pip/issues (I would do so myself, but as I do not develop on Windows might not be best placed to provide feedback). -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue41651> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41812] Broken link on documentation header
Henk-Jaap Wagenaar added the comment: I can confirm this seems to happen, link to reproduce (click on "Documentation"): https://docs.python.org/ja/3/index.html It redirects to: https://docs.python.org/ja/index.html which is a 404 -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue41812> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41988] No hyphen in broken up word in documentation
New submission from Henk-Jaap Wagenaar : In the decimal module documentation: https://docs.python.org/3/library/decimal.html Arithmetic is broken up for me as "Arith\nmetic", not the missing hyphen, unless I am mistaken it should be "Arith-\nmetic". Is this a Sphinx issue? Is this a browser issue? Is this an issue on our end? Later it does break "Applications" correctly. See attached screenshot. -- assignee: docs@python components: Documentation files: Screenshot 2020-10-09 at 21.43.50.png messages: 378351 nosy: cryvate, docs@python priority: normal severity: normal status: open title: No hyphen in broken up word in documentation versions: Python 3.10, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49504/Screenshot 2020-10-09 at 21.43.50.png ___ Python tracker <https://bugs.python.org/issue41988> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32218] add __iter__ to enum.Flag members
Henk-Jaap Wagenaar added the comment: What does aenum do and has there been any feedback on it? To me I would see what you suggest as surprising but I don't use enums often (I should use them more!) so take that with a grain of salt, and also surprising != wrong/not good. -- nosy: +cryvate ___ Python tracker <https://bugs.python.org/issue32218> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26656] Documentation for re.compile is a bit outdated
Henk-Jaap Wagenaar added the comment: Emily: I've signed the CLA, just waiting for it to be checked. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <http://bugs.python.org/issue26656> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31307] ConfigParser.read silently fails if filenames argument is a byte string
Changes by Henk-Jaap Wagenaar : -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <http://bugs.python.org/issue31307> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31345] Backport docstring improvements to the C version of OrderedDict
Henk-Jaap Wagenaar added the comment: I submitted a pull request for both 3.5 and 3.6 finding 2 locations using search and find. I also replayed Raymond's example (with _collections as well) and got the documentation as expected on my custom builds of 3.5/3.6. I submitted my CLA on 26th August but it has not been processed for some reason? -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31345] Backport docstring improvements to the C version of OrderedDict
Henk-Jaap Wagenaar added the comment: Hi Mariatta, Thanks for pointing that out about 3.5. Is that also why the build failed!? I found it hard to parse travis' output and was surprised it failed. Thanks for letting me know---getting it fixed. I have added my github account to the other one, so that should fix it for this PR? -- ___ Python tracker <https://bugs.python.org/issue31345> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31414] IDLE: Entry tests should delete before insert.
Changes by Henk-Jaap Wagenaar : -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31414> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31421] IDLE doc: add section on developing tkinter apps.
Changes by Henk-Jaap Wagenaar : -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31421> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31414] IDLE: Entry tests should delete before insert.
Changes by Henk-Jaap Wagenaar : -- nosy: -Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31414> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31538] mailbox does not treat external factories the same
Henk-Jaap Wagenaar added the comment: To me the documentation doesn't quite look right, in the case of no factory being passed, it runs: def __getitem__(self, key): """Return the keyed message; raise KeyError if it doesn't exist.""" if not self._factory: return self.get_message(key) else: return self._factory(self.get_file(key)) from the Mailbox base class. The get_message is thus: def get_message(self, key): """Return a Message representation or raise a KeyError.""" start, stop = self._lookup(key) self._file.seek(start) from_line = self._file.readline().replace(linesep, b'') string = self._file.read(stop - self._file.tell()) msg = self._message_factory(string.replace(linesep, b'\n')) msg.set_from(from_line[5:].decode('ascii')) return msg where self._message_factory is set to mailbox.mboxMessage. I am not familiar with this module, so am unsure whether the documentation is ill-worded or it is a bug. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31538> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27867] various issues due to misuse of PySlice_GetIndicesEx
Henk-Jaap Wagenaar added the comment: @serhiy.storchaka: review done. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue27867> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31570] minor bug in documentataion relating to sending html email
Changes by Henk-Jaap Wagenaar : -- keywords: +patch pull_requests: +3706 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31570> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31570] minor bug in documentataion relating to sending html email
Henk-Jaap Wagenaar added the comment: I have made a PR, not sure whether it needs backporting? -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31570> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27268] Incorrect error message on float('')
Changes by Henk-Jaap Wagenaar : -- pull_requests: +3708 ___ Python tracker <https://bugs.python.org/issue27268> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27268] Incorrect error message on float('')
Henk-Jaap Wagenaar added the comment: @Wolfgang I just created a PR, only to realise that Pedro already made one a while back: PR 2745 -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue27268> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31567] Inconsistent documentation around decorators
Change by Henk-Jaap Wagenaar : -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31567> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31707] Irrational fractions
Henk-Jaap Wagenaar added the comment: I would like to provide some colour to this discussion. In a former life I have coded these during my studies. Ben is talking about implementing the Field of Fractions of an Integral Domain. See https://en.wikipedia.org/wiki/Field_of_fractions The way Fraction is implemented it has a unique representation for each fraction in Q and uses GCD. This requires us to strengthen the condition of Integral Domain to a Euclidean Domain where the Euclidean Function fulfills the role of %. I.e. Serhiy: it would only support exactly those rings that support gcd! See https://en.wikipedia.org/wiki/Euclidean_domain One could implement a base class called (Euclidean)FractionField that generalizes to Euclidean domains. For future reference, there are a few practical niggles I want to record: - how to deal with basic numeric types? - Euclidean Domain needs to implement __abs__ to get a canonical denominator, unless gcd works out magically like it does in Z? The added advantage beside being able to use the FractionField class as Ben suggests is that it splits up the mechanics of parsing/creating/casting to/from various basic numeric types from the mathematical operations in a fraction field making the code clearer. I am happy to assist Ben with the patch if he wants any help. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31707> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31714] Improve re documentation
Henk-Jaap Wagenaar added the comment: I was looking at your changes and got myself in a muddle. What is you rational for when you use ``[character or string]`` versus ``'[character or string]``? You seem to be creating consistency there, but I cannot quite see the rules you are aiming for! -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31714> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31735] Documentation incorrectly states how descriptors are invoked
Henk-Jaap Wagenaar added the comment: You get what you should get: when you print obj.d, Obj.d, you will get: which is exactly what you expect: - in the first case, you assigned a property object to the dictionary at obj.__dict__, so that's what you get back when you run obj.d. - you defined a property on a class called d, and you get it when you run Obj.d If you run print(Obj().d) you will get a TypeError: your lambda should read: lambda self: print('called') Properties should be added to the class not the instance, see https://stackoverflow.com/questions/1325673/how-to-add-property-to-a-class-dynamically and https://eev.ee/blog/2012/05/23/python-faq-descriptors/ ------ nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue31735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31735] Documentation incorrectly states how descriptors are invoked
Henk-Jaap Wagenaar added the comment: "We know this doesn't happen because nothing is printed to stdout." Try running Obj().d, you will get output. Obj.d does not work because it is on a *class*, and so it runs, per the docs: 'Obj.__dict__['d'].__get__(None, Obj)' whereas you consider running it on an instance to get: b = Obj() b.d # equivalent to type(b).__dict__['d'].__get__(b, type(b)) and you will get output twice. [Note, on python2 you will get an error, I think this is because your class does not inherit from object.] -- ___ Python tracker <https://bugs.python.org/issue31735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31735] Documentation incorrectly states how descriptors are invoked
Henk-Jaap Wagenaar added the comment: I do think though that "If d defines the method __get__(), then d.__get__(obj) is invoked according to the precedence rules listed below." seems to contain a mistake in that it should have d.__get__(obj, type(obj)) instead of d.__get__(obj) -- ___ Python tracker <https://bugs.python.org/issue31735> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31867] Duplicated keys in MIME type_map with different values
Henk-Jaap Wagenaar added the comment: So for excel, 'application/excel' is not listed at http://www.iana.org/assignments/media-types as suggested by the comment at: https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L397 whereas 'applicaton/vnd.ms-excel' is listed. See also https://stackoverflow.com/questions/974079/setting-mime-type-for-excel-document. For cdf, Wolframalpha is using application/cdf it seems (without it being registered) whereas NetCDF suggests application/x-netcdf so that seems reasonable (and is the current value). For context, these duplicates were introduced here: https://github.com/python/cpython/commit/a3689fe78675c89d5979c0c5acdb1c173cc75ed6 and noted first here: https://github.com/python/cpython/commit/107771a228ee73b4683242cb696e3024f93b74d5 ------ nosy: +Henk-Jaap Wagenaar title: Duplicated keys, but with different values in dictionary literals -> Duplicated keys in MIME type_map with different values ___ Python tracker <https://bugs.python.org/issue31867> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32012] Disallow ambiguous syntax f(x for x in [1],)
Henk-Jaap Wagenaar added the comment: Currently, Class C(*some_classes): ... works 'as expected' and is within grammar and language specification whereas Class C(x for x in [object]): ... does not work but does not cause a syntax error. I can see a use case for both in dynamic class factories. I was going to do this, but was thwarted by another issue (__doc__ cannot be assigned after creation, nor can it be defined as anything but a pure string, any work around or reason that is the case? Not true for e.g. functions). I think having one of these within the language specification and not the other is odd. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue32012> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32012] Disallow ambiguous syntax f(x for x in [1],)
Henk-Jaap Wagenaar added the comment: [As a follow-on, should I open a new issue/discuss on python-dev? Willing to help out with a solution on way or another! I know https://en.wikipedia.org/wiki/Wikipedia:Chesterton%27s_fence, "In my head" <> "Should be the case" etc. very much applies.] In my head @... def foo(): pass is equivalent to def _foo(): pass foo = ...() del _foo However the following shows this is not the case: @0 def foo(): pass throws a syntax error, whereas def _foo(): pass foo = 0(_foo) throws a type error. This might seem silly, but it is still unexpected. https://docs.python.org/3/reference/compound_stmts.html#grammar-token-decorator has decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE which in my head is decorator ::= "@" atom NEWLINE Similarly for classes: https://docs.python.org/3/reference/compound_stmts.html#class-definitions inheritance ::= "(" [argument_list] ")" which allows for keyword arguments (does that make any sense!?). In my head it is (compare with call: https://docs.python.org/3/reference/expressions.html#calls) inheritance ::= "(" [positional_arguments [","] | comprehension] ")" [Tangentially related, this is how I originally got onto the mailing lists, my unhappiness with the definition of the for statement (https://docs.python.org/3/reference/compound_stmts.html#the-for-statement): for_stmt ::= "for" target_list "in" expression_list ":" suite ["else" ":" suite] Which I would expect to be: for_stmt ::= comp_for ":" suite ["else" ":" suite] so you could e.g. have if statements. ] -- ___ Python tracker <https://bugs.python.org/issue32012> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31867] Duplicated keys in MIME type_map with different values
Change by Henk-Jaap Wagenaar : -- keywords: +patch pull_requests: +4337 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue31867> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32012] Disallow ambiguous syntax f(x for x in [1],)
Henk-Jaap Wagenaar added the comment: I think this showcases how difficult it is to get this right, requires carefully reading the EBNF language spec, not just the text, and the behaviour is unexpected. -- ___ Python tracker <https://bugs.python.org/issue32012> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)
Henk-Jaap Wagenaar added the comment: This is still present, and also silently affects Python 2.7 as evidenced here: https://github.com/pypa/setuptools/issues/1163 I am happy to adapt Berker Peksags patch to a PR, if he is? -- nosy: +Henk-Jaap Wagenaar versions: +Python 3.6, Python 3.7 -Python 3.5 ___ Python tracker <https://bugs.python.org/issue19610> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32117] Tuple unpacking in return and yield statements
Henk-Jaap Wagenaar added the comment: I think the language spec needs updating as well? In particular in https://docs.python.org/3/reference/simple_stmts.html#the-return-statement it seems expression_list should be replaced by starred_list. -- nosy: +Henk-Jaap Wagenaar ___ Python tracker <https://bugs.python.org/issue32117> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32188] ImpImporter.find_modules removes symlinks in paths
New submission from Henk-Jaap Wagenaar : ImpImporter.find_modules calls os.path.real on the path used: https://github.com/python/cpython/blob/be6b74c0795b709c7a04e2187a7e32d08f5155f6/Lib/pkgutil.py#L181 This means if there is a submodule (foo.bar) which first appears on the path involving a symlink that pkgutil.find_loader('foo').get_filename() has the path with the symlinks removed whereas import foo foo.__file__ does have the symlinks. Note that is in the absence of any PEP302 import hooks. This behaviour comes up in pytest test/plugin collection in virtual environments in Py2.7 on linux where they have a symlinked venv/local/lib before venv/lib on the path and creates problems. There might very well be a good reason the path is made absolute here, however the test suite passes when it is reverted to path = [self.path]. -- components: Library (Lib) messages: 307353 nosy: Henk-Jaap Wagenaar priority: normal severity: normal status: open title: ImpImporter.find_modules removes symlinks in paths type: behavior versions: Python 2.7, Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue32188> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32188] ImpImporter.find_modules removes symlinks in paths
Henk-Jaap Wagenaar added the comment: Ignoring testing code, there is minimal use of os.path.realpath in the stdlib (https://github.com/python/cpython/search?utf8=%E2%9C%93&q=%22os.path.realpath%22&type=): - Lib/platform.py: used before opening a file (works around a cygwin bug) - Lib/unittest/loader.py: used to compare two paths for equality - Lib/pkgutil.py: as outlined in this issue - Lib/pydoc.py: used to determine the directory - Lib/inspect.py: path and realpath added to caching dictionary So the question that remains is whether __import__ does this on the hood? I get not due to the difference noted in the OP betweein importing and using pkgutil. -- ___ Python tracker <https://bugs.python.org/issue32188> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32188] ImpImporter.find_modules removes symlinks in paths
Change by Henk-Jaap Wagenaar : -- keywords: +patch pull_requests: +4580 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32188> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21241] Variable name with number causes interactive console to crash
New submission from Henk-Jaap Wagenaar: Executing in the interactive console: "foo1 = 0" and then "foo1" gives "Segmentation Fault: 11" on OS X 10.9.2, Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] If foo1 is defined in a program, and interactive mode is entered, assigning a value to it seg faults the console as well, but executing "foo1" *does* work. It does not seem to crash problems on my friends PC (running Ubuntu). -- messages: 216334 nosy: Henk-Jaap.Wagenaar priority: normal severity: normal status: open title: Variable name with number causes interactive console to crash versions: Python 3.3 ___ Python tracker <http://bugs.python.org/issue21241> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21241] Variable name with number causes interactive console to crash
Changes by Henk-Jaap Wagenaar : -- type: -> crash ___ Python tracker <http://bugs.python.org/issue21241> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com