deprecation-warning

Convention for HTTP response header to notify clients of deprecated API

倾然丶 夕夏残阳落幕 提交于 2019-11-29 22:35:09
I'm upgrading our REST API endpoints and I want to notify clients when they are calling the to-be-deprecated endpoint. What header should I use in the response with a message along the lines of "This API version is being deprecated, please consult the latest documentation to update your endpoints" I would not change anything in the status code to be backward compatible. I would add a "Warning" header in the response : Warning: 299 - "Deprecated API" You can also specify the "-" with the "Agent" that emits the warning, and be more explicit in the warn-text : Warning: 299 api.blazingFrog.com

How to silence EllipticCurvePublicNumbers.encode_point CryptographyDeprecationWarning when using Paramiko in Python

守給你的承諾、 提交于 2019-11-29 10:36:12
CryptographyDeprecationWarning: encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding. This has been fixed in Paramiko 2.5.0 already: https://www.paramiko.org/changelog.html#2.5.0 https://github.com/paramiko/paramiko/pull/1379 https://github.com/paramiko/paramiko/issues/1369 I've had better success with: import warnings warnings.simplefilter("ignore", cryptography.utils.DeprecatedIn23) 来源: https://stackoverflow.com/questions/54861026/how-to

How to warn about class (name) deprecation

非 Y 不嫁゛ 提交于 2019-11-28 20:50:49
问题 I have renamed a python class that is part of a library. I am willing to leave a possibility to use its previous name for some time but would like to warn user that it's deprecated and will be removed in the future. I think that to provide backward compatibility it will be enough to use an alias like that: class NewClsName: pass OldClsName = NewClsName I have no idea how to mark the OldClsName as deprecated in an elegant way. Maybe I could make OldClsName a function which emits a warning (to

Convention for HTTP response header to notify clients of deprecated API

若如初见. 提交于 2019-11-28 17:29:09
问题 I'm upgrading our REST API endpoints and I want to notify clients when they are calling the to-be-deprecated endpoint. What header should I use in the response with a message along the lines of "This API version is being deprecated, please consult the latest documentation to update your endpoints" 回答1: I would not change anything in the status code to be backward compatible. I would add a "Warning" header in the response : Warning: 299 - "Deprecated API" You can also specify the "-" with the

Method setDrawerListener is deprecated

旧时模样 提交于 2019-11-28 15:13:28
问题 While I'm doing something on my app, I see that the navigation drawer on my app reduced its size. But I'm not doing anything on that. Then, after checking the code, I saw that setDrawerListener is deprecated. Does anyone has a solution to this? Any help will do. Thank you in advance! drawerLayout.setDrawerListener(actionBarDrawerToggle); 回答1: Use addDrawerListener() instead. 回答2: Replace: drawer.setDrawerListener(...); with drawer.addDrawerListener(...); public void setDrawerListener

What does DeprecationWarning mean when running Python

偶尔善良 提交于 2019-11-28 14:53:38
I ran a Python program and got a DeprecationWarning , like: D:\programs\anaconda2\lib\site-packages\sklearn\utils\deprecation.py:70: DeprecationWarning: Function log_multivariate_normal_density is deprecated; The function log_multivariate_normal_density is deprecated in 0.18 and will be removed in 0.20. warnings.warn(msg, category=DeprecationWarning) I can't confirm what is wrong about it. What is a DeprecationWarning ? In general developers are developing libraries and in developing sometime add o change thing and sometime remove theme. removing is danger because user may used that and if a

DEPRECATION WARNING: Dangerous query method: Random Record in ActiveRecord >= 5.2

白昼怎懂夜的黑 提交于 2019-11-28 00:40:29
So far, the "common" way to get a random record from the Database has been: # Postgress Model.order("RANDOM()").first # MySQL Model.order("RAND()").first But, when doing this in Rails 5.2, it shows the following Deprecation Warning: DEPRECATION WARNING: Dangerous query method (method whose arguments are used as raw SQL) called with non-attribute argument(s): "RANDOM()". Non-attribute arguments will be disallowed in Rails 6.0. This method should not be called with user-provided values, such as request parameters or model attributes. Known-safe values can be passed by wrapping them in Arel.sql()

setBackgroundDrawable() deprecated

空扰寡人 提交于 2019-11-27 20:57:49
So my sdk goes from 15 to 21 and when I call setBackgroundDrawable() , Android Studio tells me that it's deprecated. I thought of going around it using: int sdk = android.os.Build.VERSION.SDK_INT; if(sdk < android.os.Build.VERSION_CODES.JELLY_BEAN) { layout.setBackgroundDrawable(getResources().getDrawable(R.drawable.img_wstat_tstorm)); } else { layout.setBackground(getResources().getDrawable(R.drawable.img_wstat_tstorm)); } But then, I get an error at "setBackground()". So, how would you deal with it? Alex K It's an interesting topic. The way you are doing it is correct, apparently. It is

Turn off deprecated errors php 5.3

会有一股神秘感。 提交于 2019-11-27 11:30:50
My server is running php 5.3 and My wordpress install is spitting these errors out on me causing the my session_start() to break. Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 647 Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 662 Deprecated: Assigning the return value of new by reference is deprecated in /home//public_html/hub/wp-settings.php on line 669 Deprecated: Assigning the return value of new by reference is deprecated in /home//public

Glut deprecation in Mac OSX 10.9, IDE: QT Creator

爷,独闯天下 提交于 2019-11-27 08:58:15
I was trying to build an opengl program on qt creator, installed on my mac, with osx 10.9. I got several warnings on glut functions about its deprecation in osx10.9, a sample error message is like: 'glutInit' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations] glutInit(&argc, &argv); ^ I wonder if GLUT.h is not usable anymore in osx10.9? According to some other posts, it is said that as long as we change "OS X Deployment Target" back to OSX10.8, then it works. How to do so in qtcreator? Thank you! You can still use it in 10.9. They're sending you a pretty strong signal