Category Archives: How to Fix

Solving windows error: [error 87] classification: problem summary

Today’s implementation B= webdriver.Firefox () is an error report. My version is 19.0 for Firefox and 2.37 for selenium.

In the following two cases: A, B,

All of them are caused by the incompatibility between the firebox version and selenium version http://docs.seleniumhq.org/about/platforms.jsp Page to view the version information of Microsoft supported by selenium

(it is found that selenium does not support firebox version 19.0)

A.

Traceback (most recent call last):

  File “C:\Users\tomet\Desktop\a.py”, line 10, in <module>

    b =  webdriver.Firefox ()

  File “C:\Python27\lib\site-packages\selenium\webdriver\firefox\ webdriver.py “, line 59, in __ init__

     self.binary , timeout),

File “C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_ connection.py “, line 47, in __ init__

     self.binary.launch_ browser( self.profile )

  File “C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_ binary.py “, line 61, in launch_ browser

    self._ wait_ until_ connectable()

  File “C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_ binary.py “, line 105, in _ wait_ until_ connectable

     self.profile.path , self._ get_ firefox_ output()))

WebDriverException: Message: “Can’t load the profile. Profile Dir: c:\\users\\chengh~1.qun\\appdata\\local\\temp\\tmpqdnfky Firefox output: *** LOG  addons.xpi : startup\r\n*** LOG  addons.xpi : Skipping unavailable install location app-system-local\r\n*** LOG  addons.xpi : Skipping unavailable install location app-system-sha re\r\n*** LOG  addons.xpi : checkForChanges\r\n”

B.

startupinfo() error 87

Copyright notice: This article is the original article of the blogger and cannot be reproduced without the permission of the blogger.

Reproduced in: https://www.cnblogs.com/think1988/p/4627912.html

error C1189: #error : Please use the /MD switch for _ Afxdll builds — solutions

The general method found on the Internet is to change “property page – & gt; configuration property – & gt; C/C + + – & gt; code generation – & gt; runtime” from “multi thread (/ MT)” to “multi thread DLL (/ MD)”.
MT is a static compilation option, while MD is a dynamic compilation option. What if you want to compile statically?

In fact, while setting “runtime” to MT, you can change “property page – & gt; configuration property – & gt; general – & gt; use of MFC” to “use MFC in static library”
.
IntelliSense: error instruction: please use the/MD switch for_ Afxdll builds – Solutions – ordinarydilligent – Zhang Sir’s blog

IntelliSense: error instruction: please use the/MD switch for_ Afxdll builds – Solutions – ordinarydilligent – Zhang Sir’s blog

Similarly, if you want to compile dynamically, for:
error 1, error C1189: # error: building MFC application with/MD [D] (CRT DLL version) requires MFC shared DLL version. Please define_ AFXDLL or do not use /MD[d]

You need to set “property page – & gt; configuration property – & gt; general – & gt; use of MFC” to “use MFC in shared DLL”, and set “property page – & gt; configuration property – & gt; C/C + + – & gt; code generation – & gt; runtime” to “multithreaded DLL (/ MD)”

Supplement: (/ MD) and (/ MT) are used to compile release version, (/ MDD) and (/ MTD) are used to compile debug version

Error: Exception was raised when calling per-thread-terminate function in extension lrwreplaymain.dl

Error: exception was raised when calling per thread terminate function in extension occurs when LR is used for stress test lrwreplaymain.dll : System Exceptions: EXCEPTION_ ACCESS_ Message
.

Solution:
create a new temp folder on Disk C (or any other disk)
right click “my computer” & gt; advanced – & gt; environment variables – & gt; edit and modify the directory of all temp variables, and point to the new directory, such as my pointing to C: temp, and save it. [@more@]

From “itpub blog”, link: http://blog.itpub.net/124805/viewspace-1045772/ If you need to reprint, please indicate the source, otherwise you will be investigated for legal responsibility.

Reproduced in: http://blog.itpub.net/124805/viewspace-1045772/

log4j:ERROR

I encountered this problem when writing Java log 4J log

I went to Baidu first. The possible reasons are as follows:

The jar package of 1 ﹣ log4j ﹣ is not correct

2. Install MyEclipse to disk C

3. The C disk of the computer is set with permission and cannot access the C: mylog.log PS: my problem

Then go to the log4j configuration file and modify the path

Change the path to disk d to solve the problem^-^

Thank you for your help~~~~~~

Solution: windowserror: [error 2]

There is a problem when renaming a file by using the rename() function of python, which prompts windows error: [error 2]. The initial code is as follows:

def renameFile(filename):
    filePre = "D:\\FileDemo\\Python\\pt.py"
    os.rename(filePre, filename)
    print os.listdir(filePre)

if __name__ == '__main__':
    fileNew = "D:\\FileDemo\\Python\\Test.py"
   renameFile(fileNew)

Later, after repeated attempts, the problem was solved~

Before rename, you need to use the chdir() function to enter the path of the target file to tell the python compiler where the file to be renamed is, and then you can modify it;

Python is not a terrible terminator. In fact, she is very young. She can’t find the file herself. We need to tell her where to find the path in detail and patiently os.path.dirname () function

import os
from nt import chdir

def renameF(preName, newName):
    chdir(os.path.dirname(preName))
    os.rename(preName, newName)

if __name__ == '__main__':
    filePre = "D:\FileDemo\Python\PT.py"
    fileNew = "D:\FileDemo\Python\Test.txt"
    renameF(filePre, fileNew)

The code is very simple. You can rename any file by modifying filepre and FileNew.

Python windows error: [error 3] and common windows error errors

1、 The common causes and solutions of error3 are as follows

1. The MKDIR function creates several directories in succession. In other words, there is no f/AA/originally. If you need to create f/AA/BB, you will get this error,

Solution, layer by layer detection, or directly use the makedirs function.

2. Lisdir enumerates directories that do not exist.

Solution: before enumerating, judge whether the changed path exists.

3. Creating a file in a read-only folder will also produce the above error.

4. Coding problem: pay attention to the coding format of the file, and modify it in the first line of Py file.

2、 Common windows error and its causes

Windows error: [error 2] does not exist

Windows error: [error 3] does not have this path

Windows error: [error 5] permission problem

Windows error: [error 13] this document is occupied by other programs and cannot be processed

Windows error: [error 123] path syntax error
error

Windows error: [error 145] the directory is not empty. It often appears when deleting a non empty directory

AAPT: error: resource android:attr/colorError not found.

As error:

AAPT: error: resource android:attr/colorError not found.

Solutions:
1 build.gradle Set as follows:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.lgl.answersystem"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
    }

Later, an error was reported

AAPT: error: resource android:attr/dialogCornerRadius not found.

terms of settlement:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.2"

    defaultConfig {
        applicationId "com.lgl.answersystem"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }

ERROR 1406 (22001): Data Too Long, field len 30, data len 48

 

It’s strange to encounter a maintenance problem today:

Execute SQL statement insert into test.COLUMNS select * from information_ schema.COLUMNS ; error 1406 (22001): data too long, field len 30, data len 48

 

The background of the problem is like this:

1. Tidb4.0 distributed database system, de information_ schema.TABLES Copy a table structure as like as two peas, then build a blank table to a temporary library CSDN.

2. Execute insert into on the command line of tidb test.COLUMNS select * from information_ schema.COLUMNS ;

3. Try mysqldump from information_ If you export data from the tables table of the schema and import it into the tables table of the CSDN library, you will still report an error.

4. Two libraries information were checked_ Schema and CSDN libraries have the same table structure.

 

If there is an error, it should be that the field is only 30 long, but the entered data lacks 48 strings. Then check the table structure carefully

CREATE TABLE `TABLES` (
  `TABLE_CATALOG` varchar(512) DEFAULT NULL,
  `TABLE_SCHEMA` varchar(64) DEFAULT NULL,
  `TABLE_NAME` varchar(64) DEFAULT NULL,
  `COLUMN_NAME` varchar(64) DEFAULT NULL,
  `ORDINAL_POSITION` bigint(64) DEFAULT NULL,
  `COLUMN_DEFAULT` text DEFAULT NULL,
  `IS_NULLABLE` varchar(3) DEFAULT NULL,
  `DATA_TYPE` varchar(64) DEFAULT NULL,
  `CHARACTER_MAXIMUM_LENGTH` bigint(21) DEFAULT NULL,
  `CHARACTER_OCTET_LENGTH` bigint(21) DEFAULT NULL,
  `NUMERIC_PRECISION` bigint(21) DEFAULT NULL,
  `NUMERIC_SCALE` bigint(21) DEFAULT NULL,
  `DATETIME_PRECISION` bigint(21) DEFAULT NULL,
  `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL,
  `COLLATION_NAME` varchar(32) DEFAULT NULL,
  `COLUMN_TYPE` text DEFAULT NULL,
  `COLUMN_KEY` varchar(3) DEFAULT NULL,
  `EXTRA` varchar(30) DEFAULT NULL,
  `PRIVILEGES` varchar(80) DEFAULT NULL,
  `COLUMN_COMMENT` varchar(1024) DEFAULT NULL,
  `GENERATION_EXPRESSION` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

 

If you see that a field extra is’ extra ‘varchar (30) default null, check whether the value of the data in this field exceeds the value.

mysql-17:31:41> select length(EXTRA) l,EXTRA from information_schema.TABLES order by l desc limit 50;
+----+--------------------------------------------------+
| l  | EXTRA                                            |
+----+--------------------------------------------------+
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |
| 48 | DEFAULT_GENERATED on update CURRENT_TIMESTAMP(3) |

Check the length (extra). The maximum length is 48. Is that the reason for the character set?In a database like mysql, the character set is different and the space occupied is different.

 

First look at the character set of the library. It’s the same:

+----------+------------------------------------------------------------------+
| Database | Create Database                                                  |
+----------+------------------------------------------------------------------+
| csdn     | CREATE DATABASE `csdn` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+----------+------------------------------------------------------------------+

+--------------------+--------------------------------------------------------------------------------+
| Database           | Create Database                                                                |
+--------------------+--------------------------------------------------------------------------------+
| INFORMATION_SCHEMA | CREATE DATABASE `INFORMATION_SCHEMA` /*!40100 DEFAULT CHARACTER SET utf8mb4 */ |
+--------------------+--------------------------------------------------------------------------------+

 

Let’s look at the definition of character set in the following table again. Is it the same

use information_schema;
CREATE TABLE `TABLES` (
  `TABLE_CATALOG` varchar(512) DEFAULT NULL,
  `TABLE_SCHEMA` varchar(64) DEFAULT NULL,
  `TABLE_NAME` varchar(64) DEFAULT NULL,
  `COLUMN_NAME` varchar(64) DEFAULT NULL,
  `ORDINAL_POSITION` bigint(64) DEFAULT NULL,
  `COLUMN_DEFAULT` text DEFAULT NULL,
  `IS_NULLABLE` varchar(3) DEFAULT NULL,
  `DATA_TYPE` varchar(64) DEFAULT NULL,
  `CHARACTER_MAXIMUM_LENGTH` bigint(21) DEFAULT NULL,
  `CHARACTER_OCTET_LENGTH` bigint(21) DEFAULT NULL,
  `NUMERIC_PRECISION` bigint(21) DEFAULT NULL,
  `NUMERIC_SCALE` bigint(21) DEFAULT NULL,
  `DATETIME_PRECISION` bigint(21) DEFAULT NULL,
  `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL,
  `COLLATION_NAME` varchar(32) DEFAULT NULL,
  `COLUMN_TYPE` text DEFAULT NULL,
  `COLUMN_KEY` varchar(3) DEFAULT NULL,
  `EXTRA` varchar(30) DEFAULT NULL,
  `PRIVILEGES` varchar(80) DEFAULT NULL,
  `COLUMN_COMMENT` varchar(1024) DEFAULT NULL,
  `GENERATION_EXPRESSION` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;


use csdn;
CREATE TABLE `TABLES` (
  `TABLE_CATALOG` varchar(512) DEFAULT NULL,
  `TABLE_SCHEMA` varchar(64) DEFAULT NULL,
  `TABLE_NAME` varchar(64) DEFAULT NULL,
  `COLUMN_NAME` varchar(64) DEFAULT NULL,
  `ORDINAL_POSITION` bigint(64) DEFAULT NULL,
  `COLUMN_DEFAULT` text DEFAULT NULL,
  `IS_NULLABLE` varchar(3) DEFAULT NULL,
  `DATA_TYPE` varchar(64) DEFAULT NULL,
  `CHARACTER_MAXIMUM_LENGTH` bigint(21) DEFAULT NULL,
  `CHARACTER_OCTET_LENGTH` bigint(21) DEFAULT NULL,
  `NUMERIC_PRECISION` bigint(21) DEFAULT NULL,
  `NUMERIC_SCALE` bigint(21) DEFAULT NULL,
  `DATETIME_PRECISION` bigint(21) DEFAULT NULL,
  `CHARACTER_SET_NAME` varchar(32) DEFAULT NULL,
  `COLLATION_NAME` varchar(32) DEFAULT NULL,
  `COLUMN_TYPE` text DEFAULT NULL,
  `COLUMN_KEY` varchar(3) DEFAULT NULL,
  `EXTRA` varchar(30) DEFAULT NULL,
  `PRIVILEGES` varchar(80) DEFAULT NULL,
  `COLUMN_COMMENT` varchar(1024) DEFAULT NULL,
  `GENERATION_EXPRESSION` text NOT NULL,
  KEY `idx_pri` (`TABLE_SCHEMA`,`TABLE_NAME`,`COLUMN_KEY`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin

Of course, the solution is very simple, which is to modify the character length in the tables table of CSDN library

alter table csdn.TABLES modify `EXTRA` varchar(128) DEFAULT NULL;

 

But why information_ In the tables table of the schema library, why can 48 characters be accessed in ‘extra’ varchar (30) default null?This problem is worthy of further study.

How to Solve MacOS Big Sur MySQL workbench flashback problem

The program is executed directly from the command line

$ /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench
Fatal Python error: initfsencoding: unable to load the file system codec, sys.path = ['/Applications/MySQLWorkbench.app/Contents/Resources/libraries', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload']
ModuleNotFoundError: No module named 'encodings'

Current thread 0x000000010a883e00 (most recent call first):
Abort trap: 6

After checking that there is no Python 3.7 on the system, the solution is as follows:

# Install python 3.7
$ brew install [email protected]
# Create a soft connection
$ sudo ln -s /usr/local/Cellar/python\@3.7/3.7.10/Frameworks/Python.framework /Library/Frameworks/Python.framework

Run MySQL workbench again successfully.